mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Biome Styling
This commit is contained in:
parent
7f98aff531
commit
31bd6a0c0d
@ -1,10 +1,10 @@
|
||||
package com.volmit.iris.gen.layer;
|
||||
|
||||
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.IrisBiome;
|
||||
import com.volmit.iris.object.IrisRegion;
|
||||
import com.volmit.iris.object.NoiseStyle;
|
||||
import com.volmit.iris.util.BiomeResult;
|
||||
import com.volmit.iris.util.RNG;
|
||||
|
||||
@ -14,19 +14,18 @@ import lombok.Data;
|
||||
public class BiomeDataProvider
|
||||
{
|
||||
private InferredType type;
|
||||
private RarityCellGenerator<IrisBiome> generator;
|
||||
private CNG generator;
|
||||
private GenLayerBiome layer;
|
||||
|
||||
public BiomeDataProvider(GenLayerBiome layer, InferredType type, RNG rng)
|
||||
{
|
||||
this.type = type;
|
||||
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)
|
||||
{
|
||||
getGenerator().setShuffle(regionData.getBiomeShuffle());
|
||||
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.gen.DimensionChunkGenerator;
|
||||
import com.volmit.iris.noise.CellGenerator;
|
||||
import com.volmit.iris.noise.RarityCellGenerator;
|
||||
import com.volmit.iris.noise.CNG;
|
||||
import com.volmit.iris.object.InferredType;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
import com.volmit.iris.object.IrisRegion;
|
||||
@ -19,10 +18,9 @@ import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class GenLayerBiome extends GenLayer
|
||||
{
|
||||
private RarityCellGenerator<IrisRegion> regionGenerator;
|
||||
private CellGenerator bridgeGenerator;
|
||||
public class GenLayerBiome extends GenLayer {
|
||||
private CNG regionGenerator;
|
||||
private CNG bridgeGenerator;
|
||||
private BiomeDataProvider seaProvider;
|
||||
private BiomeDataProvider landProvider;
|
||||
private BiomeDataProvider shoreProvider;
|
||||
@ -31,8 +29,7 @@ public class GenLayerBiome extends GenLayer
|
||||
private BiomeDataProvider skylandProvider;
|
||||
private DimensionChunkGenerator iris;
|
||||
|
||||
public GenLayerBiome(DimensionChunkGenerator iris, RNG rng)
|
||||
{
|
||||
public GenLayerBiome(DimensionChunkGenerator iris, RNG rng) {
|
||||
super(iris, rng);
|
||||
this.iris = iris;
|
||||
seaProvider = new BiomeDataProvider(this, InferredType.SEA, rng);
|
||||
@ -41,119 +38,99 @@ public class GenLayerBiome extends GenLayer
|
||||
caveProvider = new BiomeDataProvider(this, InferredType.CAVE, rng);
|
||||
islandProvider = new BiomeDataProvider(this, InferredType.ISLAND, rng);
|
||||
skylandProvider = new BiomeDataProvider(this, InferredType.SKYLAND, rng);
|
||||
regionGenerator = new RarityCellGenerator<IrisRegion>(rng.nextParallelRNG(1188519));
|
||||
bridgeGenerator = new CellGenerator(rng.nextParallelRNG(1541462));
|
||||
regionGenerator = iris.getDimension().getRegionStyle().create(rng.nextParallelRNG(1188519)).bake()
|
||||
.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)
|
||||
{
|
||||
if(iris.getDimension().getRegions().isEmpty())
|
||||
{
|
||||
public IrisRegion getRegion(double bx, double bz) {
|
||||
if (iris.getDimension().getRegions().isEmpty()) {
|
||||
Iris.error("NO REGIONS!");
|
||||
return null;
|
||||
}
|
||||
|
||||
regionGenerator.setShuffle(iris.getDimension().getRegionShuffle());
|
||||
regionGenerator.setCellScale(0.35);
|
||||
double x = bx / iris.getDimension().getRegionZoom();
|
||||
double z = bz / iris.getDimension().getRegionZoom();
|
||||
double x = bx;
|
||||
double z = bz;
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public BiomeDataProvider getProvider(InferredType type)
|
||||
{
|
||||
if(type.equals(InferredType.SEA))
|
||||
{
|
||||
public BiomeDataProvider getProvider(InferredType type) {
|
||||
if (type.equals(InferredType.SEA)) {
|
||||
return seaProvider;
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.LAND))
|
||||
{
|
||||
else if (type.equals(InferredType.LAND)) {
|
||||
return landProvider;
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.SHORE))
|
||||
{
|
||||
else if (type.equals(InferredType.SHORE)) {
|
||||
return shoreProvider;
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.CAVE))
|
||||
{
|
||||
else if (type.equals(InferredType.CAVE)) {
|
||||
return caveProvider;
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.ISLAND))
|
||||
{
|
||||
else if (type.equals(InferredType.ISLAND)) {
|
||||
return islandProvider;
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.SKYLAND))
|
||||
{
|
||||
else if (type.equals(InferredType.SKYLAND)) {
|
||||
return skylandProvider;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
else {
|
||||
Iris.error("Cannot find a BiomeDataProvider for type " + type.name());
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public InferredType getType(double bx, double bz, IrisRegion regionData)
|
||||
{
|
||||
bridgeGenerator.setShuffle(iris.getDimension().getContinentalShuffle());
|
||||
bridgeGenerator.setCellScale(0.33);
|
||||
double x = bx / iris.getDimension().getContinentZoom();
|
||||
double z = bz / iris.getDimension().getContinentZoom();
|
||||
return bridgeGenerator.getIndex(x, z, 2) == 1 ? InferredType.LAND : InferredType.SEA;
|
||||
public InferredType getType(double bx, double bz, IrisRegion regionData) {
|
||||
double x = bx;
|
||||
double z = bz;
|
||||
return bridgeGenerator.fit(0, 1, x, z) == 0 ? InferredType.LAND : InferredType.SEA;
|
||||
}
|
||||
|
||||
public BiomeResult generateBiomeData(double bx, double bz, IrisRegion regionData, RarityCellGenerator<IrisBiome> cell, KList<IrisBiome> biomes, InferredType inferredType)
|
||||
{
|
||||
if(biomes.isEmpty())
|
||||
{
|
||||
public BiomeResult generateBiomeData(double bx, double bz, IrisRegion regionData, CNG cell, KList<IrisBiome> biomes,
|
||||
InferredType inferredType) {
|
||||
if (biomes.isEmpty()) {
|
||||
return new BiomeResult(null, 0);
|
||||
}
|
||||
|
||||
double x = bx / (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);
|
||||
|
||||
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)
|
||||
{
|
||||
for(IrisRegionRidge i : regionData.getRidgeBiomes())
|
||||
{
|
||||
if(i.getType().equals(type) && i.isRidge(rng, rawX, rawZ))
|
||||
{
|
||||
public BiomeResult generateImpureData(int rawX, int rawZ, InferredType type, IrisRegion regionData,
|
||||
BiomeResult pureResult) {
|
||||
for (IrisRegionRidge i : regionData.getRidgeBiomes()) {
|
||||
if (i.getType().equals(type) && i.isRidge(rng, rawX, rawZ)) {
|
||||
return new BiomeResult(iris.loadBiome(i.getBiome()).infer(i.getAs(), type), 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
for(IrisRegionSpot i : regionData.getSpotBiomes())
|
||||
{
|
||||
if(i.getType().equals(type) && i.isSpot(rng, rawX, rawZ))
|
||||
{
|
||||
for (IrisRegionSpot i : regionData.getSpotBiomes()) {
|
||||
if (i.getType().equals(type) && i.isSpot(rng, rawX, rawZ)) {
|
||||
return new BiomeResult(iris.loadBiome(i.getBiome()).infer(i.getAs(), type), 0.5);
|
||||
}
|
||||
}
|
||||
@ -161,41 +138,34 @@ public class GenLayerBiome extends GenLayer
|
||||
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);
|
||||
}
|
||||
|
||||
public BiomeResult implode(double bx, double bz, IrisRegion regionData, RarityCellGenerator<IrisBiome> parentCell, BiomeResult parent, int hits)
|
||||
{
|
||||
if(hits > 9)
|
||||
{
|
||||
public BiomeResult implode(double bx, double bz, IrisRegion regionData, CNG parentCell, BiomeResult parent,
|
||||
int hits) {
|
||||
if (hits > 9) {
|
||||
return parent;
|
||||
}
|
||||
|
||||
double x = bx / iris.getDimension().getBiomeZoom();
|
||||
double z = bz / iris.getDimension().getBiomeZoom();
|
||||
|
||||
if(parent.getDistance() > regionData.getBiomeImplosionRatio())
|
||||
{
|
||||
if(!parent.getBiome().getRealChildren(iris).isEmpty())
|
||||
{
|
||||
RarityCellGenerator<IrisBiome> childCell = parent.getBiome().getChildrenGenerator(rng, 123, parentCell.getCellScale() * parent.getBiome().getChildShrinkFactor());
|
||||
KList<IrisBiome> chx = parent.getBiome().getRealChildren(iris).copy();
|
||||
if (!parent.getBiome().getRealChildren(iris).isEmpty()) {
|
||||
CNG childCell = parent.getBiome().getChildrenGenerator(rng, 123, parent.getBiome().getChildShrinkFactor());
|
||||
KList<IrisBiome> chx = parent.getBiome().getRealChildren(iris).copy(); // TODO Cache
|
||||
chx.add(parent.getBiome());
|
||||
IrisBiome biome = childCell.get(x, z, chx);
|
||||
IrisBiome biome = childCell.fitRarity(chx, x, z);
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double generate(double x, double z)
|
||||
{
|
||||
public double generate(double x, double z) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.gen.ContextualChunkGenerator;
|
||||
import com.volmit.iris.gen.atomics.AtomicCache;
|
||||
import com.volmit.iris.noise.CNG;
|
||||
import com.volmit.iris.noise.RarityCellGenerator;
|
||||
import com.volmit.iris.util.ArrayType;
|
||||
import com.volmit.iris.util.DependsOn;
|
||||
import com.volmit.iris.util.Desc;
|
||||
@ -40,13 +39,13 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
private KList<IrisEffect> effects = new KList<>();
|
||||
|
||||
@DontObfuscate
|
||||
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
|
||||
@DependsOn({ "biomeStyle", "biomeZoom", "biomeScatter" })
|
||||
@Desc("This changes the dispersion of the biome colors if multiple derivatives are chosen.")
|
||||
private NoiseStyle biomeStyle = NoiseStyle.SIMPLEX;
|
||||
|
||||
@MinNumber(0.0001)
|
||||
@DontObfuscate
|
||||
@DependsOn({"biomeStyle", "biomeZoom", "biomeScatter"})
|
||||
@DependsOn({ "biomeStyle", "biomeZoom", "biomeScatter" })
|
||||
@Desc("This zooms in the biome colors if multiple derivatives are chosen")
|
||||
private double biomeZoom = 1;
|
||||
|
||||
@ -76,10 +75,15 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
private KList<Biome> biomeSkyScatter = new KList<>();
|
||||
|
||||
@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.")
|
||||
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)
|
||||
@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.")
|
||||
@ -132,7 +136,7 @@ public class IrisBiome extends IrisRegistrant implements IRare {
|
||||
private KList<IrisDepositGenerator> deposits = new KList<>();
|
||||
|
||||
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<Integer> maxHeight = 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) {
|
||||
return childrenCell.aquire(() -> {
|
||||
RarityCellGenerator<IrisBiome> childrenCell = new RarityCellGenerator<IrisBiome>(
|
||||
random.nextParallelRNG(sig * 2137));
|
||||
childrenCell.setCellScale(scale);
|
||||
return childrenCell;
|
||||
});
|
||||
public CNG getChildrenGenerator(RNG random, int sig, double scale) {
|
||||
return childrenCell
|
||||
.aquire(() -> getChildStyle().create(random.nextParallelRNG(sig * 2137)).bake().scale(scale).bake());
|
||||
}
|
||||
|
||||
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.")
|
||||
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)
|
||||
@MaxNumber(256)
|
||||
@DontObfuscate
|
||||
@ -211,18 +219,6 @@ public class IrisDimension extends IrisRegistrant {
|
||||
@Desc("Change the size of regions")
|
||||
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
|
||||
@Desc("Disable this to stop placing schematics in biomes")
|
||||
private boolean placeObjects = true;
|
||||
|
@ -22,8 +22,7 @@ import lombok.EqualsAndHashCode;
|
||||
@Desc("Represents an iris region")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisRegion extends IrisRegistrant implements IRare
|
||||
{
|
||||
public class IrisRegion extends IrisRegistrant implements IRare {
|
||||
@MinNumber(2)
|
||||
@Required
|
||||
@DontObfuscate
|
||||
@ -51,11 +50,6 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
||||
@DontObfuscate
|
||||
@Desc("The min shore height")
|
||||
private double shoreHeightMin = 1.2;
|
||||
@DontObfuscate
|
||||
|
||||
@MinNumber(0)
|
||||
@Desc("The scrambling between biomes")
|
||||
private double biomeShuffle = 11;
|
||||
|
||||
@MinNumber(0)
|
||||
@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>> realCaveBiomes = new AtomicCache<>();
|
||||
|
||||
public double getBiomeZoom(InferredType t)
|
||||
{
|
||||
switch(t)
|
||||
{
|
||||
public double getBiomeZoom(InferredType t) {
|
||||
switch (t) {
|
||||
case CAVE:
|
||||
return caveBiomeZoom;
|
||||
case ISLAND:
|
||||
@ -188,10 +180,8 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
||||
return 1;
|
||||
}
|
||||
|
||||
public KList<String> getRidgeBiomeKeys()
|
||||
{
|
||||
return cacheRidge.aquire(() ->
|
||||
{
|
||||
public KList<String> getRidgeBiomeKeys() {
|
||||
return cacheRidge.aquire(() -> {
|
||||
KList<String> cacheRidge = new KList<String>();
|
||||
ridgeBiomes.forEach((i) -> cacheRidge.add(i.getBiome()));
|
||||
|
||||
@ -199,31 +189,27 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
||||
});
|
||||
}
|
||||
|
||||
public KList<String> getSpotBiomeKeys()
|
||||
{
|
||||
return cacheSpot.aquire(() ->
|
||||
{
|
||||
public KList<String> getSpotBiomeKeys() {
|
||||
return cacheSpot.aquire(() -> {
|
||||
KList<String> cacheSpot = new KList<String>();
|
||||
spotBiomes.forEach((i) -> cacheSpot.add(i.getBiome()));
|
||||
return cacheSpot;
|
||||
});
|
||||
}
|
||||
|
||||
public CNG getShoreHeightGenerator()
|
||||
{
|
||||
return shoreHeightGenerator.aquire(() ->
|
||||
{
|
||||
return CNG.signature(new RNG((long) (getName().length() + getIslandBiomes().size() + getLandBiomeZoom() + getLandBiomes().size() + 3458612)));
|
||||
public CNG getShoreHeightGenerator() {
|
||||
return shoreHeightGenerator.aquire(() -> {
|
||||
return CNG.signature(new RNG((long) (getName().length() + getIslandBiomes().size() + getLandBiomeZoom()
|
||||
+ getLandBiomes().size() + 3458612)));
|
||||
});
|
||||
}
|
||||
|
||||
public double getShoreHeight(double x, double z)
|
||||
{
|
||||
return getShoreHeightGenerator().fitDouble(shoreHeightMin, shoreHeightMax, x / shoreHeightZoom, z / shoreHeightZoom);
|
||||
public double getShoreHeight(double x, double z) {
|
||||
return getShoreHeightGenerator().fitDouble(shoreHeightMin, shoreHeightMax, x / shoreHeightZoom,
|
||||
z / shoreHeightZoom);
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getAllBiomes(ContextualChunkGenerator g)
|
||||
{
|
||||
public KList<IrisBiome> getAllBiomes(ContextualChunkGenerator g) {
|
||||
KMap<String, IrisBiome> b = new KMap<>();
|
||||
KSet<String> names = new KSet<>();
|
||||
names.addAll(landBiomes);
|
||||
@ -235,12 +221,9 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
||||
spotBiomes.forEach((i) -> names.add(i.getBiome()));
|
||||
ridgeBiomes.forEach((i) -> names.add(i.getBiome()));
|
||||
|
||||
while(!names.isEmpty())
|
||||
{
|
||||
for(String i : new KList<>(names))
|
||||
{
|
||||
if(b.containsKey(i))
|
||||
{
|
||||
while (!names.isEmpty()) {
|
||||
for (String i : new KList<>(names)) {
|
||||
if (b.containsKey(i)) {
|
||||
names.remove(i);
|
||||
continue;
|
||||
}
|
||||
@ -255,49 +238,39 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
||||
return b.v();
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getBiomes(ContextualChunkGenerator g, InferredType type)
|
||||
{
|
||||
if(type.equals(InferredType.LAND))
|
||||
{
|
||||
public KList<IrisBiome> getBiomes(ContextualChunkGenerator g, InferredType type) {
|
||||
if (type.equals(InferredType.LAND)) {
|
||||
return getRealLandBiomes(g);
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.SEA))
|
||||
{
|
||||
else if (type.equals(InferredType.SEA)) {
|
||||
return getRealSeaBiomes(g);
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.SHORE))
|
||||
{
|
||||
else if (type.equals(InferredType.SHORE)) {
|
||||
return getRealShoreBiomes(g);
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.CAVE))
|
||||
{
|
||||
else if (type.equals(InferredType.CAVE)) {
|
||||
return getRealCaveBiomes(g);
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.ISLAND))
|
||||
{
|
||||
else if (type.equals(InferredType.ISLAND)) {
|
||||
return getRealIslandBiomes(g);
|
||||
}
|
||||
|
||||
else if(type.equals(InferredType.SKYLAND))
|
||||
{
|
||||
else if (type.equals(InferredType.SKYLAND)) {
|
||||
return getRealSkylandBiomes(g);
|
||||
}
|
||||
|
||||
return new KList<>();
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getRealCaveBiomes(ContextualChunkGenerator g)
|
||||
{
|
||||
return realCaveBiomes.aquire(() ->
|
||||
{
|
||||
public KList<IrisBiome> getRealCaveBiomes(ContextualChunkGenerator g) {
|
||||
return realCaveBiomes.aquire(() -> {
|
||||
KList<IrisBiome> realCaveBiomes = new KList<>();
|
||||
|
||||
for(String i : getCaveBiomes())
|
||||
{
|
||||
for (String i : getCaveBiomes()) {
|
||||
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)
|
||||
{
|
||||
return realSkylandBiomes.aquire(() ->
|
||||
{
|
||||
public KList<IrisBiome> getRealSkylandBiomes(ContextualChunkGenerator g) {
|
||||
return realSkylandBiomes.aquire(() -> {
|
||||
KList<IrisBiome> realSkylandBiomes = new KList<>();
|
||||
|
||||
for(String i : getSkylandBiomes())
|
||||
{
|
||||
for (String i : getSkylandBiomes()) {
|
||||
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)
|
||||
{
|
||||
return realIslandBiomes.aquire(() ->
|
||||
{
|
||||
public KList<IrisBiome> getRealIslandBiomes(ContextualChunkGenerator g) {
|
||||
return realIslandBiomes.aquire(() -> {
|
||||
KList<IrisBiome> realIslandBiomes = new KList<>();
|
||||
|
||||
for(String i : getIslandBiomes())
|
||||
{
|
||||
for (String i : getIslandBiomes()) {
|
||||
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)
|
||||
{
|
||||
return realShoreBiomes.aquire(() ->
|
||||
{
|
||||
public KList<IrisBiome> getRealShoreBiomes(ContextualChunkGenerator g) {
|
||||
return realShoreBiomes.aquire(() -> {
|
||||
KList<IrisBiome> realShoreBiomes = new KList<>();
|
||||
|
||||
for(String i : getShoreBiomes())
|
||||
{
|
||||
for (String i : getShoreBiomes()) {
|
||||
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)
|
||||
{
|
||||
return realSeaBiomes.aquire(() ->
|
||||
{
|
||||
public KList<IrisBiome> getRealSeaBiomes(ContextualChunkGenerator g) {
|
||||
return realSeaBiomes.aquire(() -> {
|
||||
KList<IrisBiome> realSeaBiomes = new KList<>();
|
||||
|
||||
for(String i : getSeaBiomes())
|
||||
{
|
||||
for (String i : getSeaBiomes()) {
|
||||
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)
|
||||
{
|
||||
return realLandBiomes.aquire(() ->
|
||||
{
|
||||
public KList<IrisBiome> getRealLandBiomes(ContextualChunkGenerator g) {
|
||||
return realLandBiomes.aquire(() -> {
|
||||
KList<IrisBiome> realLandBiomes = new KList<>();
|
||||
|
||||
for(String i : getLandBiomes())
|
||||
{
|
||||
for (String i : getLandBiomes()) {
|
||||
realLandBiomes.add((g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user