@Override public boolean onBlockActivated(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull EntityPlayer entityPlayer, @Nonnull EnumHand hand, @Nonnull EnumFacing side, float hitX, float hitY, float hitZ) { if (shouldWrench(world, pos, entityPlayer, side) && ToolUtil.breakBlockWithTool(this, world, pos, side, entityPlayer, hand, permissionNodeWrenching)) { return true; } TileEntity te = getTileEntity(world, pos); if (te instanceof AbstractMachineEntity) { ITool tool = ToolUtil.getEquippedTool(entityPlayer, hand); if (tool != null && !entityPlayer.isSneaking() && tool.canUse(hand, entityPlayer, pos)) { if (!world.isRemote) { if (!PermissionAPI.hasPermission(entityPlayer.getGameProfile(), permissionNodeIOWrenching, new BlockPosContext(entityPlayer, pos, state, side))) { entityPlayer.sendMessage(Lang.WRENCH_DENIED.toChatServer()); } else { ((AbstractMachineEntity) te).toggleIoModeForFace(side); } } return true; } } return super.onBlockActivated(world, pos, state, entityPlayer, hand, side, hitX, hitY, hitZ); }