fix #70 claim tools bypassing permissions
This commit is contained in:
parent
7d815cfbaf
commit
a57f5ab33f
@ -33,8 +33,9 @@ public abstract class AbstractBlockStateMixin {
|
|||||||
*/
|
*/
|
||||||
@Inject(method = "onUse", at = @At(value = "HEAD"), cancellable = true)
|
@Inject(method = "onUse", at = @At(value = "HEAD"), cancellable = true)
|
||||||
private void useBlock(World world, PlayerEntity player, Hand hand, BlockHitResult result, CallbackInfoReturnable<ActionResult> info) {
|
private void useBlock(World world, PlayerEntity player, Hand hand, BlockHitResult result, CallbackInfoReturnable<ActionResult> info) {
|
||||||
if (BlockInteractEvents.useBlocks(player, world, hand, result) == ActionResult.FAIL) {
|
ActionResult res = BlockInteractEvents.useBlocks(player, world, hand, result);
|
||||||
info.setReturnValue(ActionResult.FAIL);
|
if (res != ActionResult.PASS) {
|
||||||
|
info.setReturnValue(res);
|
||||||
info.cancel();
|
info.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user