mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-28 11:39:07 +00:00
Fix loader close bug
This commit is contained in:
@@ -52,15 +52,9 @@ public class IrisCave extends IrisRegistrant {
|
||||
@Desc("Define potential forking features")
|
||||
private IrisCarving fork = new IrisCarving();
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Force this cave to only generate the specified custom biome")
|
||||
private String customBiome = "";
|
||||
|
||||
@Desc("Limit the worm from ever getting higher or lower than this range")
|
||||
private IrisRange verticalRange = new IrisRange(3, 255);
|
||||
|
||||
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
|
||||
|
||||
@Override
|
||||
public String getFolderName() {
|
||||
return "caves";
|
||||
@@ -71,12 +65,12 @@ public class IrisCave extends IrisRegistrant {
|
||||
return "Cave";
|
||||
}
|
||||
|
||||
public void generate(MantleWriter writer, RNG rng, Engine engine, int x, int y, int z) {
|
||||
public void generate(MantleWriter writer, RNG rng, Engine engine, int x, int y, int z, MatterCavern biome) {
|
||||
|
||||
writer.setLine(getWorm().generate(rng, engine.getData(), writer, verticalRange, x, y, z,
|
||||
(at) -> fork.doCarving(writer, rng, engine, at.getX(), at.getY(), at.getZ())),
|
||||
getWorm().getGirth().get(rng, x, z, engine.getData()), true,
|
||||
matterNodeCache.aquire(() -> CavernMatter.get(getCustomBiome())));
|
||||
biome);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,15 +23,19 @@ import com.volmit.iris.core.loader.IrisData;
|
||||
import com.volmit.iris.engine.data.cache.AtomicCache;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.mantle.MantleWriter;
|
||||
import com.volmit.iris.engine.modifier.IrisCarveModifier;
|
||||
import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
import com.volmit.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import com.volmit.iris.engine.object.noise.IrisStyledRange;
|
||||
import com.volmit.iris.engine.object.noise.NoiseStyle;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.MatterCavern;
|
||||
import com.volmit.iris.util.matter.slices.CavernMatter;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -62,6 +66,11 @@ public class IrisCavePlacer implements IRare {
|
||||
@Desc("The height range this cave can spawn at. If breakSurface is false, the output of this range will be clamped by the current world height to prevent surface breaking.")
|
||||
private IrisStyledRange caveStartHeight = new IrisStyledRange(13, 120, new IrisGeneratorStyle(NoiseStyle.STATIC));
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Force this cave to only generate the specified custom biome")
|
||||
private String customBiome = "";
|
||||
|
||||
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
|
||||
private transient final AtomicCache<IrisCave> caveCache = new AtomicCache<>();
|
||||
private transient final AtomicBoolean fail = new AtomicBoolean(false);
|
||||
|
||||
@@ -94,7 +103,8 @@ public class IrisCavePlacer implements IRare {
|
||||
}
|
||||
|
||||
try {
|
||||
cave.generate(mantle, rng, engine, x + rng.nextInt(15), y, z + rng.nextInt(15));
|
||||
cave.generate(mantle, rng, engine, x + rng.nextInt(15), y, z + rng.nextInt(15),
|
||||
matterNodeCache.aquire(() -> customBiome.isEmpty() ? CavernMatter.ON : CavernMatter.get(customBiome)));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
fail.set(true);
|
||||
|
||||
@@ -55,10 +55,6 @@ public class IrisRavine extends IrisRegistrant {
|
||||
@Desc("Define the shape of this ravine (2d, ignores Y)")
|
||||
private IrisWorm worm;
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Force this cave to only generate the specified custom biome")
|
||||
private String customBiome = "";
|
||||
|
||||
@Desc("Define potential forking features")
|
||||
private IrisCarving fork = new IrisCarving();
|
||||
|
||||
@@ -86,8 +82,6 @@ public class IrisRavine extends IrisRegistrant {
|
||||
@Desc("The thickness of the ravine ribs")
|
||||
private double ribThickness = 3;
|
||||
|
||||
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
|
||||
|
||||
@Override
|
||||
public String getFolderName() {
|
||||
return "ravines";
|
||||
@@ -98,7 +92,7 @@ public class IrisRavine extends IrisRegistrant {
|
||||
return "Ravine";
|
||||
}
|
||||
|
||||
public void generate(MantleWriter writer, RNG rng, Engine engine, int x, int y, int z) {
|
||||
public void generate(MantleWriter writer, RNG rng, Engine engine, int x, int y, int z, MatterCavern biome) {
|
||||
|
||||
KList<IrisPosition> pos = getWorm().generate(rng, engine.getData(), writer, null, x, y, z, (at) -> {
|
||||
});
|
||||
@@ -129,7 +123,7 @@ public class IrisRavine extends IrisRegistrant {
|
||||
break;
|
||||
}
|
||||
|
||||
writer.setElipsoid(p.getX(), i, p.getZ(), v, ribThickness, v, true, matterNodeCache.aquire(() -> CavernMatter.get(getCustomBiome())));
|
||||
writer.setElipsoid(p.getX(), i, p.getZ(), v, ribThickness, v, true, biome);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +139,7 @@ public class IrisRavine extends IrisRegistrant {
|
||||
break;
|
||||
}
|
||||
|
||||
writer.setElipsoid(p.getX(), i, p.getZ(), v, ribThickness, v, true, matterNodeCache.aquire(() -> CavernMatter.get(getCustomBiome())));
|
||||
writer.setElipsoid(p.getX(), i, p.getZ(), v, ribThickness, v, true, biome);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,11 @@ import com.volmit.iris.engine.object.annotations.Desc;
|
||||
import com.volmit.iris.engine.object.annotations.MinNumber;
|
||||
import com.volmit.iris.engine.object.annotations.RegistryListResource;
|
||||
import com.volmit.iris.engine.object.annotations.Required;
|
||||
import com.volmit.iris.engine.object.biome.IrisBiome;
|
||||
import com.volmit.iris.engine.object.common.IRare;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.matter.MatterCavern;
|
||||
import com.volmit.iris.util.matter.slices.CavernMatter;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -53,6 +56,11 @@ public class IrisRavinePlacer implements IRare {
|
||||
@RegistryListResource(IrisRavine.class)
|
||||
private String ravine;
|
||||
|
||||
@RegistryListResource(IrisBiome.class)
|
||||
@Desc("Force this cave to only generate the specified custom biome")
|
||||
private String customBiome = "";
|
||||
|
||||
private transient final AtomicCache<MatterCavern> matterNodeCache = new AtomicCache<>();
|
||||
private transient final AtomicCache<IrisRavine> ravineCache = new AtomicCache<>();
|
||||
private transient final AtomicBoolean fail = new AtomicBoolean(false);
|
||||
|
||||
@@ -81,7 +89,8 @@ public class IrisRavinePlacer implements IRare {
|
||||
try {
|
||||
int xx = x + rng.nextInt(15);
|
||||
int zz = z + rng.nextInt(15);
|
||||
ravine.generate(mantle, rng, engine, xx, y, zz);
|
||||
ravine.generate(mantle, rng, engine, xx, y, zz,
|
||||
matterNodeCache.aquire(() -> customBiome.isEmpty() ? CavernMatter.ON : CavernMatter.get(customBiome)));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
fail.set(true);
|
||||
|
||||
Reference in New Issue
Block a user