This commit is contained in:
cyberpwn
2021-08-20 01:34:14 -04:00
parent 4a1e511262
commit 154adafbcb
16 changed files with 213 additions and 585 deletions

View File

@@ -27,6 +27,7 @@ import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.block.IrisBlockDrops;
import com.volmit.iris.engine.object.cave.IrisCavePlacer;
import com.volmit.iris.engine.object.common.IRare;
import com.volmit.iris.engine.object.decoration.IrisDecorator;
import com.volmit.iris.engine.object.deposits.IrisDepositGenerator;
@@ -74,6 +75,10 @@ public class IrisBiome extends IrisRegistrant implements IRare {
@Desc("This is the human readable name for this biome. This can and should be different than the file name. This is not used for loading biomes in other objects.")
private String name = "A Biome";
@Desc("Register caves to generate")
@ArrayType(min = 1, type = IrisCavePlacer.class)
private KList<IrisCavePlacer> caves = new KList<>();
@ArrayType(min = 1, type = IrisBiomeCustom.class)
@Desc("If the biome type custom is defined, specify this")
private KList<IrisBiomeCustom> customDerivitives;

View File

@@ -32,6 +32,8 @@ import com.volmit.iris.engine.object.carve.IrisCarveLayer;
import com.volmit.iris.engine.object.carve.IrisCaveFluid;
import com.volmit.iris.engine.object.carve.IrisCaveLayer;
import com.volmit.iris.engine.object.carve.IrisCaverns;
import com.volmit.iris.engine.object.cave.IrisCave;
import com.volmit.iris.engine.object.cave.IrisCavePlacer;
import com.volmit.iris.engine.object.deposits.IrisDepositGenerator;
import com.volmit.iris.engine.object.feature.IrisFeaturePositional;
import com.volmit.iris.engine.object.feature.IrisFeaturePotential;
@@ -175,9 +177,6 @@ public class IrisDimension extends IrisRegistrant {
@Desc("The placement style of biomes")
private IrisGeneratorStyle skylandBiomeStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
@Desc("Generate caves or not.")
private boolean caves = true;
@Desc("Instead of filling objects with air, fills them with cobweb so you can see them")
private boolean debugSmartBore = false;
@@ -210,9 +209,6 @@ public class IrisDimension extends IrisRegistrant {
@Desc("Add painted walls in post processing")
private boolean postProcessingWalls = true;
@Desc("Use post processing for caves or not")
private boolean postProcessCaves = true;
@Desc("The world environment")
private Environment environment = Environment.NORMAL;
@@ -305,10 +301,6 @@ public class IrisDimension extends IrisRegistrant {
@Desc("Overlay additional noise on top of the interoplated terrain.")
private KList<IrisShapedGeneratorStyle> overlayNoise = new KList<>();
@ArrayType(min = 1, type = IrisCaveLayer.class)
@Desc("Define cave layers")
private KList<IrisCaveLayer> caveLayers = new KList<>();
@ArrayType(min = 1, type = IrisCarveLayer.class)
@Desc("Define carve layers")
private KList<IrisCarveLayer> carveLayers = new KList<>();
@@ -330,6 +322,10 @@ public class IrisDimension extends IrisRegistrant {
@Desc("Cartographer map trade overrides")
private IrisVillagerOverride patchCartographers = new IrisVillagerOverride().setDisableTrade(false);
@Desc("Register caves to generate")
@ArrayType(min = 1, type = IrisCavePlacer.class)
private KList<IrisCavePlacer> caves = new KList<>();
private final transient AtomicCache<Position2> parallaxSize = new AtomicCache<>();
private final transient AtomicCache<CNG> rockLayerGenerator = new AtomicCache<>();
private final transient AtomicCache<CNG> fluidLayerGenerator = new AtomicCache<>();

View File

@@ -22,7 +22,6 @@ import com.volmit.iris.Iris;
import com.volmit.iris.engine.IrisComplex;
import com.volmit.iris.engine.data.cache.AtomicCache;
import com.volmit.iris.engine.framework.Engine;
import com.volmit.iris.engine.modifier.IrisCaveModifier;
import com.volmit.iris.engine.object.annotations.Desc;
import com.volmit.iris.engine.object.annotations.MinNumber;
import com.volmit.iris.engine.object.annotations.RegistryListResource;
@@ -83,23 +82,8 @@ public class IrisEntitySpawn implements IRare {
int h = gen.getHeight(x, z, true);
int hf = gen.getHeight(x, z, false);
Location l = switch (getReferenceSpawner().getGroup()) {
case NORMAL -> new Location(c.getWorld(), x, hf + 1, z);
case CAVE -> {
IrisComplex comp = gen.getComplex();
IrisBiome cave = comp.getCaveBiomeStream().get(x, z);
KList<Location> r = new KList<>();
if (cave != null) {
for (CaveResult i : ((IrisCaveModifier) gen.getCaveModifier()).genCaves(x, z)) {
if (i.getCeiling() >= gen.getHeight() || i.getFloor() < 0 || i.getCeiling() - 2 <= i.getFloor()) {
continue;
}
r.add(new Location(c.getWorld(), x, i.getFloor(), z));
}
}
yield r.getRandom(rng);
}
case NORMAL, CAVE -> new Location(c.getWorld(), x, hf + 1, z);
// TODO HANDLE CAVES
case UNDERWATER, BEACH -> new Location(c.getWorld(), x, rng.i(h + 1, hf), z);
};

View File

@@ -27,6 +27,7 @@ import com.volmit.iris.engine.object.annotations.*;
import com.volmit.iris.engine.object.biome.InferredType;
import com.volmit.iris.engine.object.biome.IrisBiome;
import com.volmit.iris.engine.object.block.IrisBlockDrops;
import com.volmit.iris.engine.object.cave.IrisCavePlacer;
import com.volmit.iris.engine.object.common.IRare;
import com.volmit.iris.engine.object.deposits.IrisDepositGenerator;
import com.volmit.iris.engine.object.feature.IrisFeaturePotential;
@@ -69,6 +70,10 @@ public class IrisRegion extends IrisRegistrant implements IRare {
@Desc("The name of the region")
private String name = "A Region";
@Desc("Register caves to generate")
@ArrayType(min = 1, type = IrisCavePlacer.class)
private KList<IrisCavePlacer> caves = new KList<>();
@ArrayType(min = 1, type = IrisJigsawStructurePlacement.class)
@Desc("Jigsaw structures")
private KList<IrisJigsawStructurePlacement> jigsawStructures = new KList<>();