[Bug]: 2 bonemeal used, unless you only have 1 bonemeal
theuberpony opened this issue ยท 1 comments
Mod Loader (Required)
Fabric
Minecraft Version(s) (Required)
1.21.4
Mod Version(s) (Required)
21.4.0
Minimal Setup (Required)
Yes
Notes (Required)
Current behavior: uses 2 bonemeal when you use it on anything other than a 2 high flower, includes vanilla and modded flowers (biomes o plenty, wilder wild) and only produces 1 flower/block spread. same behavior when used on lily pads but it produces multiple lily pads. when you ONLY have 1 piece of bonemeal in your inventory and you try to bonemeal something, it still works with 1 bonemeal. issue arises when you have more than 1 bonemeal in your inventory
Reproduce by installing only universal bonemeal and its dependencies on a 1.21.4 instance and using bonemeal on a flower or other compatible nature.
latest.log (Required)
https://github.com/user-attachments/files/19526654/latest.log
After discovering this issue myself, and seeing that it appears to have been an issue on here at least since february, I looked though the code and commented out these lines
if (itemStack.isStackable()) { itemStack.shrink(1); } else if (itemStack.isDamageableItem()) { ItemHelper.hurtAndBreak(itemStack, 1, serverLevel, null, Consumers.nop()); }
from the /Common/src/main/java/fuzs/universalbonemeal/handler/UseBoneMealHandler.java file
I have built and tested this change and everything now seems to be working correctly and lowers the bone meal held by the player by 1 each time it is used. it also appears to resolve issue #11 (NOTE: doesn't change lily behaviour)
Would be nice to hear from Fuzss though, because I don't really even know the purpose of the "Else If" part of this code, but at least this is a temporary solution until they get around to it