Skip to content

Commit 080cf4a

Browse files
committed
make attackBlock mixin cancellable
1 parent bc6db48 commit 080cf4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/src/main/java/com/lambda/mixin/entity/ClientPlayInteractionManagerMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void interactItemHead(PlayerEntity player, Hand hand, CallbackInfoReturna
6666
}
6767
}
6868

69-
@Inject(method = "attackBlock", at = @At("HEAD"))
69+
@Inject(method = "attackBlock", at = @At("HEAD"), cancellable = true)
7070
public void onAttackBlock(BlockPos pos, Direction side, CallbackInfoReturnable<Boolean> cir) {
7171
if (EventFlow.post(new PlayerEvent.Attack.Block(pos, side)).isCanceled()) cir.cancel();
7272
}

0 commit comments

Comments
 (0)