mfnalex / ChestSort

Best sorting plugin for Minecraft / Spigot 1.14+
https://www.chestsort.de
GNU General Public License v3.0
91 stars 34 forks source link

`Could not pass event InventoryClickEvent to ChestSort` in versions 12.1.1+ #139

Closed gazpachoking closed 2 years ago

gazpachoking commented 2 years ago

Used ChestSort version 12.1.2

Used Spigot version This server is running Paper version git-Paper-64 (MC: 1.18) (Implementing API version 1.18-R0.1-SNAPSHOT) (Git: b475c6a)

Describe the bug Using any of the sorting methods causes a crash.

To Reproduce Try to sort any chest.

Expected behavior Chest gets sorted.

Additional context This problem was introduced in 12.1.1. Using version 12.1.0 I do not have the same issue.

[15:43:44 ERROR]: Could not pass event InventoryClickEvent to ChestSort v12.1.2
java.lang.NullPointerException: null
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at de.jeff_media.chestsort.hooks.ShulkerPacksHook.isOpenShulkerPack(ShulkerPacksHook.java:42) ~[ChestSort-LATEST-[12.1.2].jar:?]
        at de.jeff_media.chestsort.handlers.ChestSortOrganizer.sortInventory(ChestSortOrganizer.java:556) ~[ChestSort-LATEST-[12.1.2].jar:?]
        at de.jeff_media.chestsort.handlers.ChestSortOrganizer.sortInventory(ChestSortOrganizer.java:490) ~[ChestSort-LATEST-[12.1.2].jar:?]
        at de.jeff_media.chestsort.listeners.Listener.onHotkey(Listener.java:590) ~[ChestSort-LATEST-[12.1.2].jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor52.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[paper-api-1.18-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.18-R0.1-SNAPSHOT.jar:git-Paper-64]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.18-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.18-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:2816) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:58) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:13) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.18.jar:git-Paper-64]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1413) ~[paper-1.18.jar:git-Paper-64]
        at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:189) ~[paper-1.18.jar:git-Paper-64]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1391) ~[paper-1.18.jar:git-Paper-64]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1384) ~[paper-1.18.jar:git-Paper-64]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1362) ~[paper-1.18.jar:git-Paper-64]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1268) ~[paper-1.18.jar:git-Paper-64]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.jar:git-Paper-64]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
mfnalex commented 2 years ago

You are probably using an old version of ShulkerPacks and already got another error message earlier, right? Update to the latest ShulkerPacks and ChestSort to 12.1.3 please

gazpachoking commented 2 years ago

Hmm, seems you are correct that it's a conflict with ShulkerPacks, I disabled that and everything worked fine. I'm using ShulkerPacks 1.6.1, which appears to be the latest. I don't see any error messages before the one I posted. I just updated ChestSort to 12.1.3, and am still having the same issue if ShulkerPacks is enabled.

N1ghthauq commented 2 years ago

I know I am not adding much other than credibility, but I am having the same issue. Running paper build 65 on 1.18, chestsort 12.1.3, shulkerpacks 1.6.1 (which is the latest on their spigot page), and I get the same console read out.

mfnalex commented 2 years ago

Ugh I actually talked to the dev of ShulkerPacks and they said actually made a small change to the code that I suggested, but still didn't upload it. Sorry but you'll have to contact them again to upload the newest version. Without the changes in ChestSort, it was possible to duplicate items using ShulkerPacks because of the way ShulkerPacks is mapping inventories to shulker boxes.

mfnalex commented 2 years ago

I just saw that ShulkerPack's code on GitHub already contains the changes. You can just compile it yourself until it got uploaded to SpigotMC.

mfnalex commented 2 years ago

They'll release a new ShulkerPacks version soon, please let me know if this fixes it for you.

mfnalex commented 2 years ago

ShulkerPacks update was released, works fine with ChestSort 12.1.3 :)