mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-27 22:40:13 +00:00
Hold object lock per placement
- Keep the object read lock across the bake lookup, block pass, grounding and stilt pass so a placement reads one consistent snapshot
This commit is contained in:
1 parent
be30285718
commit
be2fe12524
1 file changed
+5
@@ -475,6 +475,8 @@ final class IrisObjectPlacementRunner {
|
|||||||
int topLayer = Integer.MIN_VALUE;
|
int topLayer = Integer.MIN_VALUE;
|
||||||
int vacuumLowest = Integer.MAX_VALUE;
|
int vacuumLowest = Integer.MAX_VALUE;
|
||||||
int vacuumHighest = Integer.MIN_VALUE;
|
int vacuumHighest = Integer.MIN_VALUE;
|
||||||
|
self.readLock.lock();
|
||||||
|
try {
|
||||||
ObjectPlacementBake bake = ObjectPlacementBake.of(self, spin, ceilingHang, translating ? translateOffset : null);
|
ObjectPlacementBake bake = ObjectPlacementBake.of(self, spin, ceilingHang, translating ? translateOffset : null);
|
||||||
PlacementStates palette = new PlacementStates(bake.palette(), config.getRotation(), spinx, spiny, spinz,
|
PlacementStates palette = new PlacementStates(bake.palette(), config.getRotation(), spinx, spiny, spinz,
|
||||||
preventingDecay, placer.isDebugSmartBore(), excludedStiltMaterials);
|
preventingDecay, placer.isDebugSmartBore(), excludedStiltMaterials);
|
||||||
@@ -819,6 +821,9 @@ final class IrisObjectPlacementRunner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
self.readLock.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
if (vacuuming && vacuumLowest != Integer.MAX_VALUE && placer.getEngine() != null) {
|
if (vacuuming && vacuumLowest != Integer.MAX_VALUE && placer.getEngine() != null) {
|
||||||
vacuumTerrain(placer, config, x, z, placementBounds.minX(), placementBounds.maxX(),
|
vacuumTerrain(placer, config, x, z, placementBounds.minX(), placementBounds.maxX(),
|
||||||
|
|||||||
Reference in new issue
Block a user