Make computer emit block update after bus scan finishes.

Necessary because this may lead to newly available capabilities from new devices.
This commit is contained in:
Florian Nücke
2021-01-10 16:24:55 +01:00
parent 63fda620a3
commit 3b4c2b1dec

View File

@@ -311,12 +311,19 @@ public final class ComputerTileEntity extends AbstractTileEntity implements ITic
world.notifyNeighborsOfStateChange(getPos(), getBlockState().getBlock());
}
final AbstractDeviceBusController.BusState oldBusState = busController.getState();
busController.scan();
setBusState(busController.getState());
if (busState != AbstractDeviceBusController.BusState.READY) {
return;
}
if (oldBusState != AbstractDeviceBusController.BusState.READY) {
// Bus just became ready, meaning new devices may be available, meaning new
// capabilities may be available, so we need to tell our neighbors.
world.notifyNeighborsOfStateChange(getPos(), getBlockState().getBlock());
}
switch (runState) {
case STOPPED:
break;