Slimefun

Slimefun

3M Downloads

Spam error on ItemUseEvent

FabioZumbi12 opened this issue ยท 3 comments

commented

Description (Required)

Spams errors on console infinitelly about ItemUseevent and dont need player interactions to spam that.

Steps to reproduce the Issue (Required)

Just started after the update to 299. Dont know what causes, players is not using item at the momento of the spam.

Expected behavior (Required)

Server Log / Error Report

Edit: Found the complete error, who will help to fix

[16:04:24] [Server thread/ERROR]: Could not pass event ItemUseEvent to Slimefun vDEV - 299 (git a2fe40cf)
java.lang.NullPointerException: null
	at me.mrCookieSlime.Slimefun.api.Slimefun.isEnabled(Slimefun.java:211) ~[?:?]
	at me.mrCookieSlime.Slimefun.api.Slimefun.hasUnlocked(Slimefun.java:153) ~[?:?]
	at me.mrCookieSlime.Slimefun.listeners.ItemListener.onRightClick(ItemListener.java:230) ~[?:?]
	at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor270.execute(Unknown Source) ~[?:?]
	at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.14.4.jar:git-Paper-213]
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.14.4.jar:git-Paper-213]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.14.4.jar:git-Paper-213]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:545) ~[patched_1.14.4.jar:git-Paper-213]
	at me.mrCookieSlime.CSCoreLibPlugin.events.Listeners.ItemUseListener.onRightClick(ItemUseListener.java:22) ~[?:?]
	at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor230.execute(Unknown Source) ~[?:?]
	at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.14.4.jar:git-Paper-213]
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.14.4.jar:git-Paper-213]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.14.4.jar:git-Paper-213]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:545) ~[patched_1.14.4.jar:git-Paper-213]
	at org.bukkit.craftbukkit.v1_14_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:454) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.PlayerInteractManager.a(PlayerInteractManager.java:441) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1361) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:27) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:5) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:1029) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:1022) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1006) ~[patched_1.14.4.jar:git-Paper-213]
	at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:929) ~[patched_1.14.4.jar:git-Paper-213]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]

image

Environment (Required)

image

commented

Update

commented

I've updated, but instead this error, all players cant break blocks, open chests and do nothing on world! Only on build 301 the players can play normally (whit the error above). The frozen bug starts from +302!

commented

Vanilla items now hit the final else e.setCancelled(true); https://github.com/TheBusyBiscuit/Slimefun4/blob/090f45d93ff8231afbd7c1256020de40d6c63775/src/me/mrCookieSlime/Slimefun/listeners/ItemListener.java#L302
I'm not exactly sure exactly what that case is supposed to handle, but I can confirm that replacing it with else if (slimefunItem != null) e.setCancelled(true); fixes the issue. There may be a cleaner solution, but I'm afraid to break anything (case in point: this)