Avoid start/stop doing anything on client.

This commit is contained in:
Florian Nücke
2020-12-27 02:01:01 +01:00
parent 4084880916
commit ffbf1f049c
2 changed files with 19 additions and 3 deletions

View File

@@ -96,10 +96,16 @@ public final class ComputerBlock extends HorizontalBlock {
}
}
} else {
if (world.isRemote()) {
openTerminalScreen(computer);
if (player.isSneaking()) {
if (!world.isRemote()) {
computer.start();
}
} else {
computer.start();
if (world.isRemote()) {
openTerminalScreen(computer);
} else {
computer.start();
}
}
}

View File

@@ -134,6 +134,11 @@ public final class ComputerTileEntity extends AbstractTileEntity implements ITic
return;
}
final World world = getWorld();
if (world == null || world.isRemote()) {
return;
}
setBootError(null);
setRunState(RunState.LOADING_DEVICES);
loadDevicesDelay = 0;
@@ -144,6 +149,11 @@ public final class ComputerTileEntity extends AbstractTileEntity implements ITic
return;
}
final World world = getWorld();
if (world == null || world.isRemote()) {
return;
}
if (runState == RunState.LOADING_DEVICES) {
setRunState(RunState.STOPPED);
return;