fabric
fabric copied to clipboard
Add BlockBreakEffectsCallback
Sometimes you might not want the block break particles and sounds to appear for a block. However, the only good way to do this (if you want access to the breaking entity) is a @Redirect in World#breakBlock. This has already caused a conflict between Magna and EnergonRelics.
BlockBreakEffectsCallback.EVENT.register((world, breakingEntity, pos) -> {
BlockState state = world.getBlockState(pos);
return state.getBlock() == Blocks.BEDROCK ? ActionResult.FAIL : ActionResult.PASS;
});
Should probably add a testmod too
I did add a testmod though?
What do you mean? There isn't any information that isn't common between the two mixins. They both have the entity that broke the block, the position of the block, the block state, and the world. The Block.onBreak mxin only has two world and two players because of how @Redirects work, they are literally the same object. player == player2
Is there anything else I should do?
Any update on this? Should I rebaee it on 1.17?
Keep this on 1.16, we can cherry pick at merge time