mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Biome Styling
This commit is contained in:
parent
7f98aff531
commit
31bd6a0c0d
@ -1,10 +1,10 @@
|
|||||||
package com.volmit.iris.gen.layer;
|
package com.volmit.iris.gen.layer;
|
||||||
|
|
||||||
import com.volmit.iris.gen.ContextualChunkGenerator;
|
import com.volmit.iris.gen.ContextualChunkGenerator;
|
||||||
import com.volmit.iris.noise.RarityCellGenerator;
|
import com.volmit.iris.noise.CNG;
|
||||||
import com.volmit.iris.object.InferredType;
|
import com.volmit.iris.object.InferredType;
|
||||||
import com.volmit.iris.object.IrisBiome;
|
|
||||||
import com.volmit.iris.object.IrisRegion;
|
import com.volmit.iris.object.IrisRegion;
|
||||||
|
import com.volmit.iris.object.NoiseStyle;
|
||||||
import com.volmit.iris.util.BiomeResult;
|
import com.volmit.iris.util.BiomeResult;
|
||||||
import com.volmit.iris.util.RNG;
|
import com.volmit.iris.util.RNG;
|
||||||
|
|
||||||
@ -14,19 +14,18 @@ import lombok.Data;
|
|||||||
public class BiomeDataProvider
|
public class BiomeDataProvider
|
||||||
{
|
{
|
||||||
private InferredType type;
|
private InferredType type;
|
||||||
private RarityCellGenerator<IrisBiome> generator;
|
private CNG generator;
|
||||||
private GenLayerBiome layer;
|
private GenLayerBiome layer;
|
||||||
|
|
||||||
public BiomeDataProvider(GenLayerBiome layer, InferredType type, RNG rng)
|
public BiomeDataProvider(GenLayerBiome layer, InferredType type, RNG rng)
|
||||||
{
|
{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.layer = layer;
|
this.layer = layer;
|
||||||
generator = new RarityCellGenerator<IrisBiome>(rng.nextParallelRNG(4645079 + (type.ordinal() * 23845)));
|
generator = NoiseStyle.CELLULAR_IRIS_DOUBLE.create(rng.nextParallelRNG(4645079 + (type.ordinal() * 23845)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeResult generatePureData(ContextualChunkGenerator g, double bx, double bz, int rawX, int rawZ, IrisRegion regionData)
|
public BiomeResult generatePureData(ContextualChunkGenerator g, double bx, double bz, int rawX, int rawZ, IrisRegion regionData)
|
||||||
{
|
{
|
||||||
getGenerator().setShuffle(regionData.getBiomeShuffle());
|
|
||||||
return layer.generateBiomeData(bx, bz, regionData, getGenerator(), regionData.getBiomes(g, getType()), getType());
|
return layer.generateBiomeData(bx, bz, regionData, getGenerator(), regionData.getBiomes(g, getType()), getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,7 @@ package com.volmit.iris.gen.layer;
|
|||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.gen.DimensionChunkGenerator;
|
import com.volmit.iris.gen.DimensionChunkGenerator;
|
||||||
import com.volmit.iris.noise.CellGenerator;
|
import com.volmit.iris.noise.CNG;
|
||||||
import com.volmit.iris.noise.RarityCellGenerator;
|
|
||||||
import com.volmit.iris.object.InferredType;
|
import com.volmit.iris.object.InferredType;
|
||||||
import com.volmit.iris.object.IrisBiome;
|
import com.volmit.iris.object.IrisBiome;
|
||||||
import com.volmit.iris.object.IrisRegion;
|
import com.volmit.iris.object.IrisRegion;
|
||||||
@ -19,10 +18,9 @@ import lombok.EqualsAndHashCode;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class GenLayerBiome extends GenLayer
|
public class GenLayerBiome extends GenLayer {
|
||||||
{
|
private CNG regionGenerator;
|
||||||
private RarityCellGenerator<IrisRegion> regionGenerator;
|
private CNG bridgeGenerator;
|
||||||
private CellGenerator bridgeGenerator;
|
|
||||||
private BiomeDataProvider seaProvider;
|
private BiomeDataProvider seaProvider;
|
||||||
private BiomeDataProvider landProvider;
|
private BiomeDataProvider landProvider;
|
||||||
private BiomeDataProvider shoreProvider;
|
private BiomeDataProvider shoreProvider;
|
||||||
@ -31,8 +29,7 @@ public class GenLayerBiome extends GenLayer
|
|||||||
private BiomeDataProvider skylandProvider;
|
private BiomeDataProvider skylandProvider;
|
||||||
private DimensionChunkGenerator iris;
|
private DimensionChunkGenerator iris;
|
||||||
|
|
||||||
public GenLayerBiome(DimensionChunkGenerator iris, RNG rng)
|
public GenLayerBiome(DimensionChunkGenerator iris, RNG rng) {
|
||||||
{
|
|
||||||
super(iris, rng);
|
super(iris, rng);
|
||||||
this.iris = iris;
|
this.iris = iris;
|
||||||
seaProvider = new BiomeDataProvider(this, InferredType.SEA, rng);
|
seaProvider = new BiomeDataProvider(this, InferredType.SEA, rng);
|
||||||
@ -41,119 +38,99 @@ public class GenLayerBiome extends GenLayer
|
|||||||
caveProvider = new BiomeDataProvider(this, InferredType.CAVE, rng);
|
caveProvider = new BiomeDataProvider(this, InferredType.CAVE, rng);
|
||||||
islandProvider = new BiomeDataProvider(this, InferredType.ISLAND, rng);
|
islandProvider = new BiomeDataProvider(this, InferredType.ISLAND, rng);
|
||||||
skylandProvider = new BiomeDataProvider(this, InferredType.SKYLAND, rng);
|
skylandProvider = new BiomeDataProvider(this, InferredType.SKYLAND, rng);
|
||||||
regionGenerator = new RarityCellGenerator<IrisRegion>(rng.nextParallelRNG(1188519));
|
regionGenerator = iris.getDimension().getRegionStyle().create(rng.nextParallelRNG(1188519)).bake()
|
||||||
bridgeGenerator = new CellGenerator(rng.nextParallelRNG(1541462));
|
.scale(1D / iris.getDimension().getRegionZoom());
|
||||||
|
bridgeGenerator = iris.getDimension().getContinentalStyle().create(rng.nextParallelRNG(1541462)).bake()
|
||||||
|
.scale(1D / iris.getDimension().getContinentZoom());
|
||||||
}
|
}
|
||||||
|
|
||||||
public IrisRegion getRegion(double bx, double bz)
|
public IrisRegion getRegion(double bx, double bz) {
|
||||||
{
|
if (iris.getDimension().getRegions().isEmpty()) {
|
||||||
if(iris.getDimension().getRegions().isEmpty())
|
|
||||||
{
|
|
||||||
Iris.error("NO REGIONS!");
|
Iris.error("NO REGIONS!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
regionGenerator.setShuffle(iris.getDimension().getRegionShuffle());
|
double x = bx;
|
||||||
regionGenerator.setCellScale(0.35);
|
double z = bz;
|
||||||
double x = bx / iris.getDimension().getRegionZoom();
|
|
||||||
double z = bz / iris.getDimension().getRegionZoom();
|
|
||||||
|
|
||||||
return regionGenerator.get(x, z, iris.getDimension().getAllRegions(iris));
|
return regionGenerator.fitRarity(iris.getDimension().getAllRegions(iris), x, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeResult generateData(double bx, double bz, int rawX, int rawZ)
|
public BiomeResult generateData(double bx, double bz, int rawX, int rawZ) {
|
||||||
{
|
|
||||||
return generateRegionData(bx, bz, rawX, rawZ, getRegion(bx, bz));
|
return generateRegionData(bx, bz, rawX, rawZ, getRegion(bx, bz));
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeResult generateData(InferredType type, double bx, double bz, int rawX, int rawZ, IrisRegion regionData)
|
public BiomeResult generateData(InferredType type, double bx, double bz, int rawX, int rawZ,
|
||||||
{
|
IrisRegion regionData) {
|
||||||
return getProvider(type).generateData(iris, bx, bz, rawX, rawZ, regionData);
|
return getProvider(type).generateData(iris, bx, bz, rawX, rawZ, regionData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeDataProvider getProvider(InferredType type)
|
public BiomeDataProvider getProvider(InferredType type) {
|
||||||
{
|
if (type.equals(InferredType.SEA)) {
|
||||||
if(type.equals(InferredType.SEA))
|
|
||||||
{
|
|
||||||
return seaProvider;
|
return seaProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.LAND))
|
else if (type.equals(InferredType.LAND)) {
|
||||||
{
|
|
||||||
return landProvider;
|
return landProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.SHORE))
|
else if (type.equals(InferredType.SHORE)) {
|
||||||
{
|
|
||||||
return shoreProvider;
|
return shoreProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.CAVE))
|
else if (type.equals(InferredType.CAVE)) {
|
||||||
{
|
|
||||||
return caveProvider;
|
return caveProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.ISLAND))
|
else if (type.equals(InferredType.ISLAND)) {
|
||||||
{
|
|
||||||
return islandProvider;
|
return islandProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.SKYLAND))
|
else if (type.equals(InferredType.SKYLAND)) {
|
||||||
{
|
|
||||||
return skylandProvider;
|
return skylandProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
Iris.error("Cannot find a BiomeDataProvider for type " + type.name());
|
Iris.error("Cannot find a BiomeDataProvider for type " + type.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeResult generateRegionData(double bx, double bz, int rawX, int rawZ, IrisRegion regionData)
|
public BiomeResult generateRegionData(double bx, double bz, int rawX, int rawZ, IrisRegion regionData) {
|
||||||
{
|
|
||||||
return generateData(getType(bx, bz, regionData), bx, bz, rawX, rawZ, regionData);
|
return generateData(getType(bx, bz, regionData), bx, bz, rawX, rawZ, regionData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InferredType getType(double bx, double bz, IrisRegion regionData)
|
public InferredType getType(double bx, double bz, IrisRegion regionData) {
|
||||||
{
|
double x = bx;
|
||||||
bridgeGenerator.setShuffle(iris.getDimension().getContinentalShuffle());
|
double z = bz;
|
||||||
bridgeGenerator.setCellScale(0.33);
|
return bridgeGenerator.fit(0, 1, x, z) == 0 ? InferredType.LAND : InferredType.SEA;
|
||||||
double x = bx / iris.getDimension().getContinentZoom();
|
|
||||||
double z = bz / iris.getDimension().getContinentZoom();
|
|
||||||
return bridgeGenerator.getIndex(x, z, 2) == 1 ? InferredType.LAND : InferredType.SEA;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeResult generateBiomeData(double bx, double bz, IrisRegion regionData, RarityCellGenerator<IrisBiome> cell, KList<IrisBiome> biomes, InferredType inferredType)
|
public BiomeResult generateBiomeData(double bx, double bz, IrisRegion regionData, CNG cell, KList<IrisBiome> biomes,
|
||||||
{
|
InferredType inferredType) {
|
||||||
if(biomes.isEmpty())
|
if (biomes.isEmpty()) {
|
||||||
{
|
|
||||||
return new BiomeResult(null, 0);
|
return new BiomeResult(null, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
double x = bx / (iris.getDimension().getBiomeZoom() * regionData.getBiomeZoom(inferredType));
|
double x = bx / (iris.getDimension().getBiomeZoom() * regionData.getBiomeZoom(inferredType));
|
||||||
double z = bz / (iris.getDimension().getBiomeZoom() * regionData.getBiomeZoom(inferredType));
|
double z = bz / (iris.getDimension().getBiomeZoom() * regionData.getBiomeZoom(inferredType));
|
||||||
IrisBiome biome = cell.get(x, z, biomes);
|
IrisBiome biome = cell.fitRarity(biomes, x, z);
|
||||||
biome.setInferredType(inferredType);
|
biome.setInferredType(inferredType);
|
||||||
|
|
||||||
return implode(bx, bz, regionData, cell, new BiomeResult(biome, cell.getDistance(x, z)));
|
return implode(bx, bz, regionData, cell, new BiomeResult(biome, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeResult generateImpureData(int rawX, int rawZ, InferredType type, IrisRegion regionData, BiomeResult pureResult)
|
public BiomeResult generateImpureData(int rawX, int rawZ, InferredType type, IrisRegion regionData,
|
||||||
{
|
BiomeResult pureResult) {
|
||||||
for(IrisRegionRidge i : regionData.getRidgeBiomes())
|
for (IrisRegionRidge i : regionData.getRidgeBiomes()) {
|
||||||
{
|
if (i.getType().equals(type) && i.isRidge(rng, rawX, rawZ)) {
|
||||||
if(i.getType().equals(type) && i.isRidge(rng, rawX, rawZ))
|
|
||||||
{
|
|
||||||
return new BiomeResult(iris.loadBiome(i.getBiome()).infer(i.getAs(), type), 0.5);
|
return new BiomeResult(iris.loadBiome(i.getBiome()).infer(i.getAs(), type), 0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisRegionSpot i : regionData.getSpotBiomes())
|
for (IrisRegionSpot i : regionData.getSpotBiomes()) {
|
||||||
{
|
if (i.getType().equals(type) && i.isSpot(rng, rawX, rawZ)) {
|
||||||
if(i.getType().equals(type) && i.isSpot(rng, rawX, rawZ))
|
|
||||||
{
|
|
||||||
return new BiomeResult(iris.loadBiome(i.getBiome()).infer(i.getAs(), type), 0.5);
|
return new BiomeResult(iris.loadBiome(i.getBiome()).infer(i.getAs(), type), 0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -161,41 +138,34 @@ public class GenLayerBiome extends GenLayer
|
|||||||
return pureResult;
|
return pureResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeResult implode(double bx, double bz, IrisRegion regionData, RarityCellGenerator<IrisBiome> parentCell, BiomeResult parent)
|
public BiomeResult implode(double bx, double bz, IrisRegion regionData, CNG parentCell, BiomeResult parent) {
|
||||||
{
|
|
||||||
return implode(bx, bz, regionData, parentCell, parent, 1);
|
return implode(bx, bz, regionData, parentCell, parent, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BiomeResult implode(double bx, double bz, IrisRegion regionData, RarityCellGenerator<IrisBiome> parentCell, BiomeResult parent, int hits)
|
public BiomeResult implode(double bx, double bz, IrisRegion regionData, CNG parentCell, BiomeResult parent,
|
||||||
{
|
int hits) {
|
||||||
if(hits > 9)
|
if (hits > 9) {
|
||||||
{
|
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
double x = bx / iris.getDimension().getBiomeZoom();
|
double x = bx / iris.getDimension().getBiomeZoom();
|
||||||
double z = bz / iris.getDimension().getBiomeZoom();
|
double z = bz / iris.getDimension().getBiomeZoom();
|
||||||
|
|
||||||
if(parent.getDistance() > regionData.getBiomeImplosionRatio())
|
if (!parent.getBiome().getRealChildren(iris).isEmpty()) {
|
||||||
{
|
CNG childCell = parent.getBiome().getChildrenGenerator(rng, 123, parent.getBiome().getChildShrinkFactor());
|
||||||
if(!parent.getBiome().getRealChildren(iris).isEmpty())
|
KList<IrisBiome> chx = parent.getBiome().getRealChildren(iris).copy(); // TODO Cache
|
||||||
{
|
|
||||||
RarityCellGenerator<IrisBiome> childCell = parent.getBiome().getChildrenGenerator(rng, 123, parentCell.getCellScale() * parent.getBiome().getChildShrinkFactor());
|
|
||||||
KList<IrisBiome> chx = parent.getBiome().getRealChildren(iris).copy();
|
|
||||||
chx.add(parent.getBiome());
|
chx.add(parent.getBiome());
|
||||||
IrisBiome biome = childCell.get(x, z, chx);
|
IrisBiome biome = childCell.fitRarity(chx, x, z);
|
||||||
biome.setInferredType(parent.getBiome().getInferredType());
|
biome.setInferredType(parent.getBiome().getInferredType());
|
||||||
|
|
||||||
return implode(bx, bz, regionData, childCell, new BiomeResult(biome, childCell.getDistance(x, z)), hits + 1);
|
return implode(bx, bz, regionData, childCell, new BiomeResult(biome, 0), hits + 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double generate(double x, double z)
|
public double generate(double x, double z) {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import com.volmit.iris.Iris;
|
|||||||
import com.volmit.iris.gen.ContextualChunkGenerator;
|
import com.volmit.iris.gen.ContextualChunkGenerator;
|
||||||
import com.volmit.iris.gen.atomics.AtomicCache;
|
import com.volmit.iris.gen.atomics.AtomicCache;
|
||||||
import com.volmit.iris.noise.CNG;
|
import com.volmit.iris.noise.CNG;
|
||||||
import com.volmit.iris.noise.RarityCellGenerator;
|
|
||||||
import com.volmit.iris.util.ArrayType;
|
import com.volmit.iris.util.ArrayType;
|
||||||
import com.volmit.iris.util.DependsOn;
|
import com.volmit.iris.util.DependsOn;
|
||||||
import com.volmit.iris.util.Desc;
|
import com.volmit.iris.util.Desc;
|
||||||
@ -40,13 +39,13 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
|||||||
private KList<IrisEffect> effects = new KList<>();
|
private KList<IrisEffect> effects = new KList<>();
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
|
@DependsOn({ "biomeStyle", "biomeZoom", "biomeScatter" })
|
||||||
@Desc("This changes the dispersion of the biome colors if multiple derivatives are chosen.")
|
@Desc("This changes the dispersion of the biome colors if multiple derivatives are chosen.")
|
||||||
private NoiseStyle biomeStyle = NoiseStyle.SIMPLEX;
|
private NoiseStyle biomeStyle = NoiseStyle.SIMPLEX;
|
||||||
|
|
||||||
@MinNumber(0.0001)
|
@MinNumber(0.0001)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
|
@DependsOn({ "biomeStyle", "biomeZoom", "biomeScatter" })
|
||||||
@Desc("This zooms in the biome colors if multiple derivatives are chosen")
|
@Desc("This zooms in the biome colors if multiple derivatives are chosen")
|
||||||
private double biomeZoom = 1;
|
private double biomeZoom = 1;
|
||||||
|
|
||||||
@ -76,10 +75,15 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
|||||||
private KList<Biome> biomeSkyScatter = new KList<>();
|
private KList<Biome> biomeSkyScatter = new KList<>();
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@DependsOn({"children"})
|
@DependsOn({ "children" })
|
||||||
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, how much smaller will it be (inside of this biome). Higher values means a smaller biome relative to this biome's size. Set higher than 1.0 and below 3.0 for best results.")
|
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, how much smaller will it be (inside of this biome). Higher values means a smaller biome relative to this biome's size. Set higher than 1.0 and below 3.0 for best results.")
|
||||||
private double childShrinkFactor = 1.5;
|
private double childShrinkFactor = 1.5;
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
@DependsOn({ "children" })
|
||||||
|
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, How will it be shaped?")
|
||||||
|
private NoiseStyle childStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE;
|
||||||
|
|
||||||
@ArrayType(min = 1, type = String.class)
|
@ArrayType(min = 1, type = String.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("List any biome names (file names without.json) here as children. Portions of this biome can sometimes morph into their children. Iris supports cyclic relationships such as A > B > A > B. Iris will stop checking 9 biomes down the tree.")
|
@Desc("List any biome names (file names without.json) here as children. Portions of this biome can sometimes morph into their children. Iris supports cyclic relationships such as A > B > A > B. Iris will stop checking 9 biomes down the tree.")
|
||||||
@ -132,7 +136,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
|||||||
private KList<IrisDepositGenerator> deposits = new KList<>();
|
private KList<IrisDepositGenerator> deposits = new KList<>();
|
||||||
|
|
||||||
private transient InferredType inferredType;
|
private transient InferredType inferredType;
|
||||||
private transient AtomicCache<RarityCellGenerator<IrisBiome>> childrenCell = new AtomicCache<>();
|
private transient AtomicCache<CNG> childrenCell = new AtomicCache<>();
|
||||||
private transient AtomicCache<CNG> biomeGenerator = new AtomicCache<>();
|
private transient AtomicCache<CNG> biomeGenerator = new AtomicCache<>();
|
||||||
private transient AtomicCache<Integer> maxHeight = new AtomicCache<>();
|
private transient AtomicCache<Integer> maxHeight = new AtomicCache<>();
|
||||||
private transient AtomicCache<KList<IrisBiome>> realChildren = new AtomicCache<>();
|
private transient AtomicCache<KList<IrisBiome>> realChildren = new AtomicCache<>();
|
||||||
@ -159,13 +163,9 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public RarityCellGenerator<IrisBiome> getChildrenGenerator(RNG random, int sig, double scale) {
|
public CNG getChildrenGenerator(RNG random, int sig, double scale) {
|
||||||
return childrenCell.aquire(() -> {
|
return childrenCell
|
||||||
RarityCellGenerator<IrisBiome> childrenCell = new RarityCellGenerator<IrisBiome>(
|
.aquire(() -> getChildStyle().create(random.nextParallelRNG(sig * 2137)).bake().scale(scale).bake());
|
||||||
random.nextParallelRNG(sig * 2137));
|
|
||||||
childrenCell.setCellScale(scale);
|
|
||||||
return childrenCell;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<BlockData> generateLayers(double wx, double wz, RNG random, int maxDepth, int height) {
|
public KList<BlockData> generateLayers(double wx, double wz, RNG random, int maxDepth, int height) {
|
||||||
|
@ -57,6 +57,14 @@ public class IrisDimension extends IrisRegistrant {
|
|||||||
@Desc("The cave web scale. Smaller values means scaled up vein networks.")
|
@Desc("The cave web scale. Smaller values means scaled up vein networks.")
|
||||||
private double caveScale = 1D;
|
private double caveScale = 1D;
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The placement style of regions")
|
||||||
|
private NoiseStyle regionStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE;
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The placement style of land/sea")
|
||||||
|
private NoiseStyle continentalStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE;
|
||||||
|
|
||||||
@MinNumber(-256)
|
@MinNumber(-256)
|
||||||
@MaxNumber(256)
|
@MaxNumber(256)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@ -211,18 +219,6 @@ public class IrisDimension extends IrisRegistrant {
|
|||||||
@Desc("Change the size of regions")
|
@Desc("Change the size of regions")
|
||||||
private double regionZoom = 1;
|
private double regionZoom = 1;
|
||||||
|
|
||||||
@MinNumber(0)
|
|
||||||
@MaxNumber(8192)
|
|
||||||
@DontObfuscate
|
|
||||||
@Desc("The shuffle of regions")
|
|
||||||
private double regionShuffle = 11;
|
|
||||||
|
|
||||||
@MinNumber(0)
|
|
||||||
@MaxNumber(8192)
|
|
||||||
@DontObfuscate
|
|
||||||
@Desc("The shuffle of land vs sea")
|
|
||||||
private double continentalShuffle = 99;
|
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("Disable this to stop placing schematics in biomes")
|
@Desc("Disable this to stop placing schematics in biomes")
|
||||||
private boolean placeObjects = true;
|
private boolean placeObjects = true;
|
||||||
|
@ -22,8 +22,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
@Desc("Represents an iris region")
|
@Desc("Represents an iris region")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class IrisRegion extends IrisRegistrant implements IRare
|
public class IrisRegion extends IrisRegistrant implements IRare {
|
||||||
{
|
|
||||||
@MinNumber(2)
|
@MinNumber(2)
|
||||||
@Required
|
@Required
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@ -51,11 +50,6 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The min shore height")
|
@Desc("The min shore height")
|
||||||
private double shoreHeightMin = 1.2;
|
private double shoreHeightMin = 1.2;
|
||||||
@DontObfuscate
|
|
||||||
|
|
||||||
@MinNumber(0)
|
|
||||||
@Desc("The scrambling between biomes")
|
|
||||||
private double biomeShuffle = 11;
|
|
||||||
|
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@ -165,10 +159,8 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
private transient AtomicCache<KList<IrisBiome>> realSkylandBiomes = new AtomicCache<>();
|
private transient AtomicCache<KList<IrisBiome>> realSkylandBiomes = new AtomicCache<>();
|
||||||
private transient AtomicCache<KList<IrisBiome>> realCaveBiomes = new AtomicCache<>();
|
private transient AtomicCache<KList<IrisBiome>> realCaveBiomes = new AtomicCache<>();
|
||||||
|
|
||||||
public double getBiomeZoom(InferredType t)
|
public double getBiomeZoom(InferredType t) {
|
||||||
{
|
switch (t) {
|
||||||
switch(t)
|
|
||||||
{
|
|
||||||
case CAVE:
|
case CAVE:
|
||||||
return caveBiomeZoom;
|
return caveBiomeZoom;
|
||||||
case ISLAND:
|
case ISLAND:
|
||||||
@ -188,10 +180,8 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<String> getRidgeBiomeKeys()
|
public KList<String> getRidgeBiomeKeys() {
|
||||||
{
|
return cacheRidge.aquire(() -> {
|
||||||
return cacheRidge.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<String> cacheRidge = new KList<String>();
|
KList<String> cacheRidge = new KList<String>();
|
||||||
ridgeBiomes.forEach((i) -> cacheRidge.add(i.getBiome()));
|
ridgeBiomes.forEach((i) -> cacheRidge.add(i.getBiome()));
|
||||||
|
|
||||||
@ -199,31 +189,27 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<String> getSpotBiomeKeys()
|
public KList<String> getSpotBiomeKeys() {
|
||||||
{
|
return cacheSpot.aquire(() -> {
|
||||||
return cacheSpot.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<String> cacheSpot = new KList<String>();
|
KList<String> cacheSpot = new KList<String>();
|
||||||
spotBiomes.forEach((i) -> cacheSpot.add(i.getBiome()));
|
spotBiomes.forEach((i) -> cacheSpot.add(i.getBiome()));
|
||||||
return cacheSpot;
|
return cacheSpot;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public CNG getShoreHeightGenerator()
|
public CNG getShoreHeightGenerator() {
|
||||||
{
|
return shoreHeightGenerator.aquire(() -> {
|
||||||
return shoreHeightGenerator.aquire(() ->
|
return CNG.signature(new RNG((long) (getName().length() + getIslandBiomes().size() + getLandBiomeZoom()
|
||||||
{
|
+ getLandBiomes().size() + 3458612)));
|
||||||
return CNG.signature(new RNG((long) (getName().length() + getIslandBiomes().size() + getLandBiomeZoom() + getLandBiomes().size() + 3458612)));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getShoreHeight(double x, double z)
|
public double getShoreHeight(double x, double z) {
|
||||||
{
|
return getShoreHeightGenerator().fitDouble(shoreHeightMin, shoreHeightMax, x / shoreHeightZoom,
|
||||||
return getShoreHeightGenerator().fitDouble(shoreHeightMin, shoreHeightMax, x / shoreHeightZoom, z / shoreHeightZoom);
|
z / shoreHeightZoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<IrisBiome> getAllBiomes(ContextualChunkGenerator g)
|
public KList<IrisBiome> getAllBiomes(ContextualChunkGenerator g) {
|
||||||
{
|
|
||||||
KMap<String, IrisBiome> b = new KMap<>();
|
KMap<String, IrisBiome> b = new KMap<>();
|
||||||
KSet<String> names = new KSet<>();
|
KSet<String> names = new KSet<>();
|
||||||
names.addAll(landBiomes);
|
names.addAll(landBiomes);
|
||||||
@ -235,12 +221,9 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
spotBiomes.forEach((i) -> names.add(i.getBiome()));
|
spotBiomes.forEach((i) -> names.add(i.getBiome()));
|
||||||
ridgeBiomes.forEach((i) -> names.add(i.getBiome()));
|
ridgeBiomes.forEach((i) -> names.add(i.getBiome()));
|
||||||
|
|
||||||
while(!names.isEmpty())
|
while (!names.isEmpty()) {
|
||||||
{
|
for (String i : new KList<>(names)) {
|
||||||
for(String i : new KList<>(names))
|
if (b.containsKey(i)) {
|
||||||
{
|
|
||||||
if(b.containsKey(i))
|
|
||||||
{
|
|
||||||
names.remove(i);
|
names.remove(i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -255,49 +238,39 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
return b.v();
|
return b.v();
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<IrisBiome> getBiomes(ContextualChunkGenerator g, InferredType type)
|
public KList<IrisBiome> getBiomes(ContextualChunkGenerator g, InferredType type) {
|
||||||
{
|
if (type.equals(InferredType.LAND)) {
|
||||||
if(type.equals(InferredType.LAND))
|
|
||||||
{
|
|
||||||
return getRealLandBiomes(g);
|
return getRealLandBiomes(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.SEA))
|
else if (type.equals(InferredType.SEA)) {
|
||||||
{
|
|
||||||
return getRealSeaBiomes(g);
|
return getRealSeaBiomes(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.SHORE))
|
else if (type.equals(InferredType.SHORE)) {
|
||||||
{
|
|
||||||
return getRealShoreBiomes(g);
|
return getRealShoreBiomes(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.CAVE))
|
else if (type.equals(InferredType.CAVE)) {
|
||||||
{
|
|
||||||
return getRealCaveBiomes(g);
|
return getRealCaveBiomes(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.ISLAND))
|
else if (type.equals(InferredType.ISLAND)) {
|
||||||
{
|
|
||||||
return getRealIslandBiomes(g);
|
return getRealIslandBiomes(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(type.equals(InferredType.SKYLAND))
|
else if (type.equals(InferredType.SKYLAND)) {
|
||||||
{
|
|
||||||
return getRealSkylandBiomes(g);
|
return getRealSkylandBiomes(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new KList<>();
|
return new KList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<IrisBiome> getRealCaveBiomes(ContextualChunkGenerator g)
|
public KList<IrisBiome> getRealCaveBiomes(ContextualChunkGenerator g) {
|
||||||
{
|
return realCaveBiomes.aquire(() -> {
|
||||||
return realCaveBiomes.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<IrisBiome> realCaveBiomes = new KList<>();
|
KList<IrisBiome> realCaveBiomes = new KList<>();
|
||||||
|
|
||||||
for(String i : getCaveBiomes())
|
for (String i : getCaveBiomes()) {
|
||||||
{
|
|
||||||
realCaveBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
realCaveBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,14 +278,11 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<IrisBiome> getRealSkylandBiomes(ContextualChunkGenerator g)
|
public KList<IrisBiome> getRealSkylandBiomes(ContextualChunkGenerator g) {
|
||||||
{
|
return realSkylandBiomes.aquire(() -> {
|
||||||
return realSkylandBiomes.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<IrisBiome> realSkylandBiomes = new KList<>();
|
KList<IrisBiome> realSkylandBiomes = new KList<>();
|
||||||
|
|
||||||
for(String i : getSkylandBiomes())
|
for (String i : getSkylandBiomes()) {
|
||||||
{
|
|
||||||
realSkylandBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
realSkylandBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,14 +290,11 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<IrisBiome> getRealIslandBiomes(ContextualChunkGenerator g)
|
public KList<IrisBiome> getRealIslandBiomes(ContextualChunkGenerator g) {
|
||||||
{
|
return realIslandBiomes.aquire(() -> {
|
||||||
return realIslandBiomes.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<IrisBiome> realIslandBiomes = new KList<>();
|
KList<IrisBiome> realIslandBiomes = new KList<>();
|
||||||
|
|
||||||
for(String i : getIslandBiomes())
|
for (String i : getIslandBiomes()) {
|
||||||
{
|
|
||||||
realIslandBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
realIslandBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,14 +302,11 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<IrisBiome> getRealShoreBiomes(ContextualChunkGenerator g)
|
public KList<IrisBiome> getRealShoreBiomes(ContextualChunkGenerator g) {
|
||||||
{
|
return realShoreBiomes.aquire(() -> {
|
||||||
return realShoreBiomes.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<IrisBiome> realShoreBiomes = new KList<>();
|
KList<IrisBiome> realShoreBiomes = new KList<>();
|
||||||
|
|
||||||
for(String i : getShoreBiomes())
|
for (String i : getShoreBiomes()) {
|
||||||
{
|
|
||||||
realShoreBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
realShoreBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,14 +314,11 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<IrisBiome> getRealSeaBiomes(ContextualChunkGenerator g)
|
public KList<IrisBiome> getRealSeaBiomes(ContextualChunkGenerator g) {
|
||||||
{
|
return realSeaBiomes.aquire(() -> {
|
||||||
return realSeaBiomes.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<IrisBiome> realSeaBiomes = new KList<>();
|
KList<IrisBiome> realSeaBiomes = new KList<>();
|
||||||
|
|
||||||
for(String i : getSeaBiomes())
|
for (String i : getSeaBiomes()) {
|
||||||
{
|
|
||||||
realSeaBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
realSeaBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,14 +326,11 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<IrisBiome> getRealLandBiomes(ContextualChunkGenerator g)
|
public KList<IrisBiome> getRealLandBiomes(ContextualChunkGenerator g) {
|
||||||
{
|
return realLandBiomes.aquire(() -> {
|
||||||
return realLandBiomes.aquire(() ->
|
|
||||||
{
|
|
||||||
KList<IrisBiome> realLandBiomes = new KList<>();
|
KList<IrisBiome> realLandBiomes = new KList<>();
|
||||||
|
|
||||||
for(String i : getLandBiomes())
|
for (String i : getLandBiomes()) {
|
||||||
{
|
|
||||||
realLandBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
realLandBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user