Stop serious memory leaks

This commit is contained in:
Daniel Mills 2021-07-20 02:59:15 -04:00
parent d6b2e019c7
commit 0595008fce
2 changed files with 6 additions and 1 deletions

View File

@ -108,6 +108,7 @@ public class IrisComplex implements DataProvider {
public IrisComplex(Engine engine, boolean simple) { public IrisComplex(Engine engine, boolean simple) {
int cacheSize = 1024 * 128; int cacheSize = 1024 * 128;
IrisBiome emptyBiome = new IrisBiome();
this.rng = new RNG(engine.getWorld().seed()); this.rng = new RNG(engine.getWorld().seed());
this.data = engine.getData(); this.data = engine.getData();
double height = engine.getHeight(); double height = engine.getHeight();
@ -151,7 +152,7 @@ public class IrisComplex implements DataProvider {
.onNull("") .onNull("")
.convertCached((s) -> { .convertCached((s) -> {
if (s.isEmpty()) { if (s.isEmpty()) {
return new IrisBiome(); return emptyBiome;
} }
return data.getBiomeLoader().load(s) return data.getBiomeLoader().load(s)

View File

@ -992,4 +992,8 @@ public class IrisObject extends IrisRegistrant {
} }
return locations; return locations;
} }
public int volume() {
return blocks.size();
}
} }