diff --git a/projects/common/src/main/java/dan200/computercraft/shared/peripheral/redstone/RedstoneRelayBlockEntity.java b/projects/common/src/main/java/dan200/computercraft/shared/peripheral/redstone/RedstoneRelayBlockEntity.java index b4373e802..920220f63 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/peripheral/redstone/RedstoneRelayBlockEntity.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/peripheral/redstone/RedstoneRelayBlockEntity.java @@ -22,6 +22,7 @@ public final class RedstoneRelayBlockEntity extends BlockEntity { private final RedstoneState redstoneState = new RedstoneState(() -> TickScheduler.schedule(tickToken)); private final RedstoneRelayPeripheral peripheral = new RedstoneRelayPeripheral(redstoneState); + private boolean updateAll = false; public RedstoneRelayBlockEntity(BlockPos pos, BlockState blockState) { super(ModRegistry.BlockEntities.REDSTONE_RELAY.get(), pos, blockState); @@ -30,17 +31,18 @@ public final class RedstoneRelayBlockEntity extends BlockEntity { @Override public void clearRemoved() { super.clearRemoved(); + updateAll = true; TickScheduler.schedule(tickToken); } void update() { var changes = redstoneState.updateOutput(); - if (changes != 0) { - for (var direction : DirectionUtil.FACINGS) { - if ((changes & (1 << mapSide(direction).ordinal())) != 0) updateRedstoneTo(direction); - } + for (var direction : DirectionUtil.FACINGS) { + if (updateAll || (changes & (1 << mapSide(direction).ordinal())) != 0) updateRedstoneTo(direction); } + updateAll = false; + if (redstoneState.pollInputChanged()) peripheral.queueRedstoneEvent(); }