Spectrum

Spectrum

2M Downloads

[BUG] Brewing Stand can turn Pigment Potions into Uncraftable Potions

JamminJellyToast opened this issue ยท 7 comments

commented

Describe the bug
It is possible to have the Brewing Stand add Gunpowder to a Pigment Potion. This causes the Brewing Stand to consume the Pigment Potions and produce placeholder Splash Uncraftable Potions that have no effect. Other reagents like Glowstone, Redstone, and Dragon's Breath do not initiate the brewing process, indicating that Gunpowder shouldn't either.

To Reproduce
Place any Pigment Potion in a Brewing Stand, and place Gunpowder in the ingredient slot.

Expected behavior
Based on behavior with other Reagents, the Brewing Stand should do nothing with Pigment Potions inside.

Mod version
Version 1.4.0 for MC 1.18.2.

Screenshots
2022-08-09_16 38 27
2022-08-09_16 38 43

commented

I've made an error in my initial comment. After testing it some more, it appears that Dragons Breath is also causing this problem. Turning Splash Pigment Potions into Lingering Uncraftable Potions.

commented

These are, in fact, custom potions thus ordinary brewing stands would have problem processing these.

commented

Pretty much, yes.

Spectrum uses the "CustomPotionEffects" NBT tag that potions support to add it's dynamic effects. The vanilla brewing stand does not handle those very well, though. But without messing with the vanilla brewing stand, there is nothing I can do, sorry.

commented

This is easy to fix

commented

(On mobile, so using old 1.18 sources and cannot test my code)
Register a new net.minecraft.potion.Potion into the potion registry for the pigment potion. You can leave its effects empty and use custom potion effects instead. Then, either:

If you want to disallow gunpowder/dragon's breath brewing, mixin to the lambda used for POTION_TYPE_PREDICATE in net.minecraft.recipe.PotionRecipeRegistry and check for your potion type, returning false if it matches.

Otherwise, mixin to net.minecraft.recipe.PotionRecipeRegistry::craft and, if your potion type is being used, copy the custom effects into the ItemStack created at return PotionUtil.setPotion(new ItemStack(recipe.output), potion);

commented

Zamn, daf just got blasted

commented

done.