mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
Carving Biomes
This commit is contained in:
parent
30e1d9552c
commit
9272765f3c
@ -304,12 +304,12 @@ public abstract class ParallaxTerrainProvider extends TopographicTerrainProvider
|
|||||||
|
|
||||||
private int placeObjects(RNG random, IrisRegion r, IrisBiome b, int i, int j, int g)
|
private int placeObjects(RNG random, IrisRegion r, IrisBiome b, int i, int j, int g)
|
||||||
{
|
{
|
||||||
for(IrisObjectPlacement k : b.getObjects())
|
for(IrisObjectPlacement k : b.getSurfaceObjects())
|
||||||
{
|
{
|
||||||
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3566522));
|
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3566522));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisObjectPlacement k : r.getObjects())
|
for(IrisObjectPlacement k : r.getSurfaceObjects())
|
||||||
{
|
{
|
||||||
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3569222));
|
placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3569222));
|
||||||
}
|
}
|
||||||
@ -341,12 +341,12 @@ public abstract class ParallaxTerrainProvider extends TopographicTerrainProvider
|
|||||||
|
|
||||||
private int placeCarveObjects(RNG random, IrisRegion r, IrisBiome b, int i, int j, int g, CarveResult c)
|
private int placeCarveObjects(RNG random, IrisRegion r, IrisBiome b, int i, int j, int g, CarveResult c)
|
||||||
{
|
{
|
||||||
for(IrisObjectPlacement k : b.getObjects())
|
for(IrisObjectPlacement k : b.getCarvingObjects())
|
||||||
{
|
{
|
||||||
placeCarveObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3569221 + g), c);
|
placeCarveObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3569221 + g), c);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(IrisObjectPlacement k : r.getObjects())
|
for(IrisObjectPlacement k : r.getCarvingObjects())
|
||||||
{
|
{
|
||||||
placeCarveObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3561222 + g), c);
|
placeCarveObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3561222 + g), c);
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ public abstract class TopographicTerrainProvider extends ParallelTerrainProvider
|
|||||||
boolean carvable = getGlCarve().couldCarveBelow(rx, height, rz);
|
boolean carvable = getGlCarve().couldCarveBelow(rx, height, rz);
|
||||||
IrisRegion region = sampleRegion(rx, rz);
|
IrisRegion region = sampleRegion(rx, rz);
|
||||||
IrisBiome biome = sampleTrueBiome(rx, rz, noise);
|
IrisBiome biome = sampleTrueBiome(rx, rz, noise);
|
||||||
IrisBiome landBiome = null;
|
IrisBiome carveBiome = null;
|
||||||
Biome onlyBiome = Iris.biome3d ? null : biome.getGroundBiome(getMasterRandom(), rz, getDimension().getFluidHeight(), rx);
|
Biome onlyBiome = Iris.biome3d ? null : biome.getGroundBiome(getMasterRandom(), rz, getDimension().getFluidHeight(), rx);
|
||||||
|
|
||||||
if(biome == null)
|
if(biome == null)
|
||||||
@ -185,12 +185,12 @@ public abstract class TopographicTerrainProvider extends ParallelTerrainProvider
|
|||||||
{
|
{
|
||||||
if(biomeMap != null)
|
if(biomeMap != null)
|
||||||
{
|
{
|
||||||
if(landBiome == null)
|
if(carveBiome == null)
|
||||||
{
|
{
|
||||||
landBiome = getGlBiome().generateData(InferredType.LAND, wx, wz, rx, rz, region);
|
carveBiome = biome.getRealCarvingBiome(getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
sliver.set(k, landBiome.getDerivative());
|
sliver.set(k, carveBiome.getDerivative());
|
||||||
}
|
}
|
||||||
|
|
||||||
sliver.set(k, CAVE_AIR);
|
sliver.set(k, CAVE_AIR);
|
||||||
@ -245,14 +245,14 @@ public abstract class TopographicTerrainProvider extends ParallelTerrainProvider
|
|||||||
// Set Surface Material for cavern layer surfaces
|
// Set Surface Material for cavern layer surfaces
|
||||||
else if(carvable && cavernHeights.isNotEmpty() && lastCavernHeight - k >= 0 && lastCavernHeight - k < 5)
|
else if(carvable && cavernHeights.isNotEmpty() && lastCavernHeight - k >= 0 && lastCavernHeight - k < 5)
|
||||||
{
|
{
|
||||||
if(landBiome == null)
|
if(carveBiome == null)
|
||||||
{
|
{
|
||||||
landBiome = getGlBiome().generateData(InferredType.LAND, wx, wz, rx, rz, region);
|
carveBiome = biome.getRealCarvingBiome(getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cavernLayers == null)
|
if(cavernLayers == null)
|
||||||
{
|
{
|
||||||
cavernLayers = landBiome.generateLayers(rx, rz, getMasterRandom(), 5, height - getFluidHeight());
|
cavernLayers = carveBiome.generateLayers(rx, rz, getMasterRandom(), 5, height - getFluidHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
block = cavernLayers.hasIndex(lastCavernHeight - k) ? cavernLayers.get(lastCavernHeight - k) : cavernLayers.get(0);
|
block = cavernLayers.hasIndex(lastCavernHeight - k) ? cavernLayers.get(lastCavernHeight - k) : cavernLayers.get(0);
|
||||||
@ -277,12 +277,12 @@ public abstract class TopographicTerrainProvider extends ParallelTerrainProvider
|
|||||||
// Decorate Cavern surfaces, but not the true surface
|
// Decorate Cavern surfaces, but not the true surface
|
||||||
if((carvable && cavernSurface) && !(k == Math.max(height, fluidHeight) && block.getMaterial().isSolid() && k < 255 && k >= fluidHeight))
|
if((carvable && cavernSurface) && !(k == Math.max(height, fluidHeight) && block.getMaterial().isSolid() && k < 255 && k >= fluidHeight))
|
||||||
{
|
{
|
||||||
if(landBiome == null)
|
if(carveBiome == null)
|
||||||
{
|
{
|
||||||
landBiome = getGlBiome().generateData(InferredType.LAND, wx, wz, rx, rz, region);
|
carveBiome = biome.getRealCarvingBiome(getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
decorateLand(landBiome, sliver, wx, k, wz, rx, rz, block);
|
decorateLand(carveBiome, sliver, wx, k, wz, rx, rz, block);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ public class GenLayerBiome extends GenLayer
|
|||||||
private BiomeDataProvider landProvider;
|
private BiomeDataProvider landProvider;
|
||||||
private BiomeDataProvider shoreProvider;
|
private BiomeDataProvider shoreProvider;
|
||||||
private BiomeDataProvider caveProvider;
|
private BiomeDataProvider caveProvider;
|
||||||
|
private BiomeDataProvider carveProvider;
|
||||||
private BiomeDataProvider riverProvider;
|
private BiomeDataProvider riverProvider;
|
||||||
private BiomeDataProvider lakeProvider;
|
private BiomeDataProvider lakeProvider;
|
||||||
private DimensionalTerrainProvider iris;
|
private DimensionalTerrainProvider iris;
|
||||||
|
25
src/main/java/com/volmit/iris/object/CarvingMode.java
Normal file
25
src/main/java/com/volmit/iris/object/CarvingMode.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package com.volmit.iris.object;
|
||||||
|
|
||||||
|
import com.volmit.iris.util.DontObfuscate;
|
||||||
|
|
||||||
|
public enum CarvingMode
|
||||||
|
{
|
||||||
|
@DontObfuscate
|
||||||
|
SURFACE_ONLY,
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
CARVING_ONLY,
|
||||||
|
|
||||||
|
@DontObfuscate
|
||||||
|
ANYWHERE;
|
||||||
|
|
||||||
|
public boolean supportsCarving()
|
||||||
|
{
|
||||||
|
return this.equals(ANYWHERE) || this.equals(CARVING_ONLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean supportsSurface()
|
||||||
|
{
|
||||||
|
return this.equals(ANYWHERE) || this.equals(SURFACE_ONLY);
|
||||||
|
}
|
||||||
|
}
|
@ -8,6 +8,7 @@ import org.bukkit.block.data.BlockData;
|
|||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import com.volmit.iris.gen.ContextualTerrainProvider;
|
import com.volmit.iris.gen.ContextualTerrainProvider;
|
||||||
import com.volmit.iris.gen.atomics.AtomicCache;
|
import com.volmit.iris.gen.atomics.AtomicCache;
|
||||||
|
import com.volmit.iris.manager.IrisDataManager;
|
||||||
import com.volmit.iris.noise.CNG;
|
import com.volmit.iris.noise.CNG;
|
||||||
import com.volmit.iris.util.ArrayType;
|
import com.volmit.iris.util.ArrayType;
|
||||||
import com.volmit.iris.util.DependsOn;
|
import com.volmit.iris.util.DependsOn;
|
||||||
@ -39,187 +40,217 @@ public class IrisBiome extends IrisRegistrant implements IRare
|
|||||||
{
|
{
|
||||||
@MinNumber(2)
|
@MinNumber(2)
|
||||||
@Required
|
@Required
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@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.")
|
@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";
|
private String name = "A Biome";
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Place text on terrain. Iris will render text into block schematics and randomly place them in this biome.")
|
@Desc("Place text on terrain. Iris will render text into block schematics and randomly place them in this biome.")
|
||||||
@ArrayType(min = 1, type = IrisTextPlacement.class)
|
@ArrayType(min = 1, type = IrisTextPlacement.class)
|
||||||
private KList<IrisTextPlacement> text = new KList<>();
|
private KList<IrisTextPlacement> text = new KList<>();
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("The type of fluid if this biome is underwater. To 'defer' this value to whatever the parent dimension fluid type is, use an emtpy string.")
|
@Desc("The type of fluid if this biome is underwater. To 'defer' this value to whatever the parent dimension fluid type is, use an emtpy string.")
|
||||||
private String fluidType = "";
|
private String fluidType = "";
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Entity spawns to override or add to this biome. Anytime an entity spawns, it has a chance to be replaced as one of these overrides.")
|
@Desc("Entity spawns to override or add to this biome. Anytime an entity spawns, it has a chance to be replaced as one of these overrides.")
|
||||||
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
|
@ArrayType(min = 1, type = IrisEntitySpawnOverride.class)
|
||||||
private KList<IrisEntitySpawnOverride> entitySpawnOverrides = new KList<>();
|
private KList<IrisEntitySpawnOverride> entitySpawnOverrides = new KList<>();
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Entity spawns during generation")
|
@Desc("Entity spawns during generation")
|
||||||
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
|
@ArrayType(min = 1, type = IrisEntityInitialSpawn.class)
|
||||||
private KList<IrisEntityInitialSpawn> entityInitialSpawns = new KList<>();
|
private KList<IrisEntityInitialSpawn> entityInitialSpawns = new KList<>();
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisEffect.class)
|
@ArrayType(min = 1, type = IrisEffect.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
|
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player. All of these effects are played via packets so two players won't see/hear each others effects.\nDue to performance reasons, effects will play arround the player even if where the effect was played is no longer in the biome the player is in.")
|
||||||
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 IrisGeneratorStyle biomeStyle = NoiseStyle.SIMPLEX.style();
|
private IrisGeneratorStyle biomeStyle = NoiseStyle.SIMPLEX.style();
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisBlockDrops.class)
|
@ArrayType(min = 1, type = IrisBlockDrops.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Define custom block drops for this biome")
|
@Desc("Define custom block drops for this biome")
|
||||||
private KList<IrisBlockDrops> blockDrops = new KList<>();
|
private KList<IrisBlockDrops> blockDrops = new KList<>();
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Reference loot tables in this area")
|
@Desc("Reference loot tables in this area")
|
||||||
private IrisLootReference loot = new IrisLootReference();
|
private IrisLootReference loot = new IrisLootReference();
|
||||||
|
|
||||||
@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;
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Layers no longer descend from the surface block, they descend from the max possible height the biome can produce (constant) creating mesa like layers.")
|
@Desc("Layers no longer descend from the surface block, they descend from the max possible height the biome can produce (constant) creating mesa like layers.")
|
||||||
private boolean lockLayers = false;
|
private boolean lockLayers = false;
|
||||||
|
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The max layers to iterate below the surface for locked layer biomes (mesa).")
|
@Desc("The max layers to iterate below the surface for locked layer biomes (mesa).")
|
||||||
private int lockLayersMax = 7;
|
private int lockLayersMax = 7;
|
||||||
|
|
||||||
@MinNumber(1)
|
@MinNumber(1)
|
||||||
|
|
||||||
@MaxNumber(512)
|
@MaxNumber(512)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The rarity of this biome (integer)")
|
@Desc("The rarity of this biome (integer)")
|
||||||
private int rarity = 1;
|
private int rarity = 1;
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("A debug color for visualizing this biome with a color. I.e. #F13AF5")
|
@Desc("A debug color for visualizing this biome with a color. I.e. #F13AF5")
|
||||||
private String debugColor = "";
|
private String debugColor = "";
|
||||||
|
|
||||||
@Required
|
@Required
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("The raw derivative of this biome. This is required or the terrain will not properly generate. Use any vanilla biome type. Look in examples/biome-list.txt")
|
@Desc("The raw derivative of this biome. This is required or the terrain will not properly generate. Use any vanilla biome type. Look in examples/biome-list.txt")
|
||||||
private Biome derivative = Biome.THE_VOID;
|
private Biome derivative = Biome.THE_VOID;
|
||||||
|
|
||||||
@ArrayType(min = 1, type = Biome.class)
|
@ArrayType(min = 1, type = Biome.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("You can instead specify multiple biome derivatives to randomly scatter colors in this biome")
|
@Desc("You can instead specify multiple biome derivatives to randomly scatter colors in this biome")
|
||||||
private KList<Biome> biomeScatter = new KList<>();
|
private KList<Biome> biomeScatter = new KList<>();
|
||||||
|
|
||||||
@ArrayType(min = 1, type = Biome.class)
|
@ArrayType(min = 1, type = Biome.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Since 1.13 supports 3D biomes, you can add different derivative colors for anything above the terrain. (Think swampy tree leaves with a desert looking grass surface)")
|
@Desc("Since 1.13 supports 3D biomes, you can add different derivative colors for anything above the terrain. (Think swampy tree leaves with a desert looking grass surface)")
|
||||||
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
|
@DontObfuscate
|
||||||
|
|
||||||
@DependsOn({"children"})
|
@DependsOn({"children"})
|
||||||
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, How will it be shaped?")
|
@Desc("If this biome has children biomes, and the gen layer chooses one of this biomes children, How will it be shaped?")
|
||||||
private IrisGeneratorStyle childStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
|
private IrisGeneratorStyle childStyle = NoiseStyle.CELLULAR_IRIS_DOUBLE.style();
|
||||||
|
|
||||||
@RegistryListBiome
|
@RegistryListBiome
|
||||||
|
|
||||||
@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.")
|
||||||
private KList<String> children = new KList<>();
|
private KList<String> children = new KList<>();
|
||||||
|
|
||||||
|
@RegistryListBiome
|
||||||
|
@DontObfuscate
|
||||||
|
@Desc("The carving biome. If specified the biome will be used when under a carving instead of this current biome.")
|
||||||
|
private String carvingBiome = "";
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The default slab if iris decides to place a slab in this biome. Default is no slab.")
|
@Desc("The default slab if iris decides to place a slab in this biome. Default is no slab.")
|
||||||
private IrisBiomePaletteLayer slab = new IrisBiomePaletteLayer().zero();
|
private IrisBiomePaletteLayer slab = new IrisBiomePaletteLayer().zero();
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("The default wall if iris decides to place a wall higher than 2 blocks (steep hills or possibly cliffs)")
|
@Desc("The default wall if iris decides to place a wall higher than 2 blocks (steep hills or possibly cliffs)")
|
||||||
private IrisBiomePaletteLayer wall = new IrisBiomePaletteLayer().zero();
|
private IrisBiomePaletteLayer wall = new IrisBiomePaletteLayer().zero();
|
||||||
|
|
||||||
@Required
|
@Required
|
||||||
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
|
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
|
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
|
||||||
private KList<IrisBiomePaletteLayer> layers = new KList<IrisBiomePaletteLayer>().qadd(new IrisBiomePaletteLayer());
|
private KList<IrisBiomePaletteLayer> layers = new KList<IrisBiomePaletteLayer>().qadd(new IrisBiomePaletteLayer());
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
|
@ArrayType(min = 1, type = IrisBiomePaletteLayer.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
|
@Desc("This defines the layers of materials in this biome. Each layer has a palette and min/max height and some other properties. Usually a grassy/sandy layer then a dirt layer then a stone layer. Iris will fill in the remaining blocks below your layers with stone.")
|
||||||
private KList<IrisBiomePaletteLayer> seaLayers = new KList<IrisBiomePaletteLayer>();
|
private KList<IrisBiomePaletteLayer> seaLayers = new KList<IrisBiomePaletteLayer>();
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisBiomeDecorator.class)
|
@ArrayType(min = 1, type = IrisBiomeDecorator.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)")
|
@Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)")
|
||||||
private KList<IrisBiomeDecorator> decorators = new KList<IrisBiomeDecorator>();
|
private KList<IrisBiomeDecorator> decorators = new KList<IrisBiomeDecorator>();
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisObjectPlacement.class)
|
@ArrayType(min = 1, type = IrisObjectPlacement.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Objects define what schematics (iob files) iris will place in this biome")
|
@Desc("Objects define what schematics (iob files) iris will place in this biome")
|
||||||
private KList<IrisObjectPlacement> objects = new KList<IrisObjectPlacement>();
|
private KList<IrisObjectPlacement> objects = new KList<IrisObjectPlacement>();
|
||||||
|
|
||||||
@Required
|
@Required
|
||||||
@ArrayType(min = 1, type = IrisBiomeGeneratorLink.class)
|
@ArrayType(min = 1, type = IrisBiomeGeneratorLink.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Generators for this biome. Multiple generators with different interpolation sizes will mix with other biomes how you would expect. This defines your biome height relative to the fluid height. Use negative for oceans.")
|
@Desc("Generators for this biome. Multiple generators with different interpolation sizes will mix with other biomes how you would expect. This defines your biome height relative to the fluid height. Use negative for oceans.")
|
||||||
private KList<IrisBiomeGeneratorLink> generators = new KList<IrisBiomeGeneratorLink>().qadd(new IrisBiomeGeneratorLink());
|
private KList<IrisBiomeGeneratorLink> generators = new KList<IrisBiomeGeneratorLink>().qadd(new IrisBiomeGeneratorLink());
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisStructurePlacement.class)
|
@ArrayType(min = 1, type = IrisStructurePlacement.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("A list of structure tilesets")
|
@Desc("A list of structure tilesets")
|
||||||
private KList<IrisStructurePlacement> structures = new KList<>();
|
private KList<IrisStructurePlacement> structures = new KList<>();
|
||||||
|
|
||||||
@ArrayType(min = 1, type = IrisDepositGenerator.class)
|
@ArrayType(min = 1, type = IrisDepositGenerator.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
|
|
||||||
@Desc("Define biome deposit generators that add onto the existing regional and global deposit generators")
|
@Desc("Define biome deposit generators that add onto the existing regional and global deposit generators")
|
||||||
private KList<IrisDepositGenerator> deposits = new KList<>();
|
private KList<IrisDepositGenerator> deposits = new KList<>();
|
||||||
|
|
||||||
private transient InferredType inferredType;
|
private transient InferredType inferredType;
|
||||||
|
|
||||||
|
private final transient AtomicCache<KList<IrisObjectPlacement>> surfaceObjectsCache = new AtomicCache<>(false);
|
||||||
|
private final transient AtomicCache<KList<IrisObjectPlacement>> carveObjectsCache = new AtomicCache<>(false);
|
||||||
private final transient AtomicCache<Color> cacheColor = new AtomicCache<>(true);
|
private final transient AtomicCache<Color> cacheColor = new AtomicCache<>(true);
|
||||||
private final transient AtomicCache<CNG> childrenCell = new AtomicCache<>();
|
private final transient AtomicCache<CNG> childrenCell = new AtomicCache<>();
|
||||||
private final transient AtomicCache<CNG> biomeGenerator = new AtomicCache<>();
|
private final transient AtomicCache<CNG> biomeGenerator = new AtomicCache<>();
|
||||||
private final transient AtomicCache<Integer> maxHeight = new AtomicCache<>();
|
private final transient AtomicCache<Integer> maxHeight = new AtomicCache<>();
|
||||||
|
private final transient AtomicCache<IrisBiome> realCarveBiome = new AtomicCache<>();
|
||||||
private final transient AtomicCache<KList<IrisBiome>> realChildren = new AtomicCache<>();
|
private final transient AtomicCache<KList<IrisBiome>> realChildren = new AtomicCache<>();
|
||||||
private final transient AtomicCache<KList<CNG>> layerHeightGenerators = new AtomicCache<>();
|
private final transient AtomicCache<KList<CNG>> layerHeightGenerators = new AtomicCache<>();
|
||||||
private final transient AtomicCache<KList<CNG>> layerSeaHeightGenerators = new AtomicCache<>();
|
private final transient AtomicCache<KList<CNG>> layerSeaHeightGenerators = new AtomicCache<>();
|
||||||
|
|
||||||
|
public IrisBiome getRealCarvingBiome(IrisDataManager data)
|
||||||
|
{
|
||||||
|
return realCarveBiome.aquire(() ->
|
||||||
|
{
|
||||||
|
IrisBiome biome = data.getBiomeLoader().load(getCarvingBiome());
|
||||||
|
|
||||||
|
if(biome == null)
|
||||||
|
{
|
||||||
|
biome = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
return biome;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public KList<IrisObjectPlacement> getSurfaceObjects()
|
||||||
|
{
|
||||||
|
return getSurfaceObjectsCache().aquire(() ->
|
||||||
|
{
|
||||||
|
KList<IrisObjectPlacement> o = getObjects().copy();
|
||||||
|
|
||||||
|
for(IrisObjectPlacement i : o.copy())
|
||||||
|
{
|
||||||
|
if(!i.getCarvingSupport().supportsSurface())
|
||||||
|
{
|
||||||
|
o.remove(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public KList<IrisObjectPlacement> getCarvingObjects()
|
||||||
|
{
|
||||||
|
return getCarveObjectsCache().aquire(() ->
|
||||||
|
{
|
||||||
|
KList<IrisObjectPlacement> o = getObjects().copy();
|
||||||
|
|
||||||
|
for(IrisObjectPlacement i : o.copy())
|
||||||
|
{
|
||||||
|
if(!i.getCarvingSupport().supportsCarving())
|
||||||
|
{
|
||||||
|
o.remove(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public Color getCachedColor()
|
public Color getCachedColor()
|
||||||
{
|
{
|
||||||
return cacheColor.aquire(() ->
|
return cacheColor.aquire(() ->
|
||||||
|
@ -100,11 +100,7 @@ public class IrisObjectPlacement
|
|||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("If set to true, objects will place in carvings (such as underground) or under an overhang.")
|
@Desc("If set to true, objects will place in carvings (such as underground) or under an overhang.")
|
||||||
private boolean allowInCarvings = true;
|
private CarvingMode carvingSupport = CarvingMode.SURFACE_ONLY;
|
||||||
|
|
||||||
@DontObfuscate
|
|
||||||
@Desc("If set to true, objects will place on carving ceilings instead of the floors. Make sure to rotate it upside down with rotate if need be as this option does NOT flip your object upside down.")
|
|
||||||
private boolean carvingCeiling = false;
|
|
||||||
|
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("If set to true, Iris will try to fill the insides of 'rooms' and 'pockets' where air should fit based off of raytrace checks. This prevents a village house placing in an area where a tree already exists, and instead replaces the parts of the tree where the interior of the structure is. \n\nThis operation does not affect warmed-up generation speed however it does slow down loading objects.")
|
@Desc("If set to true, Iris will try to fill the insides of 'rooms' and 'pockets' where air should fit based off of raytrace checks. This prevents a village house placing in an area where a tree already exists, and instead replaces the parts of the tree where the interior of the structure is. \n\nThis operation does not affect warmed-up generation speed however it does slow down loading objects.")
|
||||||
|
@ -79,7 +79,7 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("Objects define what schematics (iob files) iris will place in this region")
|
@Desc("Objects define what schematics (iob files) iris will place in this region")
|
||||||
private KList<IrisObjectPlacement> objects = new KList<IrisObjectPlacement>();
|
private KList<IrisObjectPlacement> objects = new KList<IrisObjectPlacement>();
|
||||||
|
|
||||||
@MinNumber(0)
|
@MinNumber(0)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The min shore height")
|
@Desc("The min shore height")
|
||||||
@ -229,6 +229,8 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
@Desc("Generate rivers in this region")
|
@Desc("Generate rivers in this region")
|
||||||
private double riverThickness = 0.1;
|
private double riverThickness = 0.1;
|
||||||
|
|
||||||
|
private final transient AtomicCache<KList<IrisObjectPlacement>> surfaceObjectsCache = new AtomicCache<>(true);
|
||||||
|
private final transient AtomicCache<KList<IrisObjectPlacement>> carveObjectsCache = new AtomicCache<>(true);
|
||||||
private final transient AtomicCache<KList<String>> cacheRidge = new AtomicCache<>();
|
private final transient AtomicCache<KList<String>> cacheRidge = new AtomicCache<>();
|
||||||
private final transient AtomicCache<KList<String>> cacheSpot = new AtomicCache<>();
|
private final transient AtomicCache<KList<String>> cacheSpot = new AtomicCache<>();
|
||||||
private final transient AtomicCache<CNG> shoreHeightGenerator = new AtomicCache<>();
|
private final transient AtomicCache<CNG> shoreHeightGenerator = new AtomicCache<>();
|
||||||
@ -242,6 +244,42 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
private final transient AtomicCache<CNG> riverGen = new AtomicCache<>();
|
private final transient AtomicCache<CNG> riverGen = new AtomicCache<>();
|
||||||
private final transient AtomicCache<CNG> riverChanceGen = new AtomicCache<>();
|
private final transient AtomicCache<CNG> riverChanceGen = new AtomicCache<>();
|
||||||
|
|
||||||
|
public KList<IrisObjectPlacement> getSurfaceObjects()
|
||||||
|
{
|
||||||
|
return getSurfaceObjectsCache().aquire(() ->
|
||||||
|
{
|
||||||
|
KList<IrisObjectPlacement> o = getObjects().copy();
|
||||||
|
|
||||||
|
for(IrisObjectPlacement i : o.copy())
|
||||||
|
{
|
||||||
|
if(!i.getCarvingSupport().supportsSurface())
|
||||||
|
{
|
||||||
|
o.remove(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public KList<IrisObjectPlacement> getCarvingObjects()
|
||||||
|
{
|
||||||
|
return getCarveObjectsCache().aquire(() ->
|
||||||
|
{
|
||||||
|
KList<IrisObjectPlacement> o = getObjects().copy();
|
||||||
|
|
||||||
|
for(IrisObjectPlacement i : o.copy())
|
||||||
|
{
|
||||||
|
if(!i.getCarvingSupport().supportsCarving())
|
||||||
|
{
|
||||||
|
o.remove(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return o;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isRiver(RNG rng, double x, double z)
|
public boolean isRiver(RNG rng, double x, double z)
|
||||||
{
|
{
|
||||||
if(!isRivers())
|
if(!isRivers())
|
||||||
@ -368,8 +406,15 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
|||||||
}
|
}
|
||||||
|
|
||||||
IrisBiome biome = (g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i);
|
IrisBiome biome = (g == null ? Iris.globaldata : g.getData()).getBiomeLoader().load(i);
|
||||||
b.put(biome.getLoadKey(), biome);
|
|
||||||
names.remove(i);
|
names.remove(i);
|
||||||
|
if(biome == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
names.add(biome.getCarvingBiome());
|
||||||
|
b.put(biome.getLoadKey(), biome);
|
||||||
names.addAll(biome.getChildren());
|
names.addAll(biome.getChildren());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,6 +100,11 @@ public class ResourceLoader<T extends IrisRegistrant>
|
|||||||
|
|
||||||
public T load(String name)
|
public T load(String name)
|
||||||
{
|
{
|
||||||
|
if(name.trim().isEmpty())
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
String key = name + "-" + cname;
|
String key = name + "-" + cname;
|
||||||
|
|
||||||
if(loadCache.containsKey(key))
|
if(loadCache.containsKey(key))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user