Skip to content

Commit

Permalink
Invoke Fabric block explode event before block is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Nov 19, 2024
1 parent c42775d commit 078d3fb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@Mixin(BlockBehaviour.class)
public class MixinBlockBehaviour {

@Inject(method = "onExplosionHit", at = @At(value = "RETURN"), locals = LocalCapture.CAPTURE_FAILHARD)
@Inject(method = "onExplosionHit", at = @At(value = "HEAD"), locals = LocalCapture.CAPTURE_FAILHARD)
private void onExplosionHit(BlockState state, Level level, BlockPos pos, Explosion explosion, BiConsumer<ItemStack, BlockPos> dropConsumer, CallbackInfo callback) {
if (!state.isAir() && explosion.getBlockInteraction() != Explosion.BlockInteraction.TRIGGER_BLOCK) {
IBlockExplodedEvent.EVENT.invoker().onBlockExploded(state, level, pos, explosion, dropConsumer);
Expand Down

0 comments on commit 078d3fb

Please sign in to comment.