Skip to content

Commit

Permalink
Merge pull request #239 from MrTroble/feats/1.12
Browse files Browse the repository at this point in the history
Feats/1.12
  • Loading branch information
Uhutown authored Aug 13, 2024
2 parents 70475a5 + 785e82e commit f55c4c7
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
if: endswith(github.ref_name, 'master') && github.ref_protected && github.ref_type == 'branch'
runs-on: ubuntu-latest
env:
APPVEYOR_BUILD_VERSION: '3.6.0'
APPVEYOR_BUILD_VERSION: '3.6.1'
CURSETOKEN: ${{ secrets.CURSETOKEN }}
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.12.2 - 3.6.1]
* fix: issues with InterSignalBoxPathways
* fix: issue with Zs3V in HV

## [1.12.2 - 3.6.0]

* feat: added black dots mast sign
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public PathwayData getPathwayData() {
}

public boolean canBeAddedToSaver() {
return this == ALREADY_USED || this == NO_PATH
|| !(data != null && !data.isInterSignalBoxPathway());
return this == ALREADY_USED || this == NO_PATH;
}

public boolean isPass() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public void updatePathwaySignals() {
final Map<BlockPos, OtherSignalIdentifier> distantSignalPositions = data
.getOtherSignals();
this.isExecutingSignalSet = false;
pathwayToBlock.isExecutingSignalSet = false;
if (pathwayToBlock != null)
pathwayToBlock.isExecutingSignalSet = false;
synchronized (distantSignalPositions) {
setSignals(getLastSignalInfo());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ protected SignalStateInfo getLastSignalInfo() {

@Override
protected void setSignals(final SignalStateInfo lastSignal) {
if (tile == null)
return;
final StateInfo identifier = new StateInfo(tile.getWorld(), tile.getPos());
if (lastSignal != null && pathwayToReset != null) {
final Signal signal = SignalBoxHandler.getSignal(identifier, lastSignal.pos);
Expand Down Expand Up @@ -188,20 +190,20 @@ public boolean tryBlock(final BlockPos position) {
protected void updateSignalStates() {
final List<MainSignalIdentifier> redSignals = new ArrayList<>();
final List<MainSignalIdentifier> greenSignals = new ArrayList<>();
final MainSignalIdentifier lastSignal = data.getEndSignal();
if (lastSignal != null) {
final MainSignalIdentifier startSignal = data.getStartSignal();
if (startSignal != null) {
if (isBlocked)
return;
final SignalState previous = lastSignal.state;
lastSignal.state = SignalState.GREEN;
if (!lastSignal.state.equals(previous))
greenSignals.add(lastSignal);
final SignalState previous = startSignal.state;
startSignal.state = SignalState.GREEN;
if (!startSignal.state.equals(previous))
greenSignals.add(startSignal);
}
final Map<BlockPos, OtherSignalIdentifier> distantSignalPositions = data.getOtherSignals();
distantSignalPositions.values().forEach(position -> {
final SignalBoxPathway next = getNextPathway();
final SignalState previous = position.state;
if (lastSignal != null && next != null && !next.isEmptyOrBroken()) {
if (startSignal != null && next != null && !next.isEmptyOrBroken()) {
if (!next.isExecutingSignalSet)
position.state = SignalState.GREEN;
} else if (pathwayToBlock != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ public List<Map.Entry<Point, Point>> getNextPathways() {
public boolean addNextPathway(final Point start, final Point end) {
final Map.Entry<Point, Point> entry = Maps.immutableEntry(start, end);
if (!nextPathways.contains(entry)) {
final SignalBoxPathway pw = startsToPath.get(start);
if (pw != null && pw.isInterSignalBoxPathway()) {
return false;
}
if (executingForEach) {
toAdd.add(entry);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,10 @@ public boolean isShuntingPath() {
public PathType getPathType() {
return data.getPathType();
}

public boolean isInterSignalBoxPathway() {
return this instanceof InterSignalBoxPathway;
}

public SignalBoxGrid getGrid() {
return grid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"slow": "config(stopsignal.HP2) || config(hphome.HP2)"
},
"values": {
"map(stop)": ["distantsignal.VR0", "zs3v.OFF"],
"map(drive)": ["distantsignal.VR1"],
"map(slow)": ["distantsignal.VR2"],
"signalRepeater(true)": ["vrlight.true"],

"(config(zs3.Z1) || config(zs3plate.Z1))": ["zs3v.Z1"],
"(config(zs3.Z2) || config(zs3plate.Z2))": ["zs3v.Z2"],
Expand All @@ -28,6 +24,11 @@
"(config(zs3.Z14) || config(zs3plate.Z14))": ["zs3v.Z14"],
"(config(zs3.Z15) || config(zs3plate.Z15))": ["zs3v.Z15"],

"map(stop)": ["distantsignal.VR0", "zs3v.OFF"],
"map(drive)": ["distantsignal.VR1"],
"map(slow)": ["distantsignal.VR2"],
"signalRepeater(true)": ["vrlight.true"],

"speed(<.1) || speed(>.15)": ["stopsignal.HP1", "hphome.HP1", "hpblock.HP1"],
"speed(==.1)": ["zs3.Z1", "stopsignal.HP2", "hphome.HP2", "hpblock.HP1"],
"speed(==.2)": ["zs3.Z2", "stopsignal.HP2", "hphome.HP2", "hpblock.HP1"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"drive": "config(kombisignal.KS1) || config(kombisignal_main.KS1) || config(kombisignal.KS1_BLINK) || config(kombisignal.KS1_BLINK_LIGHT) || config(kombisignal.KS2) || config(kombisignal.KS2_LIGHT)"
},
"values": {
"map(stop)": ["distantsignal.VR0", "zs3v.OFF"],
"map(drive)": ["distantsignal.VR1"],
"signalRepeater(true)": ["vrlight.true"],

"(config(zs3.Z1) || config(zs3plate.Z1))": ["zs3v.Z1", "distantsignal.VR2"],
"(config(zs3.Z2) || config(zs3plate.Z2))": ["zs3v.Z2", "distantsignal.VR2"],
Expand All @@ -26,6 +23,10 @@
"(config(zs3.Z14) || config(zs3plate.Z14))": ["zs3v.Z14", "distantsignal.VR1"],
"(config(zs3.Z15) || config(zs3plate.Z15))": ["zs3v.Z15", "distantsignal.VR1"],

"map(stop)": ["distantsignal.VR0", "zs3v.OFF"],
"map(drive)": ["distantsignal.VR1"],
"signalRepeater(true)": ["vrlight.true"],

"speed(<.1) || speed(>.15)": ["stopsignal.HP1", "hphome.HP1", "hpblock.HP1"],
"speed(==.1)": ["zs3.Z1", "stopsignal.HP2", "hphome.HP2", "hpblock.HP1"],
"speed(==.2)": ["zs3.Z2", "stopsignal.HP2", "hphome.HP2", "hpblock.HP1"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"slow": "config(wing1.TRUE) && config(wing2.TRUE)"
},
"values": {
"map(stop)": ["distantsignal.VR0", "zs3v.OFF"],
"map(drive)": ["distantsignal.VR1"],
"map(slow)": ["distantsignal.VR2"],
"signalRepeater(true)": ["vrlight.true"],

"(config(zs3.Z1) || config(zs3plate.Z1))": ["zs3v.Z1"],
"(config(zs3.Z2) || config(zs3plate.Z2))": ["zs3v.Z2"],
Expand All @@ -28,6 +24,11 @@
"(config(zs3.Z14) || config(zs3plate.Z14))": ["zs3v.Z14"],
"(config(zs3.Z15) || config(zs3plate.Z15))": ["zs3v.Z15"],

"map(stop)": ["distantsignal.VR0", "zs3v.OFF"],
"map(drive)": ["distantsignal.VR1"],
"map(slow)": ["distantsignal.VR2"],
"signalRepeater(true)": ["vrlight.true"],

"speed(<.1) || speed(>.15)": ["stopsignal.HP1", "hphome.HP1", "hpblock.HP1"],
"speed(==.1)": ["zs3.Z1", "stopsignal.HP2", "hphome.HP2", "hpblock.HP1"],
"speed(==.2)": ["zs3.Z2", "stopsignal.HP2", "hphome.HP2", "hpblock.HP1"],
Expand Down

0 comments on commit f55c4c7

Please sign in to comment.