mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 12:33:57 +01:00
Hell on Overworld
- Fixed incorrect dimension data in train map sync
This commit is contained in:
parent
86ceb9e954
commit
8ca03ded64
@ -52,6 +52,7 @@ public class TrainMapSync {
|
|||||||
|
|
||||||
// Clientside
|
// Clientside
|
||||||
public float[] prevPositions;
|
public float[] prevPositions;
|
||||||
|
public List<ResourceKey<Level>> prevDims;
|
||||||
|
|
||||||
// Updated every 5 ticks
|
// Updated every 5 ticks
|
||||||
public float[] positions;
|
public float[] positions;
|
||||||
@ -130,14 +131,22 @@ public class TrainMapSync {
|
|||||||
|
|
||||||
public void updateFrom(TrainMapSyncEntry other, boolean light) {
|
public void updateFrom(TrainMapSyncEntry other, boolean light) {
|
||||||
prevPositions = positions;
|
prevPositions = positions;
|
||||||
|
prevDims = dimensions;
|
||||||
|
|
||||||
positions = other.positions;
|
positions = other.positions;
|
||||||
|
dimensions = other.dimensions;
|
||||||
state = other.state;
|
state = other.state;
|
||||||
signalState = other.signalState;
|
signalState = other.signalState;
|
||||||
fueled = other.fueled;
|
fueled = other.fueled;
|
||||||
backwards = other.backwards;
|
backwards = other.backwards;
|
||||||
targetStationDistance = other.targetStationDistance;
|
targetStationDistance = other.targetStationDistance;
|
||||||
|
|
||||||
|
if (prevDims != null)
|
||||||
|
for (int i = 0; i < Math.min(prevDims.size(), dimensions.size()); i++)
|
||||||
|
if (prevDims.get(i) != dimensions.get(i))
|
||||||
|
for (int j = 0; j < 6; j++)
|
||||||
|
prevPositions[i * 6 + j] = positions[i * 6 + j];
|
||||||
|
|
||||||
if (light)
|
if (light)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user