Performance Improvements

This commit is contained in:
Daniel Mills
2021-07-29 04:24:28 -04:00
parent 2f8fe43ea3
commit dc851d856d
6 changed files with 12 additions and 61 deletions

View File

@@ -71,10 +71,10 @@ public class IrisObject extends IrisRegistrant {
private transient BlockVector center;
private transient volatile boolean smartBored = false;
private transient IrisLock lock = new IrisLock("Preloadcache");
private transient AtomicCache<AxisAlignedBB> aabb;
private transient AtomicCache<AxisAlignedBB> aabb = new AtomicCache<>();
public AxisAlignedBB getAABB() {
return getAABBFor(new BlockVector(w, h, d));
return aabb.aquire(() -> getAABBFor(new BlockVector(w, h, d)));
}
public static BlockVector getCenterForSize(BlockVector size) {