WolfyScript / CustomCrafting

Spigot based plugin to create your own custom Recipes & Items. Designed to be easy to use with in-game GUI and tons of configuration possibilities.
https://modrinth.com/plugin/customcrafting
GNU General Public License v3.0
113 stars 36 forks source link

Could not pass event InventoryClickEvent when using grindstone #382

Closed xpringle closed 3 months ago

xpringle commented 3 months ago

What happened?

When crafting a grindstone recipe, the console outputs a "Could not pass event InventoryClickEvent" error. The grindstone will also sometimes delete the input stack when performing the recipe, such as when shift-clicking the result.

How can the bug be reproduced?

  1. Create a grindstone recipe, possibly requiring multiple input items (not sure, haven't tested)
  2. Try to perform the recipe with a full stack in the input field, and shift-click the result item multiple times.

Expected Behaviour?

The input stack does not get deleted sometimes, and the console doesn't output any errors.

Plugin version

customcrafting-spigot-4.16.11, wolfyutils-spigot-4.17-beta.6

Server software

Paper version 1.20.6-148-ver

Relevant log output

[00:03:04 ERROR]: Could not pass event InventoryClickEvent to CustomCrafting v4.16.11
java.lang.NullPointerException: Cannot invoke "com.wolfyscript.utilities.bukkit.world.items.reference.StackReference.referencedStack()" because the return value of "me.wolfyscript.customcrafting.recipes.data.IngredientData.reference()" is null
        at customcrafting-spigot-4.16.11.jar/me.wolfyscript.customcrafting.listeners.GrindStoneListener.lambda$onCollectResult$1(GrindStoneListener.java:121) ~[customcrafting-spigot-4.16.11.jar:?]
        at java.base/java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
        at customcrafting-spigot-4.16.11.jar/me.wolfyscript.customcrafting.listeners.GrindStoneListener.onCollectResult(GrindStoneListener.java:120) ~[customcrafting-spigot-4.16.11.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor727.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:1.20.6-148-20f5165]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:3177) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:69) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:33) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:55) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1511) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:195) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1488) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1411) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1377) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1238) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

Submit issue