PvP always enabled on join and Exceptions
EvilOlaf opened this issue ยท 12 comments
Build 183
When players joining their pvp status is always enabled even if they disabled it earlier.
Also found a couple of these exceptions in the logs.
[14:45:25] [Server thread/ERROR]: Could not pass event PlayerJoinEvent to PvPManager v3.0
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.PlayerList.onPlayerJoin(PlayerList.java:298) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.PlayerList.a(PlayerList.java:157) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.LoginListener.b(LoginListener.java:144) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.LoginListener.c(LoginListener.java:54) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.NetworkManager.a(NetworkManager.java:231) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.ServerConnection.c(ServerConnection.java:148) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:814) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_66]
Caused by: java.lang.NullPointerException
at me.NoChance.PvPManager.Managers.ConfigManager.getUserData(ConfigManager.java:143) ~[?:?]
at me.NoChance.PvPManager.Managers.PlayerHandler.addUser(PlayerHandler.java:91) ~[?:?]
at me.NoChance.PvPManager.Managers.PlayerHandler.get(PlayerHandler.java:83) ~[?:?]
at me.NoChance.PvPManager.Listeners.PlayerListener.onPlayerJoin(PlayerListener.java:180) ~[?:?]
at sun.reflect.GeneratedMethodAccessor598.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_66]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_66]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-5f38d38-efd6cb0]
... 14 more
There is no more exception. However the pvp status is still enabled by default after rejoin.
Build 191
It's working fine here, disabled pvp, relogged and then restarted server and it was still disabled.
Alright, that's something different then, the pvp state is saving fine but the nametags are buggy, is that it?
Then the name tags seem to do not work properly. I turned my pvp on and of and checked if the predefined nametag color changes which worked as expected.
Then I rejoined and notice that I had the color of active pvp. /pvpstatus told me it is deactivated though. So I did /pvp which responded pvp is now active. The color did not change. Doing /pvp again to disable it also changed the color.
Could you take another look into this?
Not sure if I mentioned earlier somewhere... When two players are in combat they are getting properly tagged. The tags from PvP Toggle:
section do not work though.
My maven repo is probably down, you can compile FactionsUUID from here though: https://github.com/drtshock/Factions
Sorry for the removed comment, I found the UUID library JAR file at the end.
After some investigation, it would seem that getting UUID, which seems to be done asynchronously is the cause of false PvP - noPvP tags being shown for the player.
A solution for me was adding a simple line at the end of me.NoChance.PvPManager.PvPlayer
's loadData(final Map<String, Object> userData)
method:
this.teamProfile.setPvP(this.pvpState);
Wouldn't want to do a pull request, since my Eclipse code-corrected a lot of the file, which probably not what you want. Hope this helps :)
This should be fixed 3efbf3e