[1.18] [Bug]: Sigil of the Green Grove is consumed when Forge's `BonemealEvent` returns `ALLOW`
Fuzss opened this issue ยท 1 comments
Issue Description:
What happens:
My Universal Bone Meal adds new bone meal behavior to a bunch of blocks using Forge's BonemealEvent
. This also works with the Sigil of the Green Grove, but the sigil is consumed in the process, which shouldn't happen.
The thing is, I don't shrink the stack size, that's Forge in ForgeEventFactory::onApplyBonemeal
after the event returns Event.Result.ALLOW
. You specifically call that hook in your code, so that will happen for any mod that returns Event.Result.ALLOW
for the event.
A simple fix would be to not call the hook, but instead invoke the event directly, skipping any stack size changes. So this:
should just be replaced with something like this (it's the same code from the Forge hook, just no call to
ItemStack::shrink
):
BonemealEvent event = new BonemealEvent(player, worldIn, pos, blockstate, stack);
if (MinecraftForge.EVENT_BUS.post(event)) return -1;
if (event.getResult() == Result.ALLOW) return 1;
What you expected to happen:
The sigil should remain in the inventory, the stacksize shouldn't change.
Steps to reproduce:
- Make
BonemealEvent
returnEvent.Result.ALLOW
viaBonemealEvent::setResult
for any block - Sigil of the Green Grove is consumed (=the item stack is deleted as it's count is shrunk by one)
Affected Versions (Do not use "latest"):
- BloodMagic: BloodMagic-1.18.2-3.2.6-41.jar
- Minecraft: 1.18.2
- Forge: ?