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
115 stars 35 forks source link

Itemsadder item adding recipe bug #383

Closed zeonch4ik closed 1 month ago

zeonch4ik commented 1 month ago

What happened?

When im trying to make custom recipe using itemsadder item plugin stop working

How can the bug be reproduced?

Do recipe using itemsadder item

Expected Behaviour?

Simply made a recipe

Plugin version

customcrafting-spigot-4.16.11, wolfyutils-spigot-4.17-beta.6, ItemsAdder_4.0.2-alpha-test-3

Server software

purpur 1.21 last

Relevant log output

[12:44:11 WARN]: [CustomCrafting] Task #2888153 for CustomCrafting v4.16.11 generated an exception
java.lang.ClassCastException: Cannot cast ia.m.eH to org.bukkit.craftbukkit.inventory.CraftItemStack
        at java.base/java.lang.Class.cast(Class.java:4067) ~[?:?]
        at org.bukkit.craftbukkit.inventory.CraftItemStack.getCraftStack(CraftItemStack.java:46) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(CraftItemStack.java:97) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at org.bukkit.craftbukkit.inventory.CraftInventory.setItem(CraftInventory.java:100) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at wolfyutils-spigot-4.17-beta.6 (1).jar/me.wolfyscript.utilities.api.inventory.gui.button.buttons.ItemInputButton.render(ItemInputButton.java:107) ~[wolfyutils-spigot-4.17-beta.6 (1).jar:?]
        at wolfyutils-spigot-4.17-beta.6 (1).jar/me.wolfyscript.utilities.api.inventory.gui.GuiUpdate.renderButton(GuiUpdate.java:199) ~[wolfyutils-spigot-4.17-beta.6 (1).jar:?]
        at wolfyutils-spigot-4.17-beta.6 (1).jar/me.wolfyscript.utilities.api.inventory.gui.GuiUpdate.setButton(GuiUpdate.java:131) ~[wolfyutils-spigot-4.17-beta.6 (1).jar:?]
        at customcrafting-spigot-4.16.11.jar/me.wolfyscript.customcrafting.gui.recipe_creator.RecipeCreatorCrafting.onUpdateAsync(RecipeCreatorCrafting.java:93) ~[customcrafting-spigot-4.16.11.jar:?]
        at wolfyutils-spigot-4.17-beta.6 (1).jar/me.wolfyscript.utilities.api.inventory.gui.GuiWindow.openInventory(GuiWindow.java:286) ~[wolfyutils-spigot-4.17-beta.6 (1).jar:?]
        at wolfyutils-spigot-4.17-beta.6 (1).jar/me.wolfyscript.utilities.api.inventory.gui.GuiWindow.lambda$callUpdate$1(GuiWindow.java:276) ~[wolfyutils-spigot-4.17-beta.6 (1).jar:?]
        at wolfyutils-spigot-4.17-beta.6 (1).jar/me.wolfyscript.utilities.api.inventory.gui.GuiWindow.callUpdate(GuiWindow.java:278) ~[wolfyutils-spigot-4.17-beta.6 (1).jar:?]
        at wolfyutils-spigot-4.17-beta.6 (1).jar/me.wolfyscript.utilities.api.inventory.gui.GuiWindow.lambda$update$0(GuiWindow.java:269) ~[wolfyutils-spigot-4.17-beta.6 (1).jar:?]
        at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:86) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:475) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1762) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:509) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1634) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1334) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:333) ~[purpur-1.21.jar:1.21-2279-9e444c5]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

Submit issue

EchocallingEarth commented 1 month ago

If it will be of help, I can confirm the issue and provide additional info, including a video of me producing the issue on a clean install.

WolfyScript commented 1 month ago

The issue is caused by ItemsAdder. Have a look here for more infos: https://github.com/PluginBugs/Issues-ItemsAdder/issues/3825

EchocallingEarth commented 1 month ago

Realizing this is closed - I wanted to add a note as I found it on the IA GitHub https://github.com/PluginBugs/Issues-ItemsAdder/issues/3857#issue-2444662832

Apparently, this is now just broken with no plan to fix? Maybe. With that said this in turn may render CC / WU useless in the creating of custom recipes in the future. Sadly.

WolfyScript commented 1 month ago

The comment sounds like they plan to fix it. I don't know how much work it will be. When ItemsAdder extended the ItemStack, then the code will probably require a lot of refactoring, which will take time.

Another comment in the issue mentioned a partial bypass for the issue using the .clone() method, but it breaks after cloning the clone, which CC might do when crafting, so that would just move the issue from recipe creation to crafting.