Skip to content

Commit

Permalink
hopefully fix: problems with InterSignalBox
Browse files Browse the repository at this point in the history
  • Loading branch information
Uhutown committed Oct 13, 2024
1 parent 10496ff commit 0a319c3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,27 @@ protected SignalStateInfo getLastSignalInfo() {

@Override
protected void setSignals(final SignalStateInfo lastSignal) {
if (tile == null || isExecutingSignalSet)
return;
final StateInfo identifier = new StateInfo(tile.getWorld(), tile.getPos());
if (lastSignal != null && pathwayToReset != null) {
final Signal signal = SignalBoxHandler.getSignal(identifier, lastSignal.pos);
if (signal == null)
return;
pathwayToReset.setSignals(new SignalStateInfo(tile.getWorld(), lastSignal.pos, signal));
if (pathwayToReset != null && lastSignal != null) {
if (tile != null) {
final StateInfo identifier = new StateInfo(tile.getWorld(), tile.getPos());
final Signal signal = SignalBoxHandler.getSignal(identifier, lastSignal.pos);
if (signal != null) {
pathwayToReset.setSignals(
new SignalStateInfo(tile.getWorld(), lastSignal.pos, signal));
}
}
}
super.setSignals(lastSignal);
}

@Override
public void compact(final Point point) {
super.compact(point);
if (pathwayToBlock != null) {
pathwayToBlock.loadTileAndExecute(tile -> pathwayToReset = this);
}
}

@Override
public void resetPathway(final Point point) {
super.resetPathway(point);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,11 @@ public void read(final NBTWrapper tag) {
nodeBuilder.add(node);
});
this.listOfNodes = nodeBuilder.build();
this.type = PathType.valueOf(tag.getString(PATH_TYPE));
this.initalize();
if (!checkForProtectionWay()) {
this.emptyOrBroken = true;
return;
}
this.type = PathType.valueOf(tag.getString(PATH_TYPE));
this.initalize();
}

private SignalBoxNode getNodeFromNBT(final NBTWrapper nodeNBT) {
Expand Down

0 comments on commit 0a319c3

Please sign in to comment.