Open zPurge opened 4 years ago
I have a similar issue after a reload. Sometimes when the NPCs spawn they are correctly visible, sometimes they are visible but not interactable, and sometimes they are working like they should. Teleporting to myself or relogging works, then they are all visible again.
As posted in pre-release 2.12-SNAPSHOT, I will be redesigning the auto show hide mechanics using information provided in #101. Hopefully this issue will be resolved thereafter.
Describe the bug Sometimes if you join, the NPC doesn't show because it's already "shown", but it's just invisibile.
NPCLib usage option Maven dependency
NPCLib JAR name E.g. npclib-plugin-2.0.1-SNAPSHOT.jar
Server version Paper version git-Paper-1104 (MC: 1.11.2) (Implementing API version 1.11.2-R0.1-SNAPSHOT)
To Reproduce Join the server a few times and it should happen.
Expected behavior The API trying to hide the npc and show it again.
ERROR:
[VultexHub] Task #167 for VultexHub v1.0.0 generated an exception java.lang.IllegalArgumentException: NPC is already shown to player at net.jitse.npclib.internal.NPCBase.show(NPCBase.java:183) ~[?:?] at net.jitse.npclib.internal.NPCBase.show(NPCBase.java:172) ~[?:?] at nl.diszy.vultex.Hub.NPC.NPCManager.lambda$2(NPCManager.java:177) ~[?:?] at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58) ~[server.jar:git-Paper-1104] at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:356) [server.ja r:git-Paper-1104] at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:829) [server.jar:git-Paper-1104] at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:403) [server.jar:git-Paper-1104] at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:763) [server.jar:git-Paper-1104] at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:661) [server.jar:git-Paper-1104] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]
Line 177 in NPCManager from my plugin:
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Vultex.plugin, () -> { potpvp.show(event.getPlayer()); ffa.show(event.getPlayer()); eventnpc.show(event.getPlayer()); }, 30L);