VolmitSoftware / React

Smart Server Performance
https://volmit.com
GNU General Public License v3.0
95 stars 52 forks source link

Incompatibility with overriding RegisteredListener #624

Open Janmm14 opened 1 year ago

Janmm14 commented 1 year ago

The purcharseable anticheat plugin Intave extends RegisteredListener. The executor field is therefore not guaranteed to be filled, causing errors like

NullPointerException: Cannot invoke "org.bukkit.plugin.EventExecutor.execute(org.bukkit.event.Listener, org.bukkit.event.Event)" because "this.executor" is null ``` [02:09:57 ERROR]: Could not pass event PlayerMoveEvent to Intave v14.6.4 java.lang.NullPointerException: Cannot invoke "org.bukkit.plugin.EventExecutor.execute(org.bukkit.event.Listener, org.bukkit.event.Event)" because "this.executor" is null at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?] at com.volmit.react.api.event.NaughtyRegisteredListener.callEvent(NaughtyRegisteredListener.java:31) ~[React.jar:?] at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.20.1.jar:git-Purpur-2028] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.1.jar:git-Purpur-2028] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.handleMovePlayer(ServerGamePacketListenerImpl.java:1707) ~[?:?] at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.handle(ServerboundMovePlayerPacket.java:29) ~[?:?] at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos.handle(ServerboundMovePlayerPacket.java:66) ~[?:?] at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:51) ~[?:?] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.1.jar:git-Purpur-2028] at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?] at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1366) ~[purpur-1.20.1.jar:git-Purpur-2028] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[purpur-1.20.1.jar:git-Purpur-2028] at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?] at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1343) ~[purpur-1.20.1.jar:git-Purpur-2028] at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1336) ~[purpur-1.20.1.jar:git-Purpur-2028] at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?] at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1314) ~[purpur-1.20.1.jar:git-Purpur-2028] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1202) ~[purpur-1.20.1.jar:git-Purpur-2028] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.1.jar:git-Purpur-2028] at java.lang.Thread.run(Thread.java:833) ~[?:?] ```

In order to fix this issue, please save the entire RegisteredListener object in your NaughtyRegisteredListener and use its callEvent method.

555vedant commented 11 months ago

respected sir , i wanted to work with this code i wanted to fix it.