Closed jeremiahwinsley closed 9 months ago
None
1.20.1-4.0.2
1.20.1-443-FORGE
47.2.19
https://mclo.gs/ca9TZ1E
On receiving a BlockToolModificationEvent, the onTilt event handler calls ToolUtil.hoeUse for Botania hoes: https://github.com/MelanX/aiotbotania/blob/602dfc17878d97af9f082fb475215eaac52c5f45/src/main/java/de/melanx/aiotbotania/core/proxy/CommonProxy.java#L111
BlockToolModificationEvent
onTilt
ToolUtil.hoeUse
This method calls BlockState#getToolModifiedState which fires another BlockToolModificationEvent, leading to an infinite loop: https://github.com/MelanX/aiotbotania/blob/602dfc17878d97af9f082fb475215eaac52c5f45/src/main/java/de/melanx/aiotbotania/util/ToolUtil.java#L103
BlockState#getToolModifiedState
Requires a mixin to EventBus#handleException to get the actual exception:
@Mixin(EventBus.class) public class MixinEventBus { @Inject( at = @At("HEAD"), require = 1, remap = false, method = "handleException(Lnet/minecraftforge/eventbus/api/IEventBus;Lnet/minecraftforge/eventbus/api/Event;[Lnet/minecraftforge/eventbus/api/IEventListener;ILjava/lang/Throwable;)V" ) public void handleException(IEventBus bus, Event event, IEventListener[] listeners, int index, Throwable throwable, CallbackInfo ci) { PacketDebug.LOGGER.error("Logging exception from EventBus", throwable); } }
No response
Minecraft version
None
AIOT Botania version
1.20.1-4.0.2
Botania version
1.20.1-443-FORGE
Forge version
47.2.19
The latest.log file
https://mclo.gs/ca9TZ1E
Issue description
On receiving a
BlockToolModificationEvent
, theonTilt
event handler callsToolUtil.hoeUse
for Botania hoes: https://github.com/MelanX/aiotbotania/blob/602dfc17878d97af9f082fb475215eaac52c5f45/src/main/java/de/melanx/aiotbotania/core/proxy/CommonProxy.java#L111This method calls
BlockState#getToolModifiedState
which fires anotherBlockToolModificationEvent
, leading to an infinite loop: https://github.com/MelanX/aiotbotania/blob/602dfc17878d97af9f082fb475215eaac52c5f45/src/main/java/de/melanx/aiotbotania/util/ToolUtil.java#L103Steps to reproduce
Requires a mixin to EventBus#handleException to get the actual exception:
Other information
No response