alexbennett / JustAFK

A simple, yet powerful, AFK (away from keyboard) plugin for Bukkit.
MIT License
4 stars 7 forks source link

Could not pass event PlayerMoveEvent to JustAFK v1.3 #8

Open bog500 opened 8 years ago

bog500 commented 8 years ago

It usually works fine, but sometimes my console is spammed with this error :

[21:58:54] [Server thread/ERROR]: Could not pass event PlayerMoveEvent to JustAFK v1.3 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:270) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.PacketPlayInFlying.a(SourceFile:126) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.PacketPlayInFlying$PacketPlayInPosition.a(SourceFile:57) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_60] at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_60] at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-76236cb-c373061] at java.lang.Thread.run(Unknown Source) [?:1.8.0_60] Caused by: java.lang.NullPointerException at net.alexben.JustAFK.JustAFK.onPlayerMove(JustAFK.java:216) ~[?:?] at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) ~[?:?] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.8.8.jar:git-Spigot-76236cb-c373061] ... 15 more

alexbennett commented 8 years ago

Hi bog,

Due to school I have not been maintaining JustAFK and have not actually updated it since 2013. I expect there are many bugs that go unreported because of this reason. I greatly appreciate you taking the time to open an issue here but I do not have any plans to continue support for this plugin.

I see you have some programming experience so please feel free to fork this repo and perform the fixes you see fit. You may want to add a null pointer check to the onPlayerMove() listener in the JustAFK.java file as indicated by the error you posted:

Caused by: java.lang.NullPointerException at net.alexben.JustAFK.JustAFK.onPlayerMove(JustAFK.java:216) ~[?:?] ...

While it may not solve the root issue (likely a conflict with another plugin), it will at least clear the error from your console.

Best, Alex

bog500 commented 8 years ago

Hi Alex,

Thanks for your quick feedback. I will fork the code and do some minor changes.

alexbennett commented 8 years ago

Sounds great.

You may also want to check out a fork that a friend of mine made back in August: https://github.com/HmmmQuestionMark/JustAFK

He updated it to the Java 8 JDK and to a more current build of Minecraft as well as included a couple of general updates/fixes.

bog500 commented 8 years ago

ok. Any reason why his fork wasn't pulled into this one ? and is the version on dev.bukkit.org this one or his ?

alexbennett commented 8 years ago

No specific reason, I just never got around to pulling it over. He didn't make a pull request either, just simply updated it and I only recently realized it. His version is also newer than the Bukkit Dev version.