CuzIm1Tigaaa / Spectator

This Plugin allows you to easily spectate players without needing permissions for /gamemode!
10 stars 2 forks source link

[Bug] Using /spec playername on players in Multiverse disallowed worlds #11

Closed RillSoji closed 1 year ago

RillSoji commented 1 year ago

Minor issue I ran into while testing.

When using Multiverse Core's enforced access on worlds if a player tries to use the /spec playername command on a player who is in a world they don't have access to it will spam them with the Multiverse access deny message. I believe the spectator plugin is continuously attempting to spec to the player and multiverse is intercepting the teleport. It only stops when the player uses /spec to leave spectator mode. It also generated an exception and error in console which I've pasted below.

specerror

Console02:46:10 [Spectator]: Task #772 for Spectator v1.9.1 generated an exception java.lang.IllegalArgumentException: Player must be in spectator mode at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.1-jre.jar:?] at org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer.setSpectatorTarget(CraftPlayer.java:2553) ~[paper-1.20.1.jar:git-Paper-95] at de.cuzim1tigaaa.spectator.player.SpectateManager.lambda$run$0(SpectateManager.java:37) ~[Spectator-1.9.1.jar:?] at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.1.jar:git-Paper-95] at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[paper-1.20.1.jar:git-Paper-95] at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1480) ~[paper-1.20.1.jar:git-Paper-95] at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.20.1.jar:git-Paper-95] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1394) ~[paper-1.20.1.jar:git-Paper-95] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1171) ~[paper-1.20.1.jar:git-Paper-95] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-95] at java.lang.Thread.run(Thread.java:833) ~[?:?]

CuzIm1Tigaaa commented 1 year ago

Fixed in the newest version, thank you for your report!