From 93e4ecd3501807951867cc549fdf0fa0037bb239 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Fri, 18 Sep 2026 11:05:20 +0100 Subject: [PATCH] Refresh redstone output when first creating a computer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an identical fix to 013f2e500fc75f2daeac92aa693ae2970f4c981d, but for computers rather than redstone integrators. I don't love the duplication — it might make more sense to move this into RedstoneState.updateOutput and have an "initial tick" flag there instead. Fixes #2392. --- .../computer/blocks/AbstractComputerBlockEntity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/projects/common/src/main/java/dan200/computercraft/shared/computer/blocks/AbstractComputerBlockEntity.java b/projects/common/src/main/java/dan200/computercraft/shared/computer/blocks/AbstractComputerBlockEntity.java index b5765e290..53b1ddb58 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/computer/blocks/AbstractComputerBlockEntity.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/computer/blocks/AbstractComputerBlockEntity.java @@ -109,7 +109,6 @@ public abstract class AbstractComputerBlockEntity extends BlockEntity implements computer.keepAlive(); - fresh = false; computerID = computer.getID(); // If the on state has changed, mark as dirty. @@ -129,12 +128,15 @@ public abstract class AbstractComputerBlockEntity extends BlockEntity implements // Update the block state if needed. updateBlockState(computer.getState()); + // Update redstone output if the computer is new or the computer's redstone output has changed. var changes = computer.pollRedstoneChanges(); - if (changes != 0) { + if (fresh || changes != 0) { for (var direction : DirectionUtil.FACINGS) { - if ((changes & (1 << remapToLocalSide(direction).ordinal())) != 0) updateRedstoneTo(direction); + if (fresh || (changes & (1 << remapToLocalSide(direction).ordinal())) != 0) updateRedstoneTo(direction); } } + + fresh = false; } protected abstract void updateBlockState(ComputerState newState);