From c1e4fe7a0a039bcca22a2ed23005134a59853ba2 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sun, 13 Oct 2024 22:22:45 +0200 Subject: [PATCH] fix: problem s with interSignalBox --- .../signals/signalbox/InterSignalBoxPathway.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/troblecodings/signals/signalbox/InterSignalBoxPathway.java b/src/main/java/com/troblecodings/signals/signalbox/InterSignalBoxPathway.java index 0cb3afe4b..99f596708 100644 --- a/src/main/java/com/troblecodings/signals/signalbox/InterSignalBoxPathway.java +++ b/src/main/java/com/troblecodings/signals/signalbox/InterSignalBoxPathway.java @@ -7,6 +7,7 @@ import com.google.common.collect.Maps; import com.troblecodings.core.NBTWrapper; +import com.troblecodings.signals.OpenSignalsMain; import com.troblecodings.signals.blocks.Signal; import com.troblecodings.signals.core.BlockPosSignalHolder; import com.troblecodings.signals.core.StateInfo; @@ -169,7 +170,16 @@ protected void setSignals(final SignalStateInfo lastSignal) { public void compact(final Point point) { super.compact(point); if (pathwayToBlock != null) { - pathwayToBlock.loadTileAndExecute(tile -> pathwayToReset = this); + pathwayToBlock.loadTileAndExecute(tile -> { + final InterSignalBoxPathway pw = (InterSignalBoxPathway) tile.getSignalBoxGrid() + .getPathwayByLastPoint(pathwayToBlock.getLastPoint()); + if (pw == null) { + OpenSignalsMain.getLogger() + .error("PW to block is zero! This should't be the case!"); + return; + } + pw.setOtherPathwayToReset(this); + }); } }