mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-02-28 21:04:41 +01:00
See you later elevator
- Fixed elevator contraptions moving to y=0 when loading in #4830
This commit is contained in:
parent
842e1bb3af
commit
d8cd79852b
2 changed files with 9 additions and 1 deletions
|
@ -33,6 +33,7 @@ public class ElevatorColumn {
|
||||||
protected List<Integer> contacts;
|
protected List<Integer> contacts;
|
||||||
protected int targetedYLevel;
|
protected int targetedYLevel;
|
||||||
protected boolean isActive;
|
protected boolean isActive;
|
||||||
|
protected boolean targetAvailable;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public static ElevatorColumn get(LevelAccessor level, ColumnCoords coords) {
|
public static ElevatorColumn get(LevelAccessor level, ColumnCoords coords) {
|
||||||
|
@ -49,6 +50,7 @@ public class ElevatorColumn {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
this.coords = coords;
|
this.coords = coords;
|
||||||
contacts = new ArrayList<>();
|
contacts = new ArrayList<>();
|
||||||
|
targetAvailable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void markDirty() {
|
public void markDirty() {
|
||||||
|
@ -115,6 +117,10 @@ public class ElevatorColumn {
|
||||||
targetedYLevel = yLevel;
|
targetedYLevel = yLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isTargetAvailable() {
|
||||||
|
return targetAvailable;
|
||||||
|
}
|
||||||
|
|
||||||
public int getTargetedYLevel() {
|
public int getTargetedYLevel() {
|
||||||
return targetedYLevel;
|
return targetedYLevel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,9 @@ public class ElevatorContraption extends PulleyContraption {
|
||||||
ElevatorColumn column = ElevatorColumn.get(level, coords);
|
ElevatorColumn column = ElevatorColumn.get(level, coords);
|
||||||
if (column == null)
|
if (column == null)
|
||||||
return null;
|
return null;
|
||||||
int targetedYLevel = column.targetedYLevel;
|
if (!column.isTargetAvailable())
|
||||||
|
return null;
|
||||||
|
int targetedYLevel = column.getTargetedYLevel();
|
||||||
if (isTargetUnreachable(targetedYLevel))
|
if (isTargetUnreachable(targetedYLevel))
|
||||||
return null;
|
return null;
|
||||||
return targetedYLevel;
|
return targetedYLevel;
|
||||||
|
|
Loading…
Add table
Reference in a new issue