mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-01 02:04:51 +00:00
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:
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 {
|
||||
|
||||
Reference in new issue
Block a user