Check native structures against the real transformed object bounds

The native-structure veto used a square envelope of half the largest object side, so rotated or off-centre objects reaching past it were never checked. It now uses the prepared transformed bounds, with Y widened by the warp margin. IrisObject.copy() now reads under the read lock instead of the object monitor.

Upstream: d55c77572
This commit is contained in:
piexel committed 2026-11-10 01:00:40 +01:00
1 parent a81a3abb9f
commit 8e0e6d7d45
4 files changed
+140 -25

No files matched your search

@@ -135,17 +135,22 @@ public class IrisObject extends IrisRegistrant implements PlaceableObject {
return aabb.aquire(() -> getAABBFor(new IrisBlockVector(w, h, d)));
}
public synchronized IrisObject copy() {
IrisObject o = new IrisObject(w, h, d);
o.setLoadKey(getLoadKey());
o.setLoader(getLoader());
o.setLoadFile(getLoadFile());
o.setCenter(getCenter().clone());
public IrisObject copy() {
readLock.lock();
try {
IrisObject o = new IrisObject(w, h, d);
o.setLoadKey(getLoadKey());
o.setLoader(getLoader());
o.setLoadFile(getLoadFile());
o.setCenter(getCenter().clone());
blocks.forEach((i, v) -> o.blocks.put(i.clone(), v));
states.forEach((i, v) -> o.states.put(i.clone(), v.clone()));
blocks.forEach((i, v) -> o.blocks.put(i.clone(), v));
states.forEach((i, v) -> o.states.put(i.clone(), v.clone()));
return o;
return o;
} finally {
readLock.unlock();
}
}
public void readLegacy(InputStream in) throws IOException {