Un-invert if.

This commit is contained in:
Florian Nücke
2020-12-27 01:57:09 +01:00
parent 1e46b77091
commit 39d7625d34

View File

@@ -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;