9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-27 11:09:06 +00:00

Unload mantle when not generating

This commit is contained in:
cyberpwn
2022-09-11 20:58:58 -04:00
parent 3d0c0a11ed
commit 7c7309c3ab
4 changed files with 17 additions and 4 deletions

View File

@@ -175,7 +175,8 @@ public class IrisComplex implements DataProvider {
heightStream = ProceduralStream.of((x, z) -> {
IrisBiome b = focusBiome != null ? focusBiome : baseBiomeStream.get(x, z);
return getHeight(engine, b, x, z, engine.getSeedManager().getHeight());
}, Interpolated.DOUBLE).clamp(0, engine.getHeight()).cache2D("heightStream", engine, cacheSize).waste("Height Stream")
}, Interpolated.DOUBLE).clamp(0, engine.getHeight()).cache2D("heightStream", engine, cacheSize)
.waste("Height Stream")
.contextInjecting((c,x,z)->c.getHeight().get(x, z));
roundedHeighteightStream = heightStream.round().waste("Rounded Height Stream")
.contextInjecting((c,x,z)->(int)Math.round(c.getHeight().get(x, z)));

View File

@@ -147,6 +147,7 @@ public class IrisEngine implements Engine {
}
private void tickRandomPlayer() {
recycle();
if(perSecondBudLatch.flip()) {
buds.set(bud.get());
bud.set(0);
@@ -459,8 +460,6 @@ public class IrisEngine implements Engine {
if(generated.get() == 661) {
J.a(() -> getData().savePrefetch(this));
}
recycle();
} catch(Throwable e) {
Iris.reportError(e);
fail("Failed to generate " + x + ", " + z, e);