Skip to content

Commit

Permalink
Fix #469 off-hand still places blocks when opening chisel
Browse files Browse the repository at this point in the history
  • Loading branch information
tterrag1098 committed Sep 12, 2017
1 parent f7bb401 commit 791b735
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/team/chisel/common/item/ChiselController.java
Expand Up @@ -95,6 +95,16 @@ public static void onRightClickItem(PlayerInteractEvent.RightClickItem event) {
}
}
}

@SubscribeEvent
public static void onRightClickBlock(PlayerInteractEvent.RightClickBlock event) {
if (event.getHand() == EnumHand.OFF_HAND) {
ItemStack mainhandStack = event.getEntityPlayer().getHeldItemMainhand();
if (mainhandStack != null && mainhandStack.getItem() instanceof IChiselItem) {
event.setCanceled(true);
}
}
}

private static void damageItem(ItemStack stack, EntityPlayer player) {
stack.damageItem(1, player);
Expand Down

0 comments on commit 791b735

Please sign in to comment.