mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-02-28 12:54:40 +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 int targetedYLevel;
|
||||
protected boolean isActive;
|
||||
protected boolean targetAvailable;
|
||||
|
||||
@Nullable
|
||||
public static ElevatorColumn get(LevelAccessor level, ColumnCoords coords) {
|
||||
|
@ -49,6 +50,7 @@ public class ElevatorColumn {
|
|||
this.level = level;
|
||||
this.coords = coords;
|
||||
contacts = new ArrayList<>();
|
||||
targetAvailable = false;
|
||||
}
|
||||
|
||||
public void markDirty() {
|
||||
|
@ -114,6 +116,10 @@ public class ElevatorColumn {
|
|||
public void target(int yLevel) {
|
||||
targetedYLevel = yLevel;
|
||||
}
|
||||
|
||||
public boolean isTargetAvailable() {
|
||||
return targetAvailable;
|
||||
}
|
||||
|
||||
public int getTargetedYLevel() {
|
||||
return targetedYLevel;
|
||||
|
|
|
@ -87,7 +87,9 @@ public class ElevatorContraption extends PulleyContraption {
|
|||
ElevatorColumn column = ElevatorColumn.get(level, coords);
|
||||
if (column == null)
|
||||
return null;
|
||||
int targetedYLevel = column.targetedYLevel;
|
||||
if (!column.isTargetAvailable())
|
||||
return null;
|
||||
int targetedYLevel = column.getTargetedYLevel();
|
||||
if (isTargetUnreachable(targetedYLevel))
|
||||
return null;
|
||||
return targetedYLevel;
|
||||
|
|
Loading…
Add table
Reference in a new issue