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 34 forks source link

Executable Items potions crafting recipe brewing stand bug #326

Open Capysussa opened 1 year ago

Capysussa commented 1 year ago

What happened?

I made a Mining Fatigue Potion and a Mining Fatigue Splash Potion in Executable Items. I added a Brewing Stand Recipe that when putting the Normal Mining Fatigue Potion in the Brewing Stand with Gunpowder as the ingredient, you'd get the Splash Potion Version. Just like with the Vanilla Potions. But for some reason 50% of the time, when crafting the recipe it worked but skipped the waiting time, or 50% of the time it took the standard time but just gave me a Akward Splash Potion, no effects, water color. 1 2 3 4

How can the bug be reproduced?

Download Executable Items, Create the Mining Fatigue Potions, the type is a Akward Potion, with the Effect Mining Fatigue. Then turn on the Brewing Stand Recipes Feature, Create a new Recipe Standard Mining Fatigue Potion with gunpowder as ingredient, result is Splash Potion Mining Fatigue. Then Save The Recipe. Now go to EI's editor Menu, grab a Standard Mining Fatigue Potion, grab a piece of Gunpowder from the Creative Menu or /give, put them into the Brewing Stand (of course you still need the Blaze Powder as fuel for the Brewing Stand). Then it should do the weird Thing where it either works but skips the time, or just gives you a clear, no effects, Akward Splash Potion.

Expected Behaviour?

Instead of the doing the weird 50/50 thing it should give the result which I put in the GUI as the result, which is the Splash Potion of Mining Fatigue I created in Executable Items.

Plugin version

customcrafting-spigot-4.16.8.3, wolfyutils-spigot-4.16.12.1

Server software

Purpur 1.20.1

Relevant log output

[23:51:05] [Server thread/WARN]: Task #16541 for CustomCrafting v4.16.8.3 generated an exception
14987   java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getAmount()" because "input" is null
14988       at me.wolfyscript.utilities.api.inventory.custom_items.CustomItem.remove(CustomItem.java:833) ~[?:?]
14989       at me.wolfyscript.utilities.api.inventory.custom_items.CustomItem.remove(CustomItem.java:875) ~[?:?]
14990       at me.wolfyscript.utilities.api.inventory.custom_items.CustomItem.remove(CustomItem.java:913) ~[?:?]
14991       at me.wolfyscript.utilities.api.inventory.custom_items.CustomItem.remove(CustomItem.java:949) ~[?:?]
14992       at me.wolfyscript.customcrafting.listeners.BrewingStandListener$1.run(BrewingStandListener.java:187) ~[?:?]
14993       at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.20.1.jar:git-Purpur-2050]
14994       at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[purpur-1.20.1.jar:git-Purpur-2050]
14995       at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1506) ~[purpur-1.20.1.jar:git-Purpur-2050]
14996       at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:486) ~[purpur-1.20.1.jar:git-Purpur-2050]
14997       at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1420) ~[purpur-1.20.1.jar:git-Purpur-2050]
14998       at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1191) ~[purpur-1.20.1.jar:git-Purpur-2050]
14999       at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:322) ~[purpur-1.20.1.jar:git-Purpur-2050]
15000       at java.lang.Thread.run(Unknown Source) ~[?:?]

Submit issue

Capysussa commented 1 year ago

I've (kinda) fixed the issue. The problem is (probably) that minecraft sees the potion as a akward potion with no effects. So it gives me an akward splash potion. Then the plugin tries (when it can which is 50% of the time) to skip the brewing waiting time and succeds and gives me standard potion. This happens cause i used a piece of gunpowder as the ingridient and so minecraft was like: "I know what to do with that" but didnt see the mining fatigue effects.

WolfyScript commented 1 year ago

Yeah, that is one of the major downsides to the brewing recipes. You cannot use ingredients, that are already used by vanilla brewing recipes! It's one of the reasons why I stopped development on those, as I couldn't figure out a good way to manipulate the brewing stand. It may make a comeback on the Sponge implementation next year. Then I might also look into taking it up for Spigot again.