Fix object registry

This commit is contained in:
Daniel Mills 2021-08-02 15:54:38 -04:00
parent 488c609109
commit d4c1e62c72
2 changed files with 17 additions and 10 deletions

View File

@ -97,7 +97,8 @@ public class IrisData {
catch(Throwable e) catch(Throwable e)
{ {
e.printStackTrace();
Iris.error("Failed to create loader! " + registrant.getCanonicalName());
} }
return null; return null;

View File

@ -74,6 +74,21 @@ public class IrisObject extends IrisRegistrant {
private transient IrisLock lock = new IrisLock("Preloadcache"); private transient IrisLock lock = new IrisLock("Preloadcache");
private transient AtomicCache<AxisAlignedBB> aabb = new AtomicCache<>(); private transient AtomicCache<AxisAlignedBB> aabb = new AtomicCache<>();
public IrisObject(int w, int h, int d) {
blocks = new KMap<>();
states = new KMap<>();
this.w = w;
this.h = h;
this.d = d;
center = new BlockVector(w / 2, h / 2, d / 2);
}
public IrisObject() {
this(0,0,0);
}
public AxisAlignedBB getAABB() { public AxisAlignedBB getAABB() {
return aabb.aquire(() -> getAABBFor(new BlockVector(w, h, d))); return aabb.aquire(() -> getAABBFor(new BlockVector(w, h, d)));
} }
@ -214,15 +229,6 @@ public class IrisObject extends IrisRegistrant {
return o; return o;
} }
public IrisObject(int w, int h, int d) {
blocks = new KMap<>();
states = new KMap<>();
this.w = w;
this.h = h;
this.d = d;
center = new BlockVector(w / 2, h / 2, d / 2);
}
@SuppressWarnings({"resource", "RedundantSuppression"}) @SuppressWarnings({"resource", "RedundantSuppression"})
public static BlockVector sampleSize(File file) throws IOException { public static BlockVector sampleSize(File file) throws IOException {
FileInputStream in = new FileInputStream(file); FileInputStream in = new FileInputStream(file);