From 39d7625d3407b34783a97d977a09461a6afaac4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sun, 27 Dec 2020 01:57:09 +0100 Subject: [PATCH] Un-invert if. --- .../cil/oc2/common/block/ComputerBlock.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/li/cil/oc2/common/block/ComputerBlock.java b/src/main/java/li/cil/oc2/common/block/ComputerBlock.java index cb6790d2..89dd9a55 100644 --- a/src/main/java/li/cil/oc2/common/block/ComputerBlock.java +++ b/src/main/java/li/cil/oc2/common/block/ComputerBlock.java @@ -85,17 +85,7 @@ public final class ComputerBlock extends HorizontalBlock { final ComputerTileEntity computer = (ComputerTileEntity) tileEntity; final ItemStack heldItem = player.getHeldItem(hand); - if (!Wrenches.isWrench(heldItem)) { - if (player.isSneaking()) { - if (!world.isRemote()) { - computer.start(); - } - } else { - if (world.isRemote()) { - openTerminalScreen(computer); - } - } - } else { + if (Wrenches.isWrench(heldItem)) { if (!world.isRemote() && player instanceof ServerPlayerEntity) { final ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player; if (player.isSneaking()) { @@ -105,6 +95,16 @@ public final class ComputerBlock extends HorizontalBlock { openContainerScreen(computer, serverPlayer); } } + } else { + if (player.isSneaking()) { + if (!world.isRemote()) { + computer.start(); + } + } else { + if (world.isRemote()) { + openTerminalScreen(computer); + } + } } return ActionResultType.SUCCESS;