mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Move the built-in modules to the batch 2 API
Settings are read as SettingsStacks (dimension(), mostSpecific(), values()) and levels are com.volmit.config.Level. Chunk coordinates and centres come from the context's chunk helpers, surface heights from TerrainSampler.surfaceHeight, and resources from the world. Settings types register in one varargs call, and ObjectModule takes its log from setup instead of keeping a field.
This commit is contained in:
1 parent
c3d175d8de
commit
b15a41094d
86 files changed
+267
-391
No files matched your search
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.carve;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -30,7 +30,7 @@ import java.util.Set;
|
||||
|
||||
/** A biome's {@code carvingBiome}, written as the biome key: it registers that biome with the pack's layout and is not applied as a substitute under carvings. */
|
||||
@Desc("Registers the referenced biome with this pack's reachable biome set. It is NOT applied as a substitute under carvings; cave biomes come from the region's caveBiomes list.")
|
||||
@Feature(id = "iris:carve/biome", name = "Carving biome", key = "carvingBiome", root = "biome", targets = Target.BIOME)
|
||||
@Feature(id = "iris:carve/biome", name = "Carving biome", key = "carvingBiome", root = "biome", targets = Level.BIOME)
|
||||
public final class CarvingBiomeSettings implements IrisFeature, LinkedBiomes {
|
||||
@Ref(Reference.PACK_BIOME)
|
||||
@Desc("Registers the referenced biome with this pack's reachable biome set. It is NOT applied as a substitute under carvings; cave biomes come from the region's caveBiomes list.")
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package art.arcane.iris.builtin.carve;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** A dimension's {@code carvingEnabled}, written as the bare boolean. */
|
||||
@Desc("Enable or disable all carving for this dimension")
|
||||
@Feature(id = "iris:carve/enabled", name = "Carving enabled", key = "carvingEnabled", root = "enabled", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:carve/enabled", name = "Carving enabled", key = "carvingEnabled", root = "enabled", targets = Level.DIMENSION)
|
||||
public final class CarvingEnabledSettings implements IrisFeature {
|
||||
@Desc("Enable or disable all carving for this dimension")
|
||||
private boolean enabled = true;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.carve;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -36,7 +36,7 @@ import java.util.Set;
|
||||
* The biome of every enabled entry takes part in the pack's layout like any biome the dimension reaches.
|
||||
*/
|
||||
@Desc("Dimension-level cave biome carving overrides with absolute world Y ranges")
|
||||
@Feature(id = "iris:carve/bands", name = "Cave biome bands", key = "carving", root = "entries", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:carve/bands", name = "Cave biome bands", key = "carving", root = "entries", targets = Level.DIMENSION)
|
||||
public final class CarvingSettings implements IrisFeature, LinkedBiomes {
|
||||
@MinItems(1)
|
||||
@Desc("Dimension-level cave biome carving overrides with absolute world Y ranges")
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.carve;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -27,7 +27,7 @@ import com.volmit.config.MinNumber;
|
||||
|
||||
/** A biome's {@code caveMinDepthBelowSurface}, written as the bare number of blocks. */
|
||||
@Desc("Minimum depth below terrain surface required before this cave biome can be selected.")
|
||||
@Feature(id = "iris:carve/min-depth", name = "Cave minimum depth", key = "caveMinDepthBelowSurface", root = "depth", targets = Target.BIOME)
|
||||
@Feature(id = "iris:carve/min-depth", name = "Cave minimum depth", key = "caveMinDepthBelowSurface", root = "depth", targets = Level.BIOME)
|
||||
public final class CaveDepthSettings implements IrisFeature {
|
||||
@MinNumber(0)
|
||||
@MaxNumber(256)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.carve;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -27,7 +27,7 @@ import com.volmit.config.MinNumber;
|
||||
|
||||
/** A dimension's {@code caveLavaHeight}, written as the bare number. */
|
||||
@Desc("The subterranean fluid (cave lava) layer height, in engine-local Y where 0 is the bottom of the dimension, not world Y. With the default -64..320 height, 8 means world Y -56.")
|
||||
@Feature(id = "iris:carve/lava-height", name = "Cave lava height", key = "caveLavaHeight", root = "height", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:carve/lava-height", name = "Cave lava height", key = "caveLavaHeight", root = "height", targets = Level.DIMENSION)
|
||||
public final class CaveLavaHeightSettings implements IrisFeature {
|
||||
public static final int DEFAULT_HEIGHT = 8;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package art.arcane.iris.builtin.carve;
|
||||
|
||||
import art.arcane.iris.builtin.anchor.ObjectPlaceMode;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -43,7 +43,7 @@ import java.util.Optional;
|
||||
*/
|
||||
@Snippet("cave-profile")
|
||||
@Desc("Represents a configurable 3D cave profile.")
|
||||
@Feature(id = "iris:carve/profile", name = "Cave profile", key = "caveProfile", targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
@Feature(id = "iris:carve/profile", name = "Cave profile", key = "caveProfile", targets = {Level.DIMENSION, Level.REGION, Level.BIOME})
|
||||
public final class CaveProfile implements IrisFeature {
|
||||
@Desc("Enable profile-driven cave carving.")
|
||||
private boolean enabled = false;
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package art.arcane.iris.builtin.carve;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** A dimension's {@code upperDimensionCarving}, written as the bare boolean. */
|
||||
@Desc("When true, cave carving will cut through the upper dimension terrain. When false, the upper terrain is a solid untouched mass.")
|
||||
@Feature(id = "iris:carve/upper-dimension", name = "Upper dimension carving", key = "upperDimensionCarving", root = "enabled", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:carve/upper-dimension", name = "Upper dimension carving", key = "upperDimensionCarving", root = "enabled", targets = Level.DIMENSION)
|
||||
public final class UpperDimensionCarvingSettings implements IrisFeature {
|
||||
@Desc("When true, cave carving will cut through the upper dimension terrain. When false, the upper terrain is a solid untouched mass.")
|
||||
private boolean enabled = false;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.decorant;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
* {@link Decorator}.
|
||||
*/
|
||||
@Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)")
|
||||
@Feature(id = "iris:decorant", name = "Decorators", key = "decorators", root = "decorators", targets = Target.BIOME)
|
||||
@Feature(id = "iris:decorant", name = "Decorators", key = "decorators", root = "decorators", targets = Level.BIOME)
|
||||
public final class DecorantSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)")
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
*/
|
||||
package art.arcane.iris.builtin.decorant;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** Whether a dimension decorates at all, written as {@code "decorate": false}. A dimension without the key decorates. */
|
||||
@Desc("Generate decorations or not")
|
||||
@Feature(id = "iris:decorant/decorate", name = "Decorate", key = "decorate", root = "decorate", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:decorant/decorate", name = "Decorate", key = "decorate", root = "decorate", targets = Level.DIMENSION)
|
||||
public final class DecorateSettings implements IrisFeature {
|
||||
@Desc("Generate decorations or not")
|
||||
private boolean decorate = true;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.deposit;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -31,7 +31,7 @@ import java.util.List;
|
||||
* like {@link DepositGenerator}.
|
||||
*/
|
||||
@Desc("Ores and other deposits generated in every chunk where this applies")
|
||||
@Feature(id = "iris:deposit", name = "Deposits", key = "deposits", root = "generators", targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
@Feature(id = "iris:deposit", name = "Deposits", key = "deposits", root = "generators", targets = {Level.DIMENSION, Level.REGION, Level.BIOME})
|
||||
public final class DepositSettings implements IrisFeature {
|
||||
@Desc("Define deposit generators that this applies to chunks")
|
||||
private List<DepositGenerator> generators = List.of();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.deposit;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
@Desc("Deposit ore remap rules. Each entry declares a vertical band and a source->replacement block id map. Applied biome first, then region, then dimension; first matching rule wins.")
|
||||
@Feature(id = "iris:deposit/variants", name = "Deposit variants", key = "depositVariants", root = "variants",
|
||||
targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
targets = {Level.DIMENSION, Level.REGION, Level.BIOME})
|
||||
public final class DepositVariantSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Deposit ore remap rules. Each entry declares a vertical band and a source->replacement block id map. Applied biome first, then region, then dimension; first matching rule wins.")
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.deposit;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -27,7 +27,7 @@ import com.volmit.config.MinNumber;
|
||||
|
||||
/** A biome's {@code oreDepositFrequencyMultiplier}, written as the bare number. */
|
||||
@Desc("Multiplier applied to the frequency of every ore deposit whose center is inside this biome. A value of 0.4 keeps 40% of ore veins while leaving non-ore deposits unchanged.")
|
||||
@Feature(id = "iris:deposit/ore-frequency", name = "Ore deposit frequency", key = "oreDepositFrequencyMultiplier", root = "multiplier", targets = Target.BIOME)
|
||||
@Feature(id = "iris:deposit/ore-frequency", name = "Ore deposit frequency", key = "oreDepositFrequencyMultiplier", root = "multiplier", targets = Level.BIOME)
|
||||
public final class OreFrequencySettings implements IrisFeature {
|
||||
private static final double UNCHANGED = 1D;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.deposit;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -27,7 +27,7 @@ import com.volmit.config.MinNumber;
|
||||
|
||||
/** A biome's {@code oreDepositSizeMultiplier}, written as the bare number. */
|
||||
@Desc("Multiplier applied to the block count of every ore deposit whose center is inside this biome. Non-ore deposits are unchanged.")
|
||||
@Feature(id = "iris:deposit/ore-size", name = "Ore deposit size", key = "oreDepositSizeMultiplier", root = "multiplier", targets = Target.BIOME)
|
||||
@Feature(id = "iris:deposit/ore-size", name = "Ore deposit size", key = "oreDepositSizeMultiplier", root = "multiplier", targets = Level.BIOME)
|
||||
public final class OreSizeSettings implements IrisFeature {
|
||||
private static final double UNCHANGED = 1D;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package art.arcane.iris.builtin.floating;
|
||||
|
||||
import art.arcane.iris.builtin.carve.CarvingSettings;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -38,7 +38,7 @@ import java.util.Set;
|
||||
* pack's layout like any biome a dimension reaches.
|
||||
*/
|
||||
@Desc("Floating child biomes that procedurally generate above this biome's terrain. Each entry references a target biome whose layers, decorators, and objects drive the floating island's visual design, while the config here drives size, shape, altitude, rarity, and water level. Multiple entries are supported and selected by rarity per column unless mergeFloatingChildBiomes is enabled.")
|
||||
@Feature(id = "iris:floating/children", name = "Floating child biomes", key = "floatingChildBiomes", root = "children", targets = Target.BIOME)
|
||||
@Feature(id = "iris:floating/children", name = "Floating child biomes", key = "floatingChildBiomes", root = "children", targets = Level.BIOME)
|
||||
public final class FloatingChildSettings implements IrisFeature, LinkedBiomes {
|
||||
@MinItems(1)
|
||||
@Desc("Floating child biomes that procedurally generate above this biome's terrain. Each entry references a target biome whose layers, decorators, and objects drive the floating island's visual design, while the config here drives size, shape, altitude, rarity, and water level. Multiple entries are supported and selected by rarity per column unless mergeFloatingChildBiomes is enabled.")
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package art.arcane.iris.builtin.floating;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** A biome's {@code mergeFloatingChildBiomes}, written as the bare boolean. */
|
||||
@Desc("When true, every floating child entry is sampled independently and their solid masks are unioned, so multiple floating islands can stack, overlap, and collide instead of the picker choosing only one child per column.")
|
||||
@Feature(id = "iris:floating/merge", name = "Merge floating child biomes", key = "mergeFloatingChildBiomes", root = "merge", targets = Target.BIOME)
|
||||
@Feature(id = "iris:floating/merge", name = "Merge floating child biomes", key = "mergeFloatingChildBiomes", root = "merge", targets = Level.BIOME)
|
||||
public final class MergeFloatingChildrenSettings implements IrisFeature {
|
||||
@Desc("When true, every floating child entry is sampled independently and their solid masks are unioned, so multiple floating islands can stack, overlap, and collide instead of the picker choosing only one child per column.")
|
||||
private boolean merge = false;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.loot;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
* region and dimension.
|
||||
*/
|
||||
@Desc("Define custom block drops for this area")
|
||||
@Feature(id = "iris:loot/drops", name = "Block drops", key = "blockDrops", root = "drops", targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
@Feature(id = "iris:loot/drops", name = "Block drops", key = "blockDrops", root = "drops", targets = {Level.DIMENSION, Level.REGION, Level.BIOME})
|
||||
public final class BlockDropSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Define custom block drops for this area")
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.loot;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -37,7 +37,7 @@ import java.util.List;
|
||||
*/
|
||||
@Snippet("loot-registry")
|
||||
@Desc("Reference loot tables in this area")
|
||||
@Feature(id = "iris:loot", name = "Loot", key = "loot", targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
@Feature(id = "iris:loot", name = "Loot", key = "loot", targets = {Level.DIMENSION, Level.REGION, Level.BIOME})
|
||||
public final class LootSettings implements IrisFeature {
|
||||
public static final double MAX_MULTIPLIER = 16D;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package art.arcane.iris.builtin.objects;
|
||||
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.config.PackSettings;
|
||||
@@ -125,6 +125,6 @@ public interface ObjectHost {
|
||||
}
|
||||
|
||||
/** One region's or biome's declaration of settings. */
|
||||
record Declaration<F extends IrisFeature>(Target level, String key, F settings) {
|
||||
record Declaration<F extends IrisFeature>(Level level, String key, F settings) {
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.objects;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
* places those of its centre column's region and of that column's biome, and of the cave biome where it places in caves.
|
||||
*/
|
||||
@Desc("Objects define what schematics (iob files) iris will place here")
|
||||
@Feature(id = "iris:objects", name = "Objects", key = "objects", root = "objects", targets = {Target.REGION, Target.BIOME})
|
||||
@Feature(id = "iris:objects", name = "Objects", key = "objects", root = "objects", targets = {Level.REGION, Level.BIOME})
|
||||
public final class ObjectSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Objects define what schematics (iob files) iris will place here")
|
||||
|
||||
@@ -24,7 +24,7 @@ import art.arcane.iris.builtin.objects.formation.Formation;
|
||||
import art.arcane.iris.builtin.objects.fungi.Fungus;
|
||||
import art.arcane.iris.builtin.objects.ruin.Ruin;
|
||||
import art.arcane.iris.builtin.objects.tree.Tree;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -40,7 +40,7 @@ import java.util.List;
|
||||
*/
|
||||
@Snippet("procedural-objects")
|
||||
@Desc("Procedurally generated objects placed in a biome or region. Unlike the objects block (which loads iob files), these are generated from scratch at world-gen time.")
|
||||
@Feature(id = "iris:objects/procedural", name = "Procedural objects", key = "proceduralObjects", targets = {Target.REGION, Target.BIOME})
|
||||
@Feature(id = "iris:objects/procedural", name = "Procedural objects", key = "proceduralObjects", targets = {Level.REGION, Level.BIOME})
|
||||
public final class ProceduralObjectSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Procedurally generated trees.")
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package art.arcane.iris.builtin.objects;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** Whether a dimension refuses surface objects over carved openings, written as {@code "requireObjectSurfaceSupport": true}. */
|
||||
@Desc("Refuse to place surface objects and trees over carved surface openings.")
|
||||
@Feature(id = "iris:objects/surface-support", name = "Require surface support", key = "requireObjectSurfaceSupport", root = "require", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:objects/surface-support", name = "Require surface support", key = "requireObjectSurfaceSupport", root = "require", targets = Level.DIMENSION)
|
||||
public final class RequireSurfaceSupportSettings implements IrisFeature {
|
||||
private static final boolean DEFAULT_REQUIRED = true;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.objects;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -27,7 +27,7 @@ import com.volmit.config.MinNumber;
|
||||
|
||||
/** The least surface-support buffer a dimension gives its surface objects, written as {@code "objectSurfaceSupportBuffer": 2}. */
|
||||
@Desc("Minimum surface-support buffer, in blocks, applied to every surface object placement in this dimension. A placement may ask for more but never less.")
|
||||
@Feature(id = "iris:objects/surface-support-buffer", name = "Surface support buffer", key = "objectSurfaceSupportBuffer", root = "buffer", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:objects/surface-support-buffer", name = "Surface support buffer", key = "objectSurfaceSupportBuffer", root = "buffer", targets = Level.DIMENSION)
|
||||
public final class SurfaceSupportBufferSettings implements IrisFeature {
|
||||
private static final int DEFAULT_BUFFER_BLOCKS = 2;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.objects;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -28,7 +28,7 @@ import com.volmit.config.Snippet;
|
||||
/** Whether a dimension's saplings grow the trees of its object placements, written as {@code "treeSettings": {...}}. */
|
||||
@Snippet("tree-settings")
|
||||
@Desc("Tree growth override settings")
|
||||
@Feature(id = "iris:objects/trees", name = "Tree growth", key = "treeSettings", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:objects/trees", name = "Tree growth", key = "treeSettings", targets = Level.DIMENSION)
|
||||
public final class TreeGrowthSettings implements IrisFeature {
|
||||
@Required
|
||||
@Desc("Turn replacing on and off")
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package art.arcane.iris.builtin.objects;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** Whether the objects placed in the terrain stacked above ignore placement restrictions, written as {@code "upperObjectsForcePlace": true}. */
|
||||
@Desc("When true, upper-dimension objects force-place regardless of placement restrictions (slope, underwater, clamp, collisions, carving). Normal dimension objects always place first; upper objects place second and may clip or occlude lower-dimension placements when this is enabled.")
|
||||
@Feature(id = "iris:objects/upper-force", name = "Force upper dimension objects", key = "upperObjectsForcePlace", root = "force", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:objects/upper-force", name = "Force upper dimension objects", key = "upperObjectsForcePlace", root = "force", targets = Level.DIMENSION)
|
||||
public final class UpperObjectsForceSettings implements IrisFeature {
|
||||
@Desc("When true, upper-dimension objects force-place regardless of placement restrictions (slope, underwater, clamp, collisions, carving). Normal dimension objects always place first; upper objects place second and may clip or occlude lower-dimension placements when this is enabled.")
|
||||
private boolean force = false;
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package art.arcane.iris.builtin.objects;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** Whether the objects of a dimension are also placed in the terrain stacked above it, written as {@code "upperDimensionObjects": true}. */
|
||||
@Desc("When true, objects from the mantle (structures, trees, etc.) can be placed in the upper dimension terrain zone. When false, the upper terrain is protected from object placement.")
|
||||
@Feature(id = "iris:objects/upper", name = "Upper dimension objects", key = "upperDimensionObjects", root = "enabled", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:objects/upper", name = "Upper dimension objects", key = "upperDimensionObjects", root = "enabled", targets = Level.DIMENSION)
|
||||
public final class UpperObjectsSettings implements IrisFeature {
|
||||
@Desc("When true, objects from the mantle (structures, trees, etc.) can be placed in the upper dimension terrain zone. When false, the upper terrain is protected from object placement.")
|
||||
private boolean enabled = false;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.post;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -28,7 +28,7 @@ import com.volmit.config.Feature;
|
||||
* whatever it says, so it is declared to keep the key valid in packs.
|
||||
*/
|
||||
@Desc("Use post processing or not")
|
||||
@Feature(id = "iris:post/enabled", name = "Post processing", key = "postProcessing", root = "enabled", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:post/enabled", name = "Post processing", key = "postProcessing", root = "enabled", targets = Level.DIMENSION)
|
||||
public final class PostProcessingSettings implements IrisFeature {
|
||||
public static final boolean DEFAULT_ENABLED = true;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.post;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -27,7 +27,7 @@ import com.volmit.config.Feature;
|
||||
* Whether post processing adds slabs on steps in a dimension, written as {@code "postProcessingSlabs": false}. A dimension without the key adds them.
|
||||
*/
|
||||
@Desc("Add slabs in post processing")
|
||||
@Feature(id = "iris:post/slabs", name = "Post processing slabs", key = "postProcessingSlabs", root = "enabled", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:post/slabs", name = "Post processing slabs", key = "postProcessingSlabs", root = "enabled", targets = Level.DIMENSION)
|
||||
public final class PostProcessingSlabsSettings implements IrisFeature {
|
||||
public static final boolean DEFAULT_ENABLED = true;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.post;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -27,7 +27,7 @@ import com.volmit.config.Feature;
|
||||
* Whether post processing paints walls on steep faces in a dimension, written as {@code "postProcessingWalls": false}. A dimension without the key paints them.
|
||||
*/
|
||||
@Desc("Add painted walls in post processing")
|
||||
@Feature(id = "iris:post/walls", name = "Post processing walls", key = "postProcessingWalls", root = "enabled", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:post/walls", name = "Post processing walls", key = "postProcessingWalls", root = "enabled", targets = Level.DIMENSION)
|
||||
public final class PostProcessingWallsSettings implements IrisFeature {
|
||||
public static final boolean DEFAULT_ENABLED = true;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.spawn;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -32,7 +32,7 @@ import java.util.List;
|
||||
* {@link AmbientEffect}s. They play around every player in the area.
|
||||
*/
|
||||
@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.")
|
||||
@Feature(id = "iris:spawn/effects", name = "Effects", key = "effects", root = "effects", targets = {Target.REGION, Target.BIOME})
|
||||
@Feature(id = "iris:spawn/effects", name = "Effects", key = "effects", root = "effects", targets = {Level.REGION, Level.BIOME})
|
||||
public final class EffectSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Effects are ambient effects such as potion effects, random sounds, or even particles around each player.")
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.spawn;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
* {@link Spawner}s. A chunk may fire the spawners of its dimension, region and biome.
|
||||
*/
|
||||
@Desc("Entity spawners that fire in this area")
|
||||
@Feature(id = "iris:spawn", name = "Entity spawners", key = "entitySpawners", root = "spawners", targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
@Feature(id = "iris:spawn", name = "Entity spawners", key = "entitySpawners", root = "spawners", targets = {Level.DIMENSION, Level.REGION, Level.BIOME})
|
||||
public final class SpawnerSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@ResourceRef(Spawner.class)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.structure;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
@Desc("Iris structure placements of this dimension, region or biome: where and how often its structures start.")
|
||||
@Feature(id = "iris:structure/placements", name = "Structure placements", key = "structures", root = "placements",
|
||||
targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
targets = {Level.DIMENSION, Level.REGION, Level.BIOME})
|
||||
public final class StructurePlacementSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Iris structure placements, each independent of the others.")
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.structure;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -38,7 +38,7 @@ import java.util.List;
|
||||
* platform's own definitions. IrisApi types only.
|
||||
*/
|
||||
@Desc("Controls native vanilla, mod, and ingested datapack structure generation for this dimension. Every registered structure generates through its native placement unless its key matches 'disabled', equals a key in 'disabledExact', or a viable dimension-level Iris placement explicitly replaces its source. Family matching uses namespace, slash, or underscore boundaries, while exact matching compares normalized complete keys only. Run '/iris structure list <dimension>' to dump every valid key. Only affects newly generated chunks and is separate from Iris structure placements.")
|
||||
@Feature(id = "iris:structure", name = "Structures", key = "importedStructures", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:structure", name = "Structures", key = "importedStructures", targets = Level.DIMENSION)
|
||||
public final class StructureSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Ref(Reference.STRUCTURE_PREFIX)
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
*/
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** Whether a dimension has a layer of bedrock at its bottom, written as {@code "bedrock": false}. A dimension without the key has it. */
|
||||
@Desc("Should bedrock be generated or not.")
|
||||
@Feature(id = "iris:terrain/bedrock", name = "Bedrock", key = "bedrock", root = "bedrock", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:terrain/bedrock", name = "Bedrock", key = "bedrock", root = "bedrock", targets = Level.DIMENSION)
|
||||
public final class BedrockSettings implements IrisFeature {
|
||||
@Desc("Should bedrock be generated or not.")
|
||||
private boolean bedrock = true;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
* The layers of material on the ceilings of caves in a biome, written as {@code "caveCeilingLayers": [...]}, the list of layers.
|
||||
*/
|
||||
@Desc("Layers of materials placed on cave ceilings in this biome, indexed upward from the ceiling surface. Must not have more entries than layers, whose height generators it reuses. Omitting this leaves cave ceilings unchanged.")
|
||||
@Feature(id = "iris:terrain/cave-ceiling-layers", name = "Cave ceiling layers", key = "caveCeilingLayers", root = "layers", targets = Target.BIOME)
|
||||
@Feature(id = "iris:terrain/cave-ceiling-layers", name = "Cave ceiling layers", key = "caveCeilingLayers", root = "layers", targets = Level.BIOME)
|
||||
public final class CaveCeilingLayersSettings implements IrisFeature {
|
||||
@Desc("Layers of materials placed on cave ceilings in this biome, indexed upward from the ceiling surface. Must not have more entries than layers, whose height generators it reuses. Omitting this leaves cave ceilings unchanged.")
|
||||
private List<PaletteLayer> layers = List.of();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -26,7 +26,7 @@ import com.volmit.config.MinNumber;
|
||||
|
||||
/** How many barrier blocks a dimension puts between layers when it explodes its biome palettes, written as {@code "explodeBiomePaletteSize": 3}. */
|
||||
@Desc("Customize the palette height explosion")
|
||||
@Feature(id = "iris:terrain/explode-palette-size", name = "Explode biome palette size", key = "explodeBiomePaletteSize", root = "size", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:terrain/explode-palette-size", name = "Explode biome palette size", key = "explodeBiomePaletteSize", root = "size", targets = Level.DIMENSION)
|
||||
public final class ExplodeBiomePaletteSizeSettings implements IrisFeature {
|
||||
public static final int DEFAULT_SIZE = 3;
|
||||
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
*/
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** Whether a dimension puts barrier blocks between the layers of its biomes to show them apart, written as {@code "explodeBiomePalettes": true}. */
|
||||
@Desc("Vertically split up the biome palettes with barrier blocks in between to visualize them. The gap size comes from explodeBiomePaletteSize.")
|
||||
@Feature(id = "iris:terrain/explode-palettes", name = "Explode biome palettes", key = "explodeBiomePalettes", root = "explode", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:terrain/explode-palettes", name = "Explode biome palettes", key = "explodeBiomePalettes", root = "explode", targets = Level.DIMENSION)
|
||||
public final class ExplodeBiomePalettesSettings implements IrisFeature {
|
||||
@Desc("Vertically split up the biome palettes with barrier blocks in between to visualize them. The gap size comes from explodeBiomePaletteSize.")
|
||||
private boolean explode = false;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.block.BlockSpec;
|
||||
import com.volmit.block.PaletteSpec;
|
||||
@@ -31,7 +31,7 @@ import java.util.List;
|
||||
* The blocks that fill ocean columns and cave aquifers of a dimension, written as {@code "fluidPalette": {...}}, a palette. A dimension without the key is water.
|
||||
*/
|
||||
@Desc("The dimension fluid block palette used for ocean columns and cave aquifers.")
|
||||
@Feature(id = "iris:terrain/fluid-palette", name = "Fluid palette", key = "fluidPalette", root = "palette", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:terrain/fluid-palette", name = "Fluid palette", key = "fluidPalette", root = "palette", targets = Level.DIMENSION)
|
||||
public final class FluidPaletteSettings implements IrisFeature {
|
||||
private static final String DEFAULT_BLOCK = "water";
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -28,7 +28,7 @@ import com.volmit.config.Feature;
|
||||
* material. Written as the bare boolean.
|
||||
*/
|
||||
@Desc("When true, every ore block the generator would place (terrain ores, deposits, ores inside objects) is replaced with its base material such as stone, deepslate or netherrack, so drop-control plugins like HiddenOre can manage ore rewards themselves")
|
||||
@Feature(id = "iris:terrain/hide-ores", name = "Hide ores", key = "hideOresForHiddenOre", root = "hide", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:terrain/hide-ores", name = "Hide ores", key = "hideOresForHiddenOre", root = "hide", targets = Level.DIMENSION)
|
||||
public final class HideOresSettings implements IrisFeature {
|
||||
@Desc("When true, every ore block the generator would place (terrain ores, deposits, ores inside objects) is replaced with its base material such as stone, deepslate or netherrack, so drop-control plugins like HiddenOre can manage ore rewards themselves")
|
||||
private boolean hide = false;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
* that declares none gets one layer of grass, so the settings class default is what a biome without the key has.
|
||||
*/
|
||||
@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.")
|
||||
@Feature(id = "iris:terrain/layers", name = "Layers", key = "layers", root = "layers", targets = Target.BIOME)
|
||||
@Feature(id = "iris:terrain/layers", name = "Layers", key = "layers", root = "layers", targets = Level.BIOME)
|
||||
public final class LayersSettings implements IrisFeature {
|
||||
@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 List<PaletteLayer> layers = List.of(new PaletteLayer());
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** How many layers a locked biome iterates below the surface, written as {@code "lockLayersMax": 7}. A biome without the key iterates seven. */
|
||||
@Desc("The max layers to iterate below the surface for locked layer biomes (mesa).")
|
||||
@Feature(id = "iris:terrain/lock-layers-max", name = "Lock layers max", key = "lockLayersMax", root = "layers", targets = Target.BIOME)
|
||||
@Feature(id = "iris:terrain/lock-layers-max", name = "Lock layers max", key = "lockLayersMax", root = "layers", targets = Level.BIOME)
|
||||
public final class LockLayersMaxSettings implements IrisFeature {
|
||||
public static final int DEFAULT_LAYERS = 7;
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
|
||||
/** Whether a biome's layers are locked to its highest possible height, written as {@code "lockLayers": true}. A biome without the key is not locked. */
|
||||
@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.")
|
||||
@Feature(id = "iris:terrain/lock-layers", name = "Lock layers", key = "lockLayers", root = "locked", targets = Target.BIOME)
|
||||
@Feature(id = "iris:terrain/lock-layers", name = "Lock layers", key = "lockLayers", root = "locked", targets = Level.BIOME)
|
||||
public final class LockLayersSettings implements IrisFeature {
|
||||
@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 locked = false;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
* like {@link OreGenerator}.
|
||||
*/
|
||||
@Desc("Collection of ores to be generated")
|
||||
@Feature(id = "iris:terrain/ores", name = "Ores", key = "ores", root = "generators", targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
|
||||
@Feature(id = "iris:terrain/ores", name = "Ores", key = "ores", root = "generators", targets = {Level.DIMENSION, Level.REGION, Level.BIOME})
|
||||
public final class OreSettings implements IrisFeature {
|
||||
@MinItems(1)
|
||||
@Desc("Collection of ores to be generated")
|
||||
|
||||
@@ -18,9 +18,6 @@
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/** Whether a dimension separates the layers of its biomes with barrier blocks to show them apart, and how many barriers it puts between them. */
|
||||
public record PaletteExplosion(boolean exploded, int size) {
|
||||
@@ -28,14 +25,10 @@ public record PaletteExplosion(boolean exploded, int size) {
|
||||
|
||||
/** What the dimension at the column of {@code settings} declares. */
|
||||
public static PaletteExplosion of(FeatureSettings settings, int worldX, int worldZ) {
|
||||
boolean exploded = dimensionValue(settings.at(ExplodeBiomePalettesSettings.class, worldX, worldZ), ExplodeBiomePalettesSettings::explode, false);
|
||||
int size = dimensionValue(settings.at(ExplodeBiomePaletteSizeSettings.class, worldX, worldZ), ExplodeBiomePaletteSizeSettings::size,
|
||||
ExplodeBiomePaletteSizeSettings.DEFAULT_SIZE);
|
||||
boolean exploded = settings.at(ExplodeBiomePalettesSettings.class, worldX, worldZ).dimension()
|
||||
.map(ExplodeBiomePalettesSettings::explode).orElse(false);
|
||||
int size = settings.at(ExplodeBiomePaletteSizeSettings.class, worldX, worldZ).dimension()
|
||||
.map(ExplodeBiomePaletteSizeSettings::size).orElse(ExplodeBiomePaletteSizeSettings.DEFAULT_SIZE);
|
||||
return new PaletteExplosion(exploded, size);
|
||||
}
|
||||
|
||||
private static <S extends com.volmit.IrisFeature, V> V dimensionValue(List<Entry<S>> entries, java.util.function.Function<S, V> read, V fallback) {
|
||||
return entries.stream().filter(entry -> entry.level() == com.volmit.FeatureAttachment.Target.DIMENSION).findFirst()
|
||||
.map(entry -> read.apply(entry.value())).orElse(fallback);
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.block.BlockSpec;
|
||||
import com.volmit.block.PaletteSpec;
|
||||
@@ -31,7 +31,7 @@ import java.util.List;
|
||||
* The blocks that fill terrain below the layers of a dimension, written as {@code "rockPalette": {...}}, a palette. A dimension without the key is stone.
|
||||
*/
|
||||
@Desc("The palette of blocks for 'stone'")
|
||||
@Feature(id = "iris:terrain/rock-palette", name = "Rock palette", key = "rockPalette", root = "palette", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:terrain/rock-palette", name = "Rock palette", key = "rockPalette", root = "palette", targets = Level.DIMENSION)
|
||||
public final class RockPaletteSettings implements IrisFeature {
|
||||
private static final String DEFAULT_BLOCK = "stone";
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
* The layers of material filling the water column of a sea biome, written as {@code "seaLayers": [...]}, the list of layers.
|
||||
*/
|
||||
@Desc("Layers of materials filling the water column of sea biomes, indexed downward from the water surface. Anything below the last layer is filled with the dimension fluid palette, not stone.")
|
||||
@Feature(id = "iris:terrain/sea-layers", name = "Sea layers", key = "seaLayers", root = "layers", targets = Target.BIOME)
|
||||
@Feature(id = "iris:terrain/sea-layers", name = "Sea layers", key = "seaLayers", root = "layers", targets = Level.BIOME)
|
||||
public final class SeaLayersSettings implements IrisFeature {
|
||||
@Desc("Layers of materials filling the water column of sea biomes, indexed downward from the water surface. Anything below the last layer is filled with the dimension fluid palette, not stone.")
|
||||
private List<PaletteLayer> layers = List.of();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -27,7 +27,7 @@ import com.volmit.config.Feature;
|
||||
* The slab post processing places on steps in a biome, written as {@code "slab": {...}}, one layer. A biome without the key has no slab.
|
||||
*/
|
||||
@Desc("The default slab if iris decides to place a slab in this biome. Default is no slab.")
|
||||
@Feature(id = "iris:terrain/slab", name = "Slab", key = "slab", root = "layer", targets = Target.BIOME)
|
||||
@Feature(id = "iris:terrain/slab", name = "Slab", key = "slab", root = "layer", targets = Level.BIOME)
|
||||
public final class SlabSettings implements IrisFeature {
|
||||
@Desc("The default slab if iris decides to place a slab in this biome. Default is no slab.")
|
||||
private PaletteLayer layer = PaletteLayer.withoutBlocks();
|
||||
|
||||
@@ -20,10 +20,9 @@ package art.arcane.iris.builtin.terrain;
|
||||
import art.arcane.iris.builtin.IrisSeed;
|
||||
import art.arcane.volmlib.util.cache.AtomicCache;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.block.PaletteSpec;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.SettingsStack;
|
||||
import com.volmit.noise.NoiseSampler;
|
||||
import com.volmit.resource.PackResources;
|
||||
import com.volmit.world.PackWorld;
|
||||
@@ -112,20 +111,16 @@ public final class TerrainPalettes {
|
||||
|
||||
long seedOffset = upper.key().hashCode();
|
||||
RNG rng = new RNG(complexSeed ^ seedOffset);
|
||||
List<Entry<RockPaletteSettings>> declared = upper.settings().at(RockPaletteSettings.class, (int) x, (int) z);
|
||||
SettingsStack<RockPaletteSettings> declared = upper.settings().at(RockPaletteSettings.class, (int) x, (int) z);
|
||||
return columns(rockPalette(declared), rng.nextParallelRNG(ROCK_SIGNATURE), upper.resources());
|
||||
}
|
||||
|
||||
private static PaletteSpec rockPalette(List<Entry<RockPaletteSettings>> declared) {
|
||||
return dimensionLevel(declared).map(Entry::value).orElseGet(RockPaletteSettings::new).palette();
|
||||
private static PaletteSpec rockPalette(SettingsStack<RockPaletteSettings> declared) {
|
||||
return declared.dimension().orElseGet(RockPaletteSettings::new).palette();
|
||||
}
|
||||
|
||||
private static PaletteSpec fluidPalette(List<Entry<FluidPaletteSettings>> declared) {
|
||||
return dimensionLevel(declared).map(Entry::value).orElseGet(FluidPaletteSettings::new).palette();
|
||||
}
|
||||
|
||||
private static <S extends com.volmit.IrisFeature> java.util.Optional<Entry<S>> dimensionLevel(List<Entry<S>> declared) {
|
||||
return declared.stream().filter(entry -> entry.level() == Target.DIMENSION).findFirst();
|
||||
private static PaletteSpec fluidPalette(SettingsStack<FluidPaletteSettings> declared) {
|
||||
return declared.dimension().orElseGet(FluidPaletteSettings::new).palette();
|
||||
}
|
||||
|
||||
/** The palette's blocks over the columns, picked by its noise: the noise at a column, from 0 to 1, is how far down the weighted list the block is. */
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.terrain;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -28,7 +28,7 @@ import com.volmit.config.Feature;
|
||||
* A biome without the key has no wall.
|
||||
*/
|
||||
@Desc("The default wall if iris decides to place a wall higher than 2 blocks (steep hills or possibly cliffs)")
|
||||
@Feature(id = "iris:terrain/wall", name = "Wall", key = "wall", root = "layer", targets = Target.BIOME)
|
||||
@Feature(id = "iris:terrain/wall", name = "Wall", key = "wall", root = "layer", targets = Level.BIOME)
|
||||
public final class WallSettings implements IrisFeature {
|
||||
@Desc("The default wall if iris decides to place a wall higher than 2 blocks (steep hills or possibly cliffs)")
|
||||
private PaletteLayer layer = PaletteLayer.withoutBlocks();
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package art.arcane.iris.builtin.vanillafeatures;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.Desc;
|
||||
import com.volmit.config.Feature;
|
||||
@@ -34,7 +34,7 @@ import java.util.List;
|
||||
* decoration steps it leaves out. IrisApi types only.
|
||||
*/
|
||||
@Desc("Controls native vanilla, mod, and ingested datapack PLACED FEATURE generation for this dimension. Placed features are ores, trees, plants, springs, geodes and every other decoration entry a biome declares. This is OFF by default: with 'enabled' false Iris generates exactly the terrain it always has and no native feature runs. With it true, every placed feature the biome's vanilla derivative declares runs over Iris terrain, in vanilla step order, on the same worldgen thread vanilla uses. Carvers are never imported - Iris has no NoiseGeneratorSettings, so there is nothing for a carver to carve against. Family matching on 'disabled' uses namespace, slash, or underscore boundaries, so 'minecraft:ore' covers every vanilla ore feature without matching unrelated names.")
|
||||
@Feature(id = "iris:vanilla-features", name = "Vanilla features", key = "importedFeatures", targets = Target.DIMENSION)
|
||||
@Feature(id = "iris:vanilla-features", name = "Vanilla features", key = "importedFeatures", targets = Level.DIMENSION)
|
||||
public final class ImportedFeaturesSettings implements IrisFeature {
|
||||
@Desc("Master switch. False (the default) means no native placed feature generates and chunk output is identical to a pack without this block at all. True runs the vanilla decoration feature pass over Iris terrain.")
|
||||
private boolean enabled = false;
|
||||
|
||||
@@ -47,7 +47,6 @@ import com.volmit.world.TerrainSampler;
|
||||
*/
|
||||
public final class DecorantModule implements IrisModule, ModuleLifecycle {
|
||||
private static final String VERSION = "built-in";
|
||||
private static final int CHUNK_CENTRE = 7;
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
@@ -59,8 +58,7 @@ public final class DecorantModule implements IrisModule, ModuleLifecycle {
|
||||
// Ordering only: iris:matter ships in the built-ins jar, which a pack may not have.
|
||||
setup.stages().define(IrisStages.Decorant.DECORATE).softAfter(IrisStages.Matter.INSERT).run(DecorantModule::decorate);
|
||||
var registry = setup.registry();
|
||||
registry.registerSettings(DecorantSettings.class);
|
||||
registry.registerSettings(DecorateSettings.class);
|
||||
registry.registerSettings(DecorantSettings.class, DecorateSettings.class);
|
||||
registry.registerLifecycle(this);
|
||||
}
|
||||
|
||||
@@ -78,8 +76,8 @@ public final class DecorantModule implements IrisModule, ModuleLifecycle {
|
||||
|
||||
/** A dimension decorates unless it says {@code decorate: false}. */
|
||||
private static boolean decorates(ChunkStageContext context) {
|
||||
return context.settings().at(DecorateSettings.class, context.originX() + CHUNK_CENTRE, context.originZ() + CHUNK_CENTRE).stream()
|
||||
.allMatch(entry -> entry.value().decorate());
|
||||
return context.settings().at(DecorateSettings.class, context.centreX(), context.centreZ()).dimension()
|
||||
.map(DecorateSettings::decorate).orElse(true);
|
||||
}
|
||||
|
||||
/** Decorates the 16 x 16 columns of the chunk whose first block is {@code x}, {@code z}, a biome's decorators on the surface its blocks left. */
|
||||
@@ -102,7 +100,7 @@ public final class DecorantModule implements IrisModule, ModuleLifecycle {
|
||||
if (!decorators.hasDecorators(biome)) {
|
||||
continue;
|
||||
}
|
||||
int height = (int) Math.round(terrain.surfaceY(realX, realZ));
|
||||
int height = terrain.surfaceHeight(realX, realZ);
|
||||
|
||||
if (height >= 0 && height < fluidHeight && scene.isSolid(output.get(i, height, j))
|
||||
&& height + 1 < output.getHeight() && scene.isWater(output.get(i, height + 1, j))) {
|
||||
|
||||
@@ -20,13 +20,13 @@ package art.arcane.iris.engine.actuator;
|
||||
import art.arcane.iris.builtin.IrisSeed;
|
||||
import art.arcane.iris.builtin.terrain.OreSettings;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.config.SettingsStack;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.world.PackWorld;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.function.LongSupplier;
|
||||
|
||||
/**
|
||||
@@ -55,15 +55,15 @@ final class OreWarmUp {
|
||||
void warm() {
|
||||
LongSupplier seeds = () -> root.nextParallelRNG(warmed++).getSeed();
|
||||
|
||||
List<Entry<OreSettings>> declared = world.settings().declared(OreSettings.class);
|
||||
warmLevel(declared, Target.BIOME, seeds);
|
||||
warmLevel(declared, Target.REGION, seeds);
|
||||
warmLevel(declared, Target.DIMENSION, seeds);
|
||||
SettingsStack<OreSettings> declared = world.settings().declared(OreSettings.class);
|
||||
warmLevel(declared, Level.BIOME, seeds);
|
||||
warmLevel(declared, Level.REGION, seeds);
|
||||
warmLevel(declared, Level.DIMENSION, seeds);
|
||||
}
|
||||
|
||||
/** The ores of every owner at {@code level}, ordered by the key of the biome, region or dimension that declares them. */
|
||||
private void warmLevel(List<Entry<OreSettings>> declared, Target level, LongSupplier seeds) {
|
||||
declared.stream()
|
||||
private void warmLevel(SettingsStack<OreSettings> declared, Level level, LongSupplier seeds) {
|
||||
declared.entries().stream()
|
||||
.filter(entry -> entry.level() == level)
|
||||
.sorted(Comparator.comparing((Entry<OreSettings> entry) -> key(entry.source())))
|
||||
.forEach(entry -> ores.of(entry.value()).warm(seeds));
|
||||
|
||||
@@ -59,20 +59,10 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
|
||||
public void setup(ModuleSetup setup) {
|
||||
setup.stages().define(IrisStages.Terrain.SHAPE).run(TerrainModule::shape);
|
||||
var registry = setup.registry();
|
||||
registry.registerSettings(LayersSettings.class);
|
||||
registry.registerSettings(SeaLayersSettings.class);
|
||||
registry.registerSettings(CaveCeilingLayersSettings.class);
|
||||
registry.registerSettings(SlabSettings.class);
|
||||
registry.registerSettings(WallSettings.class);
|
||||
registry.registerSettings(LockLayersSettings.class);
|
||||
registry.registerSettings(LockLayersMaxSettings.class);
|
||||
registry.registerSettings(RockPaletteSettings.class);
|
||||
registry.registerSettings(FluidPaletteSettings.class);
|
||||
registry.registerSettings(OreSettings.class);
|
||||
registry.registerSettings(HideOresSettings.class);
|
||||
registry.registerSettings(BedrockSettings.class);
|
||||
registry.registerSettings(ExplodeBiomePalettesSettings.class);
|
||||
registry.registerSettings(ExplodeBiomePaletteSizeSettings.class);
|
||||
registry.registerSettings(LayersSettings.class, SeaLayersSettings.class, CaveCeilingLayersSettings.class, SlabSettings.class,
|
||||
WallSettings.class, LockLayersSettings.class, LockLayersMaxSettings.class, RockPaletteSettings.class, FluidPaletteSettings.class,
|
||||
OreSettings.class, HideOresSettings.class, BedrockSettings.class, ExplodeBiomePalettesSettings.class,
|
||||
ExplodeBiomePaletteSizeSettings.class);
|
||||
registry.registerLifecycle(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,11 +29,11 @@ import art.arcane.iris.builtin.terrain.PaletteExplosion;
|
||||
import art.arcane.iris.builtin.terrain.TerrainPalettes;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.config.SettingsStack;
|
||||
import com.volmit.hunk.Hunk;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.stage.ChunkStageContext;
|
||||
@@ -41,15 +41,12 @@ import com.volmit.world.PackWorld;
|
||||
import com.volmit.world.TerrainSampler;
|
||||
import com.volmit.world.UpperDimension;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
import java.util.function.Function;
|
||||
|
||||
/** What shaping terrain keeps for one world: the terrain stream's random and the palettes, layers and ores the columns are filled from. */
|
||||
final class TerrainShaper {
|
||||
private static final BlockState BEDROCK = new BlockState("minecraft:bedrock");
|
||||
private static final int CHUNK_CENTRE = 7;
|
||||
|
||||
private final TerrainPalettes palettes;
|
||||
private final BiomeLayers layers;
|
||||
@@ -70,8 +67,8 @@ final class TerrainShaper {
|
||||
this.layers = layers;
|
||||
this.ores = ores;
|
||||
this.rng = new RNG(IrisSeed.TERRAIN.of(world));
|
||||
this.levelsBelowTheDimensionDeclareOres = world.settings().declared(OreSettings.class).stream()
|
||||
.anyMatch(entry -> entry.level() != Target.DIMENSION);
|
||||
this.levelsBelowTheDimensionDeclareOres = world.settings().declared(OreSettings.class).entries().stream()
|
||||
.anyMatch(entry -> entry.level() != Level.DIMENSION);
|
||||
}
|
||||
|
||||
/** Fills the 16 x 16 columns of the chunk, one slice along x at a time. */
|
||||
@@ -91,7 +88,7 @@ final class TerrainShaper {
|
||||
|
||||
for (int zf = 0; zf < chunkDepth; zf++) {
|
||||
int realZ = zf + chunk.originZ;
|
||||
int he = Math.min(chunkHeight, (int) Math.round(chunk.terrain.surfaceY(realX, realZ)));
|
||||
int he = Math.min(chunkHeight, chunk.terrain.surfaceHeight(realX, realZ));
|
||||
int hf = Math.max(chunk.clampedFluidHeight, he);
|
||||
if (hf < 0) {
|
||||
continue;
|
||||
@@ -238,7 +235,7 @@ final class TerrainShaper {
|
||||
}
|
||||
|
||||
private static <S extends IrisFeature> S biomeLevel(FeatureSettings settings, Class<S> type, int worldX, int worldZ) {
|
||||
return settings.at(type, worldX, worldZ).stream().filter(entry -> entry.level() == Target.BIOME).map(Entry::value).findFirst().orElse(null);
|
||||
return settings.at(type, worldX, worldZ).level(Level.BIOME).orElse(null);
|
||||
}
|
||||
|
||||
/** A block the palette has none of leaves the column as it is. */
|
||||
@@ -276,15 +273,15 @@ final class TerrainShaper {
|
||||
this.originX = context.originX();
|
||||
this.originZ = context.originZ();
|
||||
this.clampedFluidHeight = Math.min(blocks.getHeight(), terrain.fluidHeight());
|
||||
int centreX = originX + CHUNK_CENTRE;
|
||||
int centreZ = originZ + CHUNK_CENTRE;
|
||||
this.bedrockEnabled = dimensionValue(settings.at(BedrockSettings.class, centreX, centreZ), BedrockSettings::bedrock, true);
|
||||
this.hideOres = dimensionValue(settings.at(HideOresSettings.class, centreX, centreZ), HideOresSettings::hide, false);
|
||||
int centreX = context.centreX();
|
||||
int centreZ = context.centreZ();
|
||||
this.bedrockEnabled = settings.at(BedrockSettings.class, centreX, centreZ).dimension().map(BedrockSettings::bedrock).orElse(true);
|
||||
this.hideOres = settings.at(HideOresSettings.class, centreX, centreZ).dimension().map(HideOresSettings::hide).orElse(false);
|
||||
this.explosion = PaletteExplosion.of(settings, centreX, centreZ);
|
||||
this.slope = (x, z) -> terrain.column((int) x, (int) z).slope();
|
||||
this.upper = terrain.upperDimension();
|
||||
// Dimension-level ore lookups are chunk-invariant; resolving them per column paid the settings lookup times 256 per chunk for a constant.
|
||||
this.dimensionOres = hideOres ? ResolvedOres.NONE : ores.of(levelValue(settings.at(OreSettings.class, centreX, centreZ), Target.DIMENSION));
|
||||
this.dimensionOres = hideOres ? ResolvedOres.NONE : ores.of(settings.at(OreSettings.class, centreX, centreZ).dimension().orElse(null));
|
||||
}
|
||||
|
||||
/** What the upper dimension declares about exploded palettes: a setting of the dimension, so the same for every column of the chunk. */
|
||||
@@ -300,22 +297,8 @@ final class TerrainShaper {
|
||||
if (hideOres || !levelsBelowTheDimensionDeclareOres) {
|
||||
return ColumnOres.NONE;
|
||||
}
|
||||
List<Entry<OreSettings>> declared = settings.at(OreSettings.class, worldX, worldZ);
|
||||
return new ColumnOres(ores.of(levelValue(declared, Target.REGION)), ores.of(levelValue(declared, Target.BIOME)));
|
||||
SettingsStack<OreSettings> declared = settings.at(OreSettings.class, worldX, worldZ);
|
||||
return new ColumnOres(ores.of(declared.level(Level.REGION).orElse(null)), ores.of(declared.level(Level.BIOME).orElse(null)));
|
||||
}
|
||||
}
|
||||
|
||||
private static <S extends IrisFeature, V> V dimensionValue(List<Entry<S>> entries, Function<S, V> read, V fallback) {
|
||||
S declared = levelValue(entries, Target.DIMENSION);
|
||||
return declared == null ? fallback : read.apply(declared);
|
||||
}
|
||||
|
||||
private static <S extends IrisFeature> S levelValue(List<Entry<S>> entries, Target level) {
|
||||
for (Entry<S> entry : entries) {
|
||||
if (entry.level() == level) {
|
||||
return entry.value();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public final class BiomeDecorators {
|
||||
|
||||
/** The biome of the entry a column's settings gave, which is the column's surface biome; null when the biome declares nothing. */
|
||||
public static DecoratedBiome biomeOf(FeatureSettings settings, int worldX, int worldZ, com.volmit.world.BiomeKind kind) {
|
||||
List<Entry<DecorantSettings>> entries = settings.at(DecorantSettings.class, worldX, worldZ);
|
||||
List<Entry<DecorantSettings>> entries = settings.at(DecorantSettings.class, worldX, worldZ).entries();
|
||||
if (entries.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public final class BiomeDecorators {
|
||||
|
||||
/** Resolves every decorator of every biome the dimension reaches and builds its noise, so that generation finds them ready. */
|
||||
public void warm() {
|
||||
List<Entry<DecorantSettings>> declared = new ArrayList<>(world.settings().declared(DecorantSettings.class));
|
||||
List<Entry<DecorantSettings>> declared = new ArrayList<>(world.settings().declared(DecorantSettings.class).entries());
|
||||
declared.sort(Comparator.comparing(entry -> biomeKey(entry.source())));
|
||||
for (Entry<DecorantSettings> entry : declared) {
|
||||
DecoratedBiome biome = new DecoratedBiome(biomeKey(entry.source()), entry.value(), null);
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class DecorationScene {
|
||||
/** The chunk of {@code context}, decorated with the world's decorators. */
|
||||
public static DecorationScene of(ChunkStageContext context) {
|
||||
Mantle mantle = context.mantle();
|
||||
return new DecorationScene(context.hunk(BlockState.class), context.resources().blocks(), context.terrain(),
|
||||
return new DecorationScene(context.hunk(BlockState.class), context.world().resources().blocks(), context.terrain(),
|
||||
mantle == null ? null : mantle.blocks(), BiomeDecorators.of(context.world()), IrisSeed.COMPONENT.of(context.world()),
|
||||
context.log());
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public final class DecorationScene {
|
||||
|
||||
/** The height of the terrain at the column, rounded. */
|
||||
long roundedHeightAt(int worldX, int worldZ) {
|
||||
return Math.round(terrain.surfaceY(worldX, worldZ));
|
||||
return terrain.surfaceHeight(worldX, worldZ);
|
||||
}
|
||||
|
||||
/** The block a placement planned at the position, or air; positions the mantle does not cover read as air. */
|
||||
|
||||
@@ -22,7 +22,6 @@ import art.arcane.iris.builtin.RegistryKeyFamily;
|
||||
import art.arcane.iris.builtin.structure.StructureAdjustment;
|
||||
import art.arcane.iris.builtin.structure.StructureSetFrequency;
|
||||
import art.arcane.iris.builtin.structure.StructureSettings;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.PackSettings;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.vanilla.VanillaStructureSetup;
|
||||
@@ -46,8 +45,7 @@ public final class ImportedStructures {
|
||||
|
||||
/** The settings the dimension of {@code settings} declares, or the defaults when it declares none. */
|
||||
public static ImportedStructures of(PackSettings settings) {
|
||||
List<Entry<StructureSettings>> declared = settings.declared(StructureSettings.class);
|
||||
return new ImportedStructures(declared.isEmpty() ? new StructureSettings() : declared.getFirst().value());
|
||||
return new ImportedStructures(settings.declared(StructureSettings.class).dimension().orElseGet(StructureSettings::new));
|
||||
}
|
||||
|
||||
/** Whether the dimension disables the platform structure {@code key}, by family or by its exact key. */
|
||||
|
||||
+1
-4
@@ -20,13 +20,11 @@ package art.arcane.iris.engine.framework.vanillafeatures;
|
||||
|
||||
import art.arcane.iris.builtin.RegistryKeyFamily;
|
||||
import art.arcane.iris.builtin.vanillafeatures.ImportedFeaturesSettings;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.service.VanillaFeatures;
|
||||
import com.volmit.vanilla.DecorationStep;
|
||||
import com.volmit.world.PackWorld;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
@@ -61,7 +59,6 @@ public final class ImportedFeatures implements VanillaFeatures {
|
||||
}
|
||||
|
||||
private static ImportedFeaturesSettings settings(PackWorld world) {
|
||||
List<Entry<ImportedFeaturesSettings>> declared = world.settings().declared(ImportedFeaturesSettings.class);
|
||||
return declared.isEmpty() ? NONE : declared.getFirst().value();
|
||||
return world.settings().declared(ImportedFeaturesSettings.class).dimension().orElse(NONE);
|
||||
}
|
||||
}
|
||||
@@ -45,8 +45,7 @@ public final class LootModule implements IrisModule {
|
||||
@Override
|
||||
public void setup(ModuleSetup setup) {
|
||||
var registry = setup.registry();
|
||||
registry.registerSettings(LootSettings.class);
|
||||
registry.registerSettings(BlockDropSettings.class);
|
||||
registry.registerSettings(LootSettings.class, BlockDropSettings.class);
|
||||
registry.registerHeldType(ObjectLoot.class);
|
||||
registry.registerHeldType(ObjectVanillaLoot.class);
|
||||
LootResources.kinds().forEach(registry::registerResourceKind);
|
||||
|
||||
@@ -23,8 +23,8 @@ import art.arcane.iris.builtin.loot.LootEntry;
|
||||
import art.arcane.iris.builtin.loot.LootMode;
|
||||
import art.arcane.iris.builtin.loot.LootSettings;
|
||||
import art.arcane.iris.builtin.loot.LootTable;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.resource.PackResources;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.validation.Problem;
|
||||
@@ -70,7 +70,7 @@ public final class LootValidator implements Validator {
|
||||
private static List<Problem> checkReferences(ValidationContext pack) {
|
||||
Set<ResourceId> lootIds = Set.copyOf(pack.resources().ids(LootTable.class));
|
||||
List<Problem> problems = new ArrayList<>();
|
||||
List<Entry<LootSettings>> declared = new ArrayList<>(pack.settings().declared(LootSettings.class));
|
||||
List<Entry<LootSettings>> declared = new ArrayList<>(pack.settings().declared(LootSettings.class).entries());
|
||||
declared.sort(Comparator.comparing(Entry<LootSettings>::level).thenComparing(Entry::source));
|
||||
for (Entry<LootSettings> entry : declared) {
|
||||
String resourceKey = keyOf(entry);
|
||||
@@ -106,21 +106,21 @@ public final class LootValidator implements Validator {
|
||||
return path.substring(path.indexOf(LEVEL_FOLDER_SEPARATOR) + 1);
|
||||
}
|
||||
|
||||
private static String hostType(Target level) {
|
||||
private static String hostType(Level level) {
|
||||
return switch (level) {
|
||||
case DIMENSION -> "Dimension";
|
||||
case REGION -> "Region";
|
||||
case BIOME -> "Biome";
|
||||
case OBJECT_PLACEMENT -> "Resource";
|
||||
case PLACEMENT -> "Resource";
|
||||
};
|
||||
}
|
||||
|
||||
private static String folderOf(Target level) {
|
||||
private static String folderOf(Level level) {
|
||||
return switch (level) {
|
||||
case DIMENSION -> "dimensions";
|
||||
case REGION -> "regions";
|
||||
case BIOME -> "biomes";
|
||||
case OBJECT_PLACEMENT -> "placements";
|
||||
case PLACEMENT -> "placements";
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ final class CaveAnchors {
|
||||
if (known != null) {
|
||||
return known;
|
||||
}
|
||||
int surfaceY = (int) Math.round(terrain.surfaceY(x, z));
|
||||
int surfaceY = terrain.surfaceHeight(x, z);
|
||||
surfaceHeights.put(columnKey, surfaceY);
|
||||
return surfaceY;
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ public class CaveCarving {
|
||||
int worldX = baseX + localX;
|
||||
for (int localZ = 0; localZ < CHUNK_SIZE; localZ++) {
|
||||
int columnIndex = PowerOfTwoCoordinates.packLocal16(localX, localZ);
|
||||
scratch[columnIndex] = (int) Math.round(terrain.surfaceY(worldX, baseZ + localZ));
|
||||
scratch[columnIndex] = terrain.surfaceHeight(worldX, baseZ + localZ);
|
||||
}
|
||||
}
|
||||
return scratch;
|
||||
|
||||
@@ -38,10 +38,10 @@ import art.arcane.iris.builtin.objects.UpperObjectsForceSettings;
|
||||
import art.arcane.iris.builtin.objects.UpperObjectsSettings;
|
||||
import art.arcane.iris.engine.object.procedural.ResolvedProceduralObjects;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.ModuleLog;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.config.SettingsStack;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.stage.MantleStageContext;
|
||||
import com.volmit.world.TerrainSampler;
|
||||
@@ -55,8 +55,8 @@ import java.util.OptionalInt;
|
||||
* and its procedural objects, in that order, all drawing from the one random of the chunk.
|
||||
*/
|
||||
final class ChunkObjectPlacing {
|
||||
private static final int CENTER_OFFSET_BLOCKS = 8;
|
||||
private static final int CHUNK_SHIFT = 4;
|
||||
/** Objects read their chunk's settings at local 8, 8 as Iris always did, not at the API's centre column (local 7, 7): moving it would move objects. */
|
||||
private static final int OBJECT_COLUMN_OFFSET_BLOCKS = 8;
|
||||
private static final int CHUNK_WIDTH_BLOCKS = 16;
|
||||
private static final double CHANCE_JITTER = 0.005;
|
||||
private static final int[] CAVE_BIOME_SAMPLE_DEPTHS = {48, 80, 112};
|
||||
@@ -91,10 +91,10 @@ final class ChunkObjectPlacing {
|
||||
this.context = context;
|
||||
this.chunk = host.chunk();
|
||||
this.terrain = context.terrain();
|
||||
this.chunkX = context.originX() >> CHUNK_SHIFT;
|
||||
this.chunkZ = context.originZ() >> CHUNK_SHIFT;
|
||||
this.centerX = CENTER_OFFSET_BLOCKS + (chunkX << CHUNK_SHIFT);
|
||||
this.centerZ = CENTER_OFFSET_BLOCKS + (chunkZ << CHUNK_SHIFT);
|
||||
this.chunkX = context.chunkX();
|
||||
this.chunkZ = context.chunkZ();
|
||||
this.centerX = context.originX() + OBJECT_COLUMN_OFFSET_BLOCKS;
|
||||
this.centerZ = context.originZ() + OBJECT_COLUMN_OFFSET_BLOCKS;
|
||||
this.rng = host.chunkRandom(chunkX, chunkZ);
|
||||
this.traceRegen = Thread.currentThread().getName().startsWith(REGEN_THREAD_PREFIX) && host.debugging();
|
||||
this.golden = chunk.goldenDebug(chunkX, chunkZ);
|
||||
@@ -127,16 +127,12 @@ final class ChunkObjectPlacing {
|
||||
private Column readColumn() {
|
||||
ResourceId region = host.regionAt(centerX, centerZ);
|
||||
ResourceId surface = host.surfaceBiomeAt(centerX, centerZ);
|
||||
int surfaceY = surfaceY(centerX, centerZ);
|
||||
int surfaceY = terrain.surfaceHeight(centerX, centerZ);
|
||||
ResourceId cave = resolveCaveObjectBiome(surfaceY, surface);
|
||||
return new Column(region, surface, cave, surfaceY, objectsOf(cave, region, surface), proceduralOf(cave, region, surface),
|
||||
profilesOf(cave, region, surface));
|
||||
}
|
||||
|
||||
private int surfaceY(int x, int z) {
|
||||
return (int) Math.round(terrain.surfaceY(x, z));
|
||||
}
|
||||
|
||||
private ResourceId resolveCaveObjectBiome(int surfaceY, ResourceId surfaceBiome) {
|
||||
ResourceId legacy = caveBiomeAt(Math.max(1, surfaceY - LEGACY_CAVE_SAMPLE_DEPTH)).orElse(surfaceBiome);
|
||||
ResourceId ladderChoice = null;
|
||||
@@ -161,39 +157,37 @@ final class ChunkObjectPlacing {
|
||||
}
|
||||
|
||||
private ColumnObjects objectsOf(ResourceId cave, ResourceId region, ResourceId surface) {
|
||||
List<Entry<ObjectSettings>> entries = context.settings().at(ObjectSettings.class, centerX, centerZ);
|
||||
return new ColumnObjects(level(entries, Target.BIOME), caveSettings(cave, surface, entries, ObjectSettings.class), level(entries, Target.REGION));
|
||||
SettingsStack<ObjectSettings> declared = context.settings().at(ObjectSettings.class, centerX, centerZ);
|
||||
return new ColumnObjects(levelValue(declared, Level.BIOME), caveSettings(cave, surface, declared, ObjectSettings.class),
|
||||
levelValue(declared, Level.REGION));
|
||||
}
|
||||
|
||||
private ColumnProcedural proceduralOf(ResourceId cave, ResourceId region, ResourceId surface) {
|
||||
List<Entry<ProceduralObjectSettings>> entries = context.settings().at(ProceduralObjectSettings.class, centerX, centerZ);
|
||||
return new ColumnProcedural(level(entries, Target.BIOME),
|
||||
caveSettings(cave, surface, entries, ProceduralObjectSettings.class), level(entries, Target.REGION));
|
||||
SettingsStack<ProceduralObjectSettings> declared = context.settings().at(ProceduralObjectSettings.class, centerX, centerZ);
|
||||
return new ColumnProcedural(levelValue(declared, Level.BIOME),
|
||||
caveSettings(cave, surface, declared, ProceduralObjectSettings.class), levelValue(declared, Level.REGION));
|
||||
}
|
||||
|
||||
private ColumnProfiles profilesOf(ResourceId cave, ResourceId region, ResourceId surface) {
|
||||
List<Entry<CaveProfile>> entries = context.settings().at(CaveProfile.class, centerX, centerZ);
|
||||
return new ColumnProfiles(level(entries, Target.BIOME), caveSettings(cave, surface, entries, CaveProfile.class), level(entries, Target.REGION));
|
||||
SettingsStack<CaveProfile> declared = context.settings().at(CaveProfile.class, centerX, centerZ);
|
||||
return new ColumnProfiles(levelValue(declared, Level.BIOME), caveSettings(cave, surface, declared, CaveProfile.class),
|
||||
levelValue(declared, Level.REGION));
|
||||
}
|
||||
|
||||
private <F extends IrisFeature> F caveSettings(ResourceId cave, ResourceId surface, List<Entry<F>> entries, Class<F> type) {
|
||||
private <F extends IrisFeature> F caveSettings(ResourceId cave, ResourceId surface, SettingsStack<F> declared, Class<F> type) {
|
||||
if (cave.equals(surface)) {
|
||||
return level(entries, Target.BIOME);
|
||||
return levelValue(declared, Level.BIOME);
|
||||
}
|
||||
return host.biomeDeclaration(cave, type).orElse(null);
|
||||
}
|
||||
|
||||
private <F extends IrisFeature> F dimensionLevel(Class<F> type) {
|
||||
return level(context.settings().at(type, centerX, centerZ), Target.DIMENSION);
|
||||
return levelValue(context.settings().at(type, centerX, centerZ), Level.DIMENSION);
|
||||
}
|
||||
|
||||
private static <F extends IrisFeature> F level(List<Entry<F>> entries, Target level) {
|
||||
for (Entry<F> entry : entries) {
|
||||
if (entry.level() == level) {
|
||||
return entry.value();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
/** The value {@code level} declares, or null: the column records below hold null for a level that declares nothing. */
|
||||
private static <F extends IrisFeature> F levelValue(SettingsStack<F> declared, Level level) {
|
||||
return declared.level(level).orElse(null);
|
||||
}
|
||||
|
||||
private boolean dimensionRequiresSurfaceSupport() {
|
||||
@@ -288,8 +282,8 @@ final class ChunkObjectPlacing {
|
||||
}
|
||||
|
||||
private void placeObject(Tally tally, ObjectPlacement placement, String scope) {
|
||||
int blockX = chunkX << CHUNK_SHIFT;
|
||||
int blockZ = chunkZ << CHUNK_SHIFT;
|
||||
int blockX = context.originX();
|
||||
int blockZ = context.originZ();
|
||||
int density = host.density(placement, rng, blockX, blockZ);
|
||||
for (int i = 0; i < density; i++) {
|
||||
tally.attempts++;
|
||||
@@ -329,8 +323,8 @@ final class ChunkObjectPlacing {
|
||||
|
||||
private void placeCaveObject(Tally tally, ObjectPlacement placement, CaveProfile profile, String scope,
|
||||
ResourceId expectedCaveBiome, CaveAnchors anchors) {
|
||||
int minX = chunkX << CHUNK_SHIFT;
|
||||
int minZ = chunkZ << CHUNK_SHIFT;
|
||||
int minX = context.originX();
|
||||
int minZ = context.originZ();
|
||||
int density = host.density(placement, rng, minX, minZ);
|
||||
CaveAnchors.Search search = caves.searchFor(placement, profile);
|
||||
for (int i = 0; i < density; i++) {
|
||||
@@ -408,8 +402,8 @@ final class ChunkObjectPlacing {
|
||||
if (placements.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
int blockX = chunkX << CHUNK_SHIFT;
|
||||
int blockZ = chunkZ << CHUNK_SHIFT;
|
||||
int blockX = context.originX();
|
||||
int blockZ = context.originZ();
|
||||
CaveAnchors anchors = newAnchors();
|
||||
for (ProceduralPlacement placement : placements) {
|
||||
boolean chancePassed = passesProceduralChance(rng, placement.chance());
|
||||
@@ -521,8 +515,8 @@ final class ChunkObjectPlacing {
|
||||
}
|
||||
|
||||
private void placeUpperObject(ObjectPlacement placement, boolean forcePlace, String scope) {
|
||||
int minX = chunkX << CHUNK_SHIFT;
|
||||
int minZ = chunkZ << CHUNK_SHIFT;
|
||||
int minX = context.originX();
|
||||
int minZ = context.originZ();
|
||||
int density = host.density(placement, rng, minX, minZ);
|
||||
for (int i = 0; i < density; i++) {
|
||||
Optional<PlaceableObject> picked = host.pickScaled(placement, rng);
|
||||
|
||||
@@ -34,9 +34,9 @@ import art.arcane.iris.engine.object.terrain.floating.ResolvedFloatingChild;
|
||||
import art.arcane.volmlib.util.cache.CacheKey;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.ModuleLog;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.config.PackSettings;
|
||||
import com.volmit.mantle.BlockBox;
|
||||
import com.volmit.resource.ResourceId;
|
||||
@@ -60,7 +60,6 @@ import java.util.Set;
|
||||
public final class FloatingObjectPlacing {
|
||||
private static final int INVERTED_PICK_ATTEMPTS = 8;
|
||||
private static final long CHUNK_RANDOM_SALT = 0x0FA710BEL;
|
||||
private static final int CHUNK_SHIFT = 4;
|
||||
private static final int CHUNK_COLUMNS = 256;
|
||||
private static final int MIN_REACH_BLOCKS = 16;
|
||||
private static final int LARGE_REACH_WARNING_BLOCKS = 128;
|
||||
@@ -97,7 +96,7 @@ public final class FloatingObjectPlacing {
|
||||
int minZ = context.originZ();
|
||||
BlockBox bounds = context.terrain().bounds();
|
||||
int worldHeight = bounds.maxY() - bounds.minY();
|
||||
RNG chunkRng = new RNG(CacheKey.key(minX >> CHUNK_SHIFT, minZ >> CHUNK_SHIFT) + mantleSeed + CHUNK_RANDOM_SALT);
|
||||
RNG chunkRng = new RNG(CacheKey.key(context.chunkX(), context.chunkZ()) + mantleSeed + CHUNK_RANDOM_SALT);
|
||||
FloatingIslandSampleResolver samples = new FloatingIslandSampleResolver(world, worldHeight,
|
||||
new FloatingIslandBoundarySampler(host::surfaceBiome), log);
|
||||
|
||||
@@ -391,7 +390,7 @@ public final class FloatingObjectPlacing {
|
||||
int maxObjectExtent = MIN_REACH_BLOCKS;
|
||||
try {
|
||||
for (Entry<FloatingChildSettings> declared : settings.declared(FloatingChildSettings.class)) {
|
||||
if (declared.level() != Target.BIOME) {
|
||||
if (declared.level() != Level.BIOME) {
|
||||
continue;
|
||||
}
|
||||
ResourceId biome = biomeIdOf(declared.source());
|
||||
|
||||
@@ -22,7 +22,7 @@ import art.arcane.iris.builtin.objects.ObjectHost;
|
||||
import art.arcane.iris.builtin.objects.ObjectHost.Declaration;
|
||||
import art.arcane.iris.builtin.objects.ObjectPlacement;
|
||||
import art.arcane.iris.builtin.objects.ObjectSettings;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.service.ObjectsAt;
|
||||
import com.volmit.world.PackWorld;
|
||||
|
||||
@@ -48,7 +48,7 @@ public final class ObjectLocating implements ObjectsAt {
|
||||
if (!placesObject(declaration.settings().objects(), objectKey)) {
|
||||
continue;
|
||||
}
|
||||
(declaration.level() == Target.BIOME ? biomes : regions).add(declaration.key());
|
||||
(declaration.level() == Level.BIOME ? biomes : regions).add(declaration.key());
|
||||
}
|
||||
return new PlacedBy(biomes, regions);
|
||||
}
|
||||
|
||||
@@ -49,8 +49,6 @@ import com.volmit.world.PackWorld;
|
||||
public final class ObjectModule implements IrisModule, ModuleLifecycle {
|
||||
private static final String VERSION = "built-in";
|
||||
|
||||
private ModuleLog log;
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
return ModuleInfo.of("iris:objects", "Objects", VERSION);
|
||||
@@ -58,19 +56,16 @@ public final class ObjectModule implements IrisModule, ModuleLifecycle {
|
||||
|
||||
@Override
|
||||
public void setup(ModuleSetup setup) {
|
||||
log = setup.log();
|
||||
ModuleLog log = setup.log();
|
||||
// Ordering only: iris:carve ships in the built-ins jar, which a pack may not have.
|
||||
setup.stages().define(IrisStages.Objects.PLACE).softAfter(IrisStages.Carve.CAVES).reach(this::reach).run(ObjectModule::place);
|
||||
setup.stages().define(IrisStages.Objects.PLACE).softAfter(IrisStages.Carve.CAVES).reach(settings -> reach(settings, log))
|
||||
.run(ObjectModule::place);
|
||||
var registry = setup.registry();
|
||||
registry.registerService(ObjectsAt.class, new ObjectLocating());
|
||||
registry.registerService(SaplingGrowth.class, new TreeGrowing());
|
||||
registry.registerSettings(ObjectSettings.class);
|
||||
registry.registerSettings(ProceduralObjectSettings.class);
|
||||
registry.registerSettings(TreeGrowthSettings.class);
|
||||
registry.registerSettings(RequireSurfaceSupportSettings.class);
|
||||
registry.registerSettings(SurfaceSupportBufferSettings.class);
|
||||
registry.registerSettings(UpperObjectsSettings.class);
|
||||
registry.registerSettings(UpperObjectsForceSettings.class);
|
||||
registry.registerSettings(ObjectSettings.class, ProceduralObjectSettings.class, TreeGrowthSettings.class,
|
||||
RequireSurfaceSupportSettings.class, SurfaceSupportBufferSettings.class, UpperObjectsSettings.class,
|
||||
UpperObjectsForceSettings.class);
|
||||
registry.registerLifecycle(this);
|
||||
}
|
||||
|
||||
@@ -83,7 +78,7 @@ public final class ObjectModule implements IrisModule, ModuleLifecycle {
|
||||
ObjectPlacing.of(context.world()).place(context);
|
||||
}
|
||||
|
||||
private int reach(PackSettings settings) {
|
||||
private static int reach(PackSettings settings, ModuleLog log) {
|
||||
return new PlacementReach(ObjectHost.of(settings), log).ofPack(settings);
|
||||
}
|
||||
}
|
||||
@@ -23,15 +23,14 @@ import art.arcane.iris.builtin.objects.ObjectPlacement;
|
||||
import art.arcane.iris.builtin.objects.ObjectSettings;
|
||||
import art.arcane.iris.builtin.objects.PlaceableObject;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.ModuleLog;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.config.PackSettings;
|
||||
import com.volmit.config.SettingsStack;
|
||||
import com.volmit.stage.MantleStageContext;
|
||||
import com.volmit.world.PackWorld;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -44,6 +43,8 @@ public final class ObjectPlacing {
|
||||
private static final int CHUNK_CENTER_OFFSET_BLOCKS = 8;
|
||||
private static final int CHUNK_SHIFT = 4;
|
||||
private static final double CHANCE_JITTER = 0.005;
|
||||
/** A guess draws from the biome's objects before the region's, as placing does. */
|
||||
private static final Level[] GUESSED_LEVELS = {Level.BIOME, Level.REGION};
|
||||
|
||||
private final ObjectHost host;
|
||||
private final ModuleLog log;
|
||||
@@ -68,14 +69,10 @@ public final class ObjectPlacing {
|
||||
RNG rng = host.chunkRandom(chunkX, chunkZ);
|
||||
int centerX = (chunkX << CHUNK_SHIFT) + CHUNK_CENTER_OFFSET_BLOCKS;
|
||||
int centerZ = (chunkZ << CHUNK_SHIFT) + CHUNK_CENTER_OFFSET_BLOCKS;
|
||||
List<Entry<ObjectSettings>> entries = host.columnSettings().at(ObjectSettings.class, centerX, centerZ);
|
||||
SettingsStack<ObjectSettings> declared = host.columnSettings().at(ObjectSettings.class, centerX, centerZ);
|
||||
Set<String> keys = new HashSet<>();
|
||||
for (Target level : new Target[]{Target.BIOME, Target.REGION}) {
|
||||
for (Entry<ObjectSettings> entry : entries) {
|
||||
if (entry.level() == level) {
|
||||
guessFrom(entry.value(), rng, chunkX, chunkZ, keys);
|
||||
}
|
||||
}
|
||||
for (Level level : GUESSED_LEVELS) {
|
||||
declared.level(level).ifPresent(settings -> guessFrom(settings, rng, chunkX, chunkZ, keys));
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import art.arcane.iris.builtin.objects.ProceduralPlacement;
|
||||
import art.arcane.iris.builtin.IrisSeed;
|
||||
import art.arcane.iris.engine.object.procedural.ResolvedProceduralObjects;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.world.PackWorld;
|
||||
|
||||
import java.util.Comparator;
|
||||
@@ -41,6 +41,7 @@ import java.util.List;
|
||||
*/
|
||||
final class ObjectWarmUp {
|
||||
private static final long ROOT_SEED_SALT = 7777L;
|
||||
private static final Level[] WARMED_LEVELS = {Level.BIOME, Level.REGION};
|
||||
|
||||
private final ObjectHost host;
|
||||
private final RNG root;
|
||||
@@ -54,7 +55,7 @@ final class ObjectWarmUp {
|
||||
void warm() {
|
||||
List<Declaration<ObjectSettings>> placements = byKey(host.declarations(ObjectSettings.class));
|
||||
List<Declaration<ProceduralObjectSettings>> procedural = byKey(host.declarations(ProceduralObjectSettings.class));
|
||||
for (Target level : new Target[]{Target.BIOME, Target.REGION}) {
|
||||
for (Level level : WARMED_LEVELS) {
|
||||
for (Declaration<ObjectSettings> declaration : placements) {
|
||||
if (declaration.level() == level) {
|
||||
warmPlacements(declaration.settings().objects());
|
||||
|
||||
@@ -47,8 +47,7 @@ public final class StructureModule implements IrisModule {
|
||||
setup.stages().define(IrisStages.Structure.PLACE).softAfter(IrisStages.Objects.PLACE, IrisStages.Floating.OBJECTS)
|
||||
.reach(StructureModule::reach).run(StructureModule::place);
|
||||
var registry = setup.registry();
|
||||
registry.registerSettings(StructureSettings.class);
|
||||
registry.registerSettings(StructurePlacementSettings.class);
|
||||
registry.registerSettings(StructureSettings.class, StructurePlacementSettings.class);
|
||||
}
|
||||
|
||||
private static void place(MantleStageContext context) {
|
||||
|
||||
@@ -29,8 +29,6 @@ import art.arcane.iris.builtin.objects.TreeGrowthSettings;
|
||||
import art.arcane.iris.builtin.objects.TreeMode;
|
||||
import art.arcane.iris.builtin.objects.tree.Tree;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.placement.PlacedBlock;
|
||||
import com.volmit.resource.ResourceId;
|
||||
@@ -92,12 +90,7 @@ public final class TreeGrowing implements SaplingGrowth {
|
||||
}
|
||||
|
||||
private static TreeGrowthSettings treeGrowth(ObjectHost host, BlockPosition at) {
|
||||
for (Entry<TreeGrowthSettings> entry : host.columnSettings().at(TreeGrowthSettings.class, at.x(), at.z())) {
|
||||
if (entry.level() == Target.DIMENSION) {
|
||||
return entry.value();
|
||||
}
|
||||
}
|
||||
return new TreeGrowthSettings();
|
||||
return host.columnSettings().at(TreeGrowthSettings.class, at.x(), at.z()).dimension().orElseGet(TreeGrowthSettings::new);
|
||||
}
|
||||
|
||||
/** One placement, picked at random, of the tree placements that grow {@code sapling}'s species. */
|
||||
|
||||
@@ -57,7 +57,7 @@ final class BuiltInCaveDressing implements CaveDressing {
|
||||
this.layers = BiomeLayers.of(context.world());
|
||||
this.palettes = TerrainPalettes.of(context.world());
|
||||
this.settings = context.settings();
|
||||
this.blocks = context.resources().blocks();
|
||||
this.blocks = context.world().resources().blocks();
|
||||
this.explosion = PaletteExplosion.of(settings, context.originX(), context.originZ());
|
||||
this.slope = (x, z) -> terrain.column((int) x, (int) z).slope();
|
||||
this.scene = DecorationScene.of(context);
|
||||
|
||||
@@ -35,9 +35,7 @@ import com.volmit.IrisFeature;
|
||||
import com.volmit.IrisModule;
|
||||
import com.volmit.ModuleInfo;
|
||||
import com.volmit.ModuleSetup;
|
||||
import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.generation.ChunkContext;
|
||||
import com.volmit.hunk.Hunk;
|
||||
import com.volmit.block.BlockRegistry;
|
||||
import com.volmit.block.BlockState;
|
||||
@@ -61,9 +59,6 @@ public final class CarveModule implements IrisModule {
|
||||
private static final String VERSION = "built-in";
|
||||
/** Blended cave walls reach one block past the chunk. */
|
||||
private static final int CAVE_REACH_BLOCKS = 1;
|
||||
private static final int CHUNK_SHIFT = 4;
|
||||
/** The centre column of a chunk, where per-chunk settings are read. */
|
||||
private static final int CHUNK_CENTRE_BLOCKS = 7;
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
@@ -73,13 +68,8 @@ public final class CarveModule implements IrisModule {
|
||||
@Override
|
||||
public void setup(ModuleSetup setup) {
|
||||
var registry = setup.registry();
|
||||
registry.registerSettings(CaveProfile.class);
|
||||
registry.registerSettings(CarvingSettings.class);
|
||||
registry.registerSettings(CarvingEnabledSettings.class);
|
||||
registry.registerSettings(CarvingBiomeSettings.class);
|
||||
registry.registerSettings(CaveDepthSettings.class);
|
||||
registry.registerSettings(CaveLavaHeightSettings.class);
|
||||
registry.registerSettings(UpperDimensionCarvingSettings.class);
|
||||
registry.registerSettings(CaveProfile.class, CarvingSettings.class, CarvingEnabledSettings.class, CarvingBiomeSettings.class,
|
||||
CaveDepthSettings.class, CaveLavaHeightSettings.class, UpperDimensionCarvingSettings.class);
|
||||
registry.registerService(CaveBiomes.class, new CaveBiomeBands());
|
||||
|
||||
var graph = setup.stages();
|
||||
@@ -88,29 +78,27 @@ public final class CarveModule implements IrisModule {
|
||||
}
|
||||
|
||||
private static void planCaves(MantleStageContext context) {
|
||||
if (!carves(context.settings(), context.originX(), context.originZ())) {
|
||||
if (!carves(context)) {
|
||||
return;
|
||||
}
|
||||
MatterMantle mantle = MatterMantle.of(context.mantle());
|
||||
caveCarving(context.world(), context.terrain(), context.settings(), context.originX(), context.originZ())
|
||||
.carve(mantle, context.terrain(), context.originX() >> CHUNK_SHIFT, context.originZ() >> CHUNK_SHIFT);
|
||||
caveCarving(context).carve(mantle, context.terrain(), context.chunkX(), context.chunkZ());
|
||||
}
|
||||
|
||||
private static void applyCaves(ChunkStageContext context) {
|
||||
MatterMantle mantle = MatterMantle.of(context.mantle());
|
||||
Hunk<BlockState> blocks = context.hunk(BlockState.class);
|
||||
caveApplying(context.world(), context.terrain(), context.settings(), context.originX(), context.originZ())
|
||||
.apply(mantle, context.terrain(), context.originX() >> CHUNK_SHIFT, context.originZ() >> CHUNK_SHIFT, blocks, CaveDressing.of(context));
|
||||
caveApplying(context).apply(mantle, context.terrain(), context.chunkX(), context.chunkZ(), blocks, CaveDressing.of(context));
|
||||
}
|
||||
|
||||
private static CaveCarving caveCarving(PackWorld world, TerrainSampler terrain, FeatureSettings settings, int originX, int originZ) {
|
||||
return world.state(CaveCarving.class, generating -> new CaveCarving(generating, carveWorld(generating, terrain),
|
||||
upperDimensionCarving(settings, originX, originZ), fluidColumns(generating)));
|
||||
private static CaveCarving caveCarving(ChunkContext context) {
|
||||
return context.world().state(CaveCarving.class, generating -> new CaveCarving(generating, carveWorld(generating, context.terrain()),
|
||||
upperDimensionCarving(context), fluidColumns(generating)));
|
||||
}
|
||||
|
||||
private static CaveApplying caveApplying(PackWorld world, TerrainSampler terrain, FeatureSettings settings, int originX, int originZ) {
|
||||
return world.state(CaveApplying.class, generating -> new CaveApplying(generating, carveWorld(generating, terrain),
|
||||
upperDimensionCarving(settings, originX, originZ)));
|
||||
private static CaveApplying caveApplying(ChunkContext context) {
|
||||
return context.world().state(CaveApplying.class, generating -> new CaveApplying(generating, carveWorld(generating, context.terrain()),
|
||||
upperDimensionCarving(context)));
|
||||
}
|
||||
|
||||
/** The columns the dimension's fluid palette fills with a fluid. */
|
||||
@@ -130,26 +118,23 @@ public final class CarveModule implements IrisModule {
|
||||
world.minHeight());
|
||||
}
|
||||
|
||||
private static boolean upperDimensionCarving(FeatureSettings settings, int originX, int originZ) {
|
||||
return dimensionEntry(settings, UpperDimensionCarvingSettings.class, originX + CHUNK_CENTRE_BLOCKS, originZ + CHUNK_CENTRE_BLOCKS)
|
||||
.map(UpperDimensionCarvingSettings::enabled).orElse(false);
|
||||
private static boolean upperDimensionCarving(ChunkContext context) {
|
||||
return centreDimensionValue(context, UpperDimensionCarvingSettings.class).map(UpperDimensionCarvingSettings::enabled).orElse(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* A dimension turns carving off with {@code carvingEnabled}. Listing {@code CARVED} in {@code disabledComponents}
|
||||
* also does: Iris then skips this stage's mantle pass like any disabled component.
|
||||
*/
|
||||
private static boolean carves(FeatureSettings settings, int originX, int originZ) {
|
||||
return dimensionEntry(settings, CarvingEnabledSettings.class, originX + CHUNK_CENTRE_BLOCKS, originZ + CHUNK_CENTRE_BLOCKS)
|
||||
.map(CarvingEnabledSettings::enabled).orElse(true);
|
||||
private static boolean carves(ChunkContext context) {
|
||||
return centreDimensionValue(context, CarvingEnabledSettings.class).map(CarvingEnabledSettings::enabled).orElse(true);
|
||||
}
|
||||
|
||||
private static <F extends IrisFeature> Optional<F> dimensionEntry(FeatureSettings settings, Class<F> type, int x, int z) {
|
||||
return settings.at(type, x, z).stream().filter(entry -> entry.level() == Target.DIMENSION).map(Entry::value).findFirst();
|
||||
private static <F extends IrisFeature> Optional<F> centreDimensionValue(ChunkContext context, Class<F> type) {
|
||||
return context.settings().at(type, context.centreX(), context.centreZ()).dimension();
|
||||
}
|
||||
|
||||
private static <F extends IrisFeature, V> V dimensionSetting(PackWorld world, Class<F> type, Function<F, V> read, V fallback) {
|
||||
return world.settings().declared(type).stream().filter(entry -> entry.level() == Target.DIMENSION).map(Entry::value).map(read)
|
||||
.findFirst().orElse(fallback);
|
||||
return world.settings().declared(type).dimension().map(read).orElse(fallback);
|
||||
}
|
||||
}
|
||||
@@ -183,7 +183,7 @@ public class CaveApplying {
|
||||
int localZ = columnIndex & 15;
|
||||
int worldX = localX + chunkBlockX;
|
||||
int worldZ = localZ + chunkBlockZ;
|
||||
surfaceHeights[columnIndex] = (int) Math.round(terrain.surfaceY(worldX, worldZ));
|
||||
surfaceHeights[columnIndex] = terrain.surfaceHeight(worldX, worldZ);
|
||||
if (protectUpper) {
|
||||
upperSurfaceHeights[columnIndex] = terrain.upperDimensionY(worldX, worldZ).getAsInt();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ import java.util.List;
|
||||
*/
|
||||
public final class DepositModule implements IrisModule {
|
||||
private static final String VERSION = "built-in";
|
||||
private static final int CHUNK_CENTRE = 7;
|
||||
|
||||
@Override
|
||||
public ModuleInfo info() {
|
||||
@@ -51,9 +50,7 @@ public final class DepositModule implements IrisModule {
|
||||
@Override
|
||||
public void setup(ModuleSetup setup) {
|
||||
var registry = setup.registry();
|
||||
registry.registerSettings(DepositVariantSettings.class);
|
||||
registry.registerSettings(OreFrequencySettings.class);
|
||||
registry.registerSettings(OreSizeSettings.class);
|
||||
registry.registerSettings(DepositVariantSettings.class, OreFrequencySettings.class, OreSizeSettings.class);
|
||||
|
||||
setup.stages().define(IrisStages.Deposit.ORES)
|
||||
.when(DepositSettings.class)
|
||||
@@ -63,17 +60,17 @@ public final class DepositModule implements IrisModule {
|
||||
}
|
||||
|
||||
private static void place(ChunkStageContext context) {
|
||||
List<DepositGenerator> generators = generatorsAtCentre(context.settings(), context.originX(), context.originZ());
|
||||
List<DepositGenerator> generators = generatorsAt(context.settings(), context.centreX(), context.centreZ());
|
||||
if (generators.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
DepositPlacer.of(context.world()).generate(context, generators);
|
||||
}
|
||||
|
||||
/** Every level's generators at the centre column of the chunk whose first block is {@code originX}, {@code originZ}, in level order. */
|
||||
static List<DepositGenerator> generatorsAtCentre(FeatureSettings settings, int originX, int originZ) {
|
||||
return settings.at(DepositSettings.class, originX + CHUNK_CENTRE, originZ + CHUNK_CENTRE).stream()
|
||||
.flatMap(entry -> entry.value().generators().stream())
|
||||
/** Every level's generators at the column {@code x}, {@code z}, in level order. */
|
||||
static List<DepositGenerator> generatorsAt(FeatureSettings settings, int x, int z) {
|
||||
return settings.at(DepositSettings.class, x, z).values().stream()
|
||||
.flatMap(declared -> declared.generators().stream())
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
@@ -28,13 +28,13 @@ import art.arcane.iris.builtin.deposit.OreSizeSettings;
|
||||
import art.arcane.iris.engine.modifier.ResolvedDeposit.BiomeIdentity;
|
||||
import art.arcane.volmlib.util.math.IrisBlockVector;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.ModuleLog;
|
||||
import com.volmit.block.BlockRegistry;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.block.BlockTrait;
|
||||
import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.config.SettingsStack;
|
||||
import com.volmit.hunk.Hunk;
|
||||
import com.volmit.mantle.MantleLayer;
|
||||
import com.volmit.resource.PackResources;
|
||||
@@ -61,7 +61,6 @@ import java.util.function.Supplier;
|
||||
*/
|
||||
final class DepositPlacer {
|
||||
private static final double UNCHANGED_ORE_MULTIPLIER = 1D;
|
||||
private static final int CHUNK_SHIFT = 4;
|
||||
private static final int CHUNK_WIDTH = 16;
|
||||
private static final long CHUNK_X_SEED_FACTOR = 341873128712L;
|
||||
private static final long CHUNK_Z_SEED_FACTOR = 132897987541L;
|
||||
@@ -100,9 +99,7 @@ final class DepositPlacer {
|
||||
/** Runs {@code generators}, in order, on the chunk of {@code context}. */
|
||||
void generate(ChunkStageContext context, List<DepositGenerator> generators) {
|
||||
Placing placing = new Placing(context);
|
||||
int chunkX = context.originX() >> CHUNK_SHIFT;
|
||||
int chunkZ = context.originZ() >> CHUNK_SHIFT;
|
||||
long seed = chunkX * CHUNK_X_SEED_FACTOR + chunkZ * CHUNK_Z_SEED_FACTOR;
|
||||
long seed = context.chunkX() * CHUNK_X_SEED_FACTOR + context.chunkZ() * CHUNK_Z_SEED_FACTOR;
|
||||
long mask = 0;
|
||||
for (DepositGenerator generator : generators) {
|
||||
long finalSeed = seed * ++mask;
|
||||
@@ -294,7 +291,7 @@ final class DepositPlacer {
|
||||
if (!surfaceKnown) {
|
||||
for (int x = 0; x < CHUNK_WIDTH; x++) {
|
||||
for (int z = 0; z < CHUNK_WIDTH; z++) {
|
||||
surfaceHeights[x * CHUNK_WIDTH + z] = (int) Math.round(terrain.surfaceY(originX + x, originZ + z));
|
||||
surfaceHeights[x * CHUNK_WIDTH + z] = terrain.surfaceHeight(originX + x, originZ + z);
|
||||
}
|
||||
}
|
||||
surfaceKnown = true;
|
||||
@@ -318,19 +315,13 @@ final class DepositPlacer {
|
||||
}
|
||||
}
|
||||
|
||||
BlockState match = matchDepositVariant(levelSettings(Target.REGION, worldX, worldZ), ore, worldY);
|
||||
SettingsStack<DepositVariantSettings> declared = settings.at(DepositVariantSettings.class, worldX, worldZ);
|
||||
BlockState match = matchDepositVariant(declared.level(Level.REGION), ore, worldY);
|
||||
if (match != null) {
|
||||
return match;
|
||||
}
|
||||
|
||||
return matchDepositVariant(levelSettings(Target.DIMENSION, worldX, worldZ), ore, worldY);
|
||||
}
|
||||
|
||||
private Optional<DepositVariantSettings> levelSettings(Target level, int worldX, int worldZ) {
|
||||
return settings.at(DepositVariantSettings.class, worldX, worldZ).stream()
|
||||
.filter(entry -> entry.level() == level)
|
||||
.map(Entry::value)
|
||||
.findFirst();
|
||||
return matchDepositVariant(declared.dimension(), ore, worldY);
|
||||
}
|
||||
|
||||
private BlockState matchDepositVariant(Optional<DepositVariantSettings> owner, BlockState ore, int y) {
|
||||
|
||||
@@ -68,7 +68,6 @@ final class FloatingIslands {
|
||||
private static final int FIRST_LAYER_GENERATOR_SEED = 7235;
|
||||
private static final int MIN_PALETTE_DEPTH = 4;
|
||||
private static final int CHUNK_WIDTH = 16;
|
||||
private static final int CHUNK_CENTRE = 7;
|
||||
private static final BlockState BARRIER = new BlockState("minecraft:barrier");
|
||||
private static final BlockState FALLBACK_SOLID = new BlockState("minecraft:stone");
|
||||
private static final String DEFAULT_FLUID = "minecraft:water";
|
||||
@@ -449,9 +448,9 @@ final class FloatingIslands {
|
||||
this.originZ = context.originZ();
|
||||
this.output = context.hunk(BlockState.class);
|
||||
this.height = output.getHeight();
|
||||
this.blocks = context.resources().blocks();
|
||||
this.blocks = context.world().resources().blocks();
|
||||
this.settings = context.settings();
|
||||
this.explosion = PaletteExplosion.of(settings, originX + CHUNK_CENTRE, originZ + CHUNK_CENTRE);
|
||||
this.explosion = PaletteExplosion.of(settings, context.centreX(), context.centreZ());
|
||||
TerrainSampler terrain = context.terrain();
|
||||
this.slope = (x, z) -> terrain.column((int) x, (int) z).slope();
|
||||
this.boundarySampler = new FloatingIslandBoundarySampler(world.host()::surfaceBiome);
|
||||
|
||||
@@ -50,8 +50,7 @@ public final class FloatingModule implements IrisModule {
|
||||
public void setup(ModuleSetup setup) {
|
||||
log = setup.log();
|
||||
var registry = setup.registry();
|
||||
registry.registerSettings(FloatingChildSettings.class);
|
||||
registry.registerSettings(MergeFloatingChildrenSettings.class);
|
||||
registry.registerSettings(FloatingChildSettings.class, MergeFloatingChildrenSettings.class);
|
||||
|
||||
var graph = setup.stages();
|
||||
graph.define(IrisStages.Floating.OBJECTS).softAfter(IrisStages.Objects.PLACE).reach(this::objectReach)
|
||||
|
||||
@@ -44,7 +44,6 @@ import java.util.Map;
|
||||
public final class PerfectionModule implements IrisModule {
|
||||
private static final String VERSION = "built-in";
|
||||
private static final String HALF = "half";
|
||||
private static final int CENTER = 7;
|
||||
private static final BlockState AIR = new BlockState("minecraft:air");
|
||||
private static final Map<ResourceId, BlockState> ORE_BASES = oreBases();
|
||||
|
||||
@@ -63,7 +62,7 @@ public final class PerfectionModule implements IrisModule {
|
||||
if (hidesOres(context)) {
|
||||
hideOres(blocks, new IdentityHashMap<>());
|
||||
}
|
||||
Surfaces surfaces = new Surfaces(blocks, context.resources().blocks(), new IdentityHashMap<>());
|
||||
Surfaces surfaces = new Surfaces(blocks, context.world().resources().blocks(), new IdentityHashMap<>());
|
||||
boolean removed;
|
||||
do {
|
||||
removed = surfaces.removeUnsupportedDecorants();
|
||||
@@ -72,8 +71,8 @@ public final class PerfectionModule implements IrisModule {
|
||||
|
||||
/** The dimension's {@code hideOresForHiddenOre}, which every column of the chunk shares. */
|
||||
private static boolean hidesOres(ChunkStageContext context) {
|
||||
return context.settings().at(HideOresSettings.class, context.originX() + CENTER, context.originZ() + CENTER).stream()
|
||||
.anyMatch(entry -> entry.value().hide());
|
||||
return context.settings().at(HideOresSettings.class, context.centreX(), context.centreZ()).dimension()
|
||||
.map(HideOresSettings::hide).orElse(false);
|
||||
}
|
||||
|
||||
/** {@code hidden} remembers per state instance what it is hidden as, itself for a block that is no ore. */
|
||||
|
||||
@@ -38,9 +38,7 @@ public final class PostModule implements IrisModule {
|
||||
@Override
|
||||
public void setup(ModuleSetup setup) {
|
||||
var registry = setup.registry();
|
||||
registry.registerSettings(PostProcessingSettings.class);
|
||||
registry.registerSettings(PostProcessingSlabsSettings.class);
|
||||
registry.registerSettings(PostProcessingWallsSettings.class);
|
||||
registry.registerSettings(PostProcessingSettings.class, PostProcessingSlabsSettings.class, PostProcessingWallsSettings.class);
|
||||
// Ordering only: iris:carve ships in the built-ins jar, which a pack may not have.
|
||||
setup.stages().define(IrisStages.Post.SMOOTH).softAfter(IrisStages.Carve.APPLY).run(SurfaceSmoothing::smooth);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import com.volmit.block.BlockState;
|
||||
import com.volmit.block.BlockTrait;
|
||||
import com.volmit.hunk.Hunk;
|
||||
import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.stage.ChunkStageContext;
|
||||
import com.volmit.world.TerrainSampler;
|
||||
@@ -54,7 +53,6 @@ final class SurfaceSmoothing {
|
||||
private static final String SLAB_SUFFIX = "_slab";
|
||||
private static final String WATERLOGGED = "waterlogged";
|
||||
private static final String TRUE = "true";
|
||||
private static final int CENTER = 7;
|
||||
/** A biome without a wall or slab picks no block. */
|
||||
private static final PaletteLayer NO_LAYER = PaletteLayer.withoutBlocks();
|
||||
/** Walls and slabs are picked once per column: the first signature of a layer's noise. */
|
||||
@@ -79,7 +77,7 @@ final class SurfaceSmoothing {
|
||||
|
||||
private SurfaceSmoothing(ChunkStageContext context) {
|
||||
this.blocks = context.hunk(BlockState.class);
|
||||
this.registry = context.resources().blocks();
|
||||
this.registry = context.world().resources().blocks();
|
||||
this.terrain = context.terrain();
|
||||
this.settings = context.settings();
|
||||
this.layerBlocks = LayerBlocks.of(context.world());
|
||||
@@ -88,8 +86,8 @@ final class SurfaceSmoothing {
|
||||
this.originZ = context.originZ();
|
||||
this.planeWidth = blocks.getWidth() + 2;
|
||||
this.heights = heightPlane();
|
||||
this.walls = enabled(PostProcessingWallsSettings.class, PostProcessingWallsSettings::enabled, PostProcessingWallsSettings.DEFAULT_ENABLED);
|
||||
this.slabs = enabled(PostProcessingSlabsSettings.class, PostProcessingSlabsSettings::enabled, PostProcessingSlabsSettings.DEFAULT_ENABLED);
|
||||
this.walls = enabled(context, PostProcessingWallsSettings.class, PostProcessingWallsSettings::enabled, PostProcessingWallsSettings.DEFAULT_ENABLED);
|
||||
this.slabs = enabled(context, PostProcessingSlabsSettings.class, PostProcessingSlabsSettings::enabled, PostProcessingSlabsSettings.DEFAULT_ENABLED);
|
||||
this.fluidHeight = terrain.fluidHeight();
|
||||
}
|
||||
|
||||
@@ -112,15 +110,13 @@ final class SurfaceSmoothing {
|
||||
* corners are never read, so they are left unresolved.
|
||||
*/
|
||||
/** A switch of the dimension, which every column of the chunk shares. */
|
||||
private <S extends IrisFeature> boolean enabled(Class<S> type, Function<S, Boolean> enabled, boolean byDefault) {
|
||||
List<Entry<S>> entries = settings.at(type, originX + CENTER, originZ + CENTER);
|
||||
return entries.isEmpty() ? byDefault : enabled.apply(entries.getFirst().value());
|
||||
private static <S extends IrisFeature> boolean enabled(ChunkStageContext context, Class<S> type, Function<S, Boolean> enabled, boolean byDefault) {
|
||||
return context.settings().at(type, context.centreX(), context.centreZ()).dimension().map(enabled).orElse(byDefault);
|
||||
}
|
||||
|
||||
/** The biome layer of the column's surface biome that {@code type} holds, or none. */
|
||||
private <S extends IrisFeature> PaletteLayer biomeLayer(Class<S> type, Function<S, PaletteLayer> layer, int x, int z) {
|
||||
List<Entry<S>> entries = settings.at(type, x, z);
|
||||
return entries.isEmpty() ? NO_LAYER : layer.apply(entries.getLast().value());
|
||||
return settings.at(type, x, z).mostSpecific().map(layer).orElse(NO_LAYER);
|
||||
}
|
||||
|
||||
/** The layer's block at the position, picked with the world's post-processing random, or null when it has none. */
|
||||
@@ -146,7 +142,7 @@ final class SurfaceSmoothing {
|
||||
}
|
||||
|
||||
private int surfaceHeight(int x, int z) {
|
||||
return (int) Math.round(terrain.surfaceY(x, z));
|
||||
return terrain.surfaceHeight(x, z);
|
||||
}
|
||||
|
||||
private void post(int localX, int localZ) {
|
||||
|
||||
@@ -104,7 +104,7 @@ public final class BlocksModule implements IrisModule {
|
||||
if (!settings.edit().isEmpty()) {
|
||||
ObjectEdits.Edited edited = ObjectEdits.apply(settings.edit(), data, blockEntity, new RNG(context.random().nextLong()),
|
||||
offset.x() + placement.x(), offset.y() + anchorY, offset.z() + placement.z(),
|
||||
ResolvedReplaces.of(context, prepared.terrain()), placement);
|
||||
ResolvedReplaces.of(context), placement);
|
||||
data = edited.data();
|
||||
blockEntity = edited.blockEntity();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package art.arcane.iris.engine.object.placement;
|
||||
|
||||
import art.arcane.iris.builtin.blocks.ObjectReplace;
|
||||
import art.arcane.iris.builtin.placement.PlacementTerrain;
|
||||
import com.volmit.block.BlockRegistry;
|
||||
import com.volmit.stage.PlacementStageContext;
|
||||
|
||||
@@ -35,11 +34,8 @@ final class ResolvedReplaces {
|
||||
this.blocks = blocks;
|
||||
}
|
||||
|
||||
/** The replacements of the world {@code context} places in, or of the pack alone when the placement has no world. */
|
||||
static ResolvedReplaces of(PlacementStageContext context, PlacementTerrain terrain) {
|
||||
if (!terrain.hasWorld()) {
|
||||
return new ResolvedReplaces(context.resources().blocks());
|
||||
}
|
||||
/** The replacements of the world {@code context} places in. */
|
||||
static ResolvedReplaces of(PlacementStageContext context) {
|
||||
return context.world().state(ResolvedReplaces.class, world -> new ResolvedReplaces(world.resources().blocks()));
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ public final class StiltModule implements IrisModule {
|
||||
/** The block the settings' palette picks for this placement, the same for every column; null without a palette. */
|
||||
private BlockState paletteBlock(StiltSettings stilt) {
|
||||
return stilt.palette()
|
||||
.map(spec -> context.resources().blocks().palette(spec, rng.getSeed()))
|
||||
.map(spec -> context.world().resources().blocks().palette(spec, rng.getSeed()))
|
||||
.map(picker -> picker.at(placement.x(), anchorY, placement.z()))
|
||||
.orElse(null);
|
||||
}
|
||||
@@ -189,7 +189,7 @@ public final class StiltModule implements IrisModule {
|
||||
return state;
|
||||
}
|
||||
return ObjectEdits.apply(config.edit(), state, Optional.empty(), rng, offset.x() + placement.x(), offset.y() + anchorY,
|
||||
offset.z() + placement.z(), ResolvedReplaces.of(context, prepared.terrain()), placement).data();
|
||||
offset.z() + placement.z(), ResolvedReplaces.of(context), placement).data();
|
||||
}
|
||||
|
||||
private void growToSurface(BlockState state, BlockPosition offset, int x, int z) {
|
||||
|
||||
@@ -22,9 +22,7 @@ import art.arcane.iris.builtin.IrisSeed;
|
||||
import art.arcane.iris.builtin.carve.CarvingEntry;
|
||||
import art.arcane.iris.builtin.carve.CarvingSettings;
|
||||
import com.volmit.ModuleLog;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.Range;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.noise.NoiseSampler;
|
||||
import com.volmit.resource.PackResources;
|
||||
import com.volmit.world.PackBiome;
|
||||
@@ -72,13 +70,7 @@ public final class CarvingResolver {
|
||||
}
|
||||
|
||||
private static List<CarvingEntry> dimensionEntries(PackWorld world) {
|
||||
List<CarvingEntry> dimensionEntries = new ArrayList<>();
|
||||
for (Entry<CarvingSettings> entry : world.settings().declared(CarvingSettings.class)) {
|
||||
if (entry.level() == Target.DIMENSION) {
|
||||
dimensionEntries.addAll(entry.value().entries());
|
||||
}
|
||||
}
|
||||
return dimensionEntries;
|
||||
return world.settings().declared(CarvingSettings.class).dimension().map(CarvingSettings::entries).orElse(List.of());
|
||||
}
|
||||
|
||||
/** Every declared entry, enabled or not. */
|
||||
|
||||
@@ -18,9 +18,10 @@
|
||||
|
||||
package art.arcane.iris.engine.object.terrain.carving;
|
||||
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.Level;
|
||||
import com.volmit.config.SettingsStack;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.world.PackWorld;
|
||||
|
||||
@@ -46,19 +47,17 @@ public final class DeclaredByLevel<F extends IrisFeature> {
|
||||
}
|
||||
|
||||
public static <F extends IrisFeature> DeclaredByLevel<F> of(PackWorld world, Class<F> type) {
|
||||
F dimension = null;
|
||||
SettingsStack<F> declared = world.settings().declared(type);
|
||||
Map<ResourceId, F> regions = new HashMap<>();
|
||||
Map<ResourceId, F> biomes = new HashMap<>();
|
||||
for (Entry<F> entry : world.settings().declared(type)) {
|
||||
if (entry.level() == Target.DIMENSION) {
|
||||
dimension = entry.value();
|
||||
} else if (entry.level() == Target.REGION) {
|
||||
for (Entry<F> entry : declared) {
|
||||
if (entry.level() == Level.REGION) {
|
||||
regions.putIfAbsent(sampleId(entry.source()), entry.value());
|
||||
} else if (entry.level() == Target.BIOME) {
|
||||
} else if (entry.level() == Level.BIOME) {
|
||||
biomes.putIfAbsent(sampleId(entry.source()), entry.value());
|
||||
}
|
||||
}
|
||||
return new DeclaredByLevel<>(dimension, regions, biomes);
|
||||
return new DeclaredByLevel<>(declared.dimension().orElse(null), regions, biomes);
|
||||
}
|
||||
|
||||
/** The dimension's declaration; null when it declares none. */
|
||||
|
||||
@@ -29,8 +29,6 @@ import art.arcane.iris.builtin.floating.MergeFloatingChildrenSettings;
|
||||
import art.arcane.iris.builtin.objects.ObjectHost;
|
||||
import art.arcane.iris.builtin.objects.ObjectPlacement;
|
||||
import art.arcane.iris.builtin.objects.ObjectSettings;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.noise.NoiseFactory;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.world.PackWorld;
|
||||
@@ -78,10 +76,7 @@ public final class FloatingWorld {
|
||||
}
|
||||
|
||||
private static List<CarvingEntry> dimensionCarvingOf(PackWorld world) {
|
||||
return world.settings().declared(CarvingSettings.class).stream()
|
||||
.filter(entry -> entry.level() == Target.DIMENSION)
|
||||
.map(Entry::value)
|
||||
.findFirst()
|
||||
return world.settings().declared(CarvingSettings.class).dimension()
|
||||
.map(CarvingSettings::entries)
|
||||
.orElse(List.of());
|
||||
}
|
||||
|
||||
@@ -45,8 +45,7 @@ public final class SpawnModule implements IrisModule {
|
||||
@Override
|
||||
public void setup(ModuleSetup setup) {
|
||||
var registry = setup.registry();
|
||||
registry.registerSettings(SpawnerSettings.class);
|
||||
registry.registerSettings(EffectSettings.class);
|
||||
registry.registerSettings(SpawnerSettings.class, EffectSettings.class);
|
||||
registry.registerHeldType(PlacementMarker.class);
|
||||
SpawnResources.kinds().forEach(registry::registerResourceKind);
|
||||
registry.registerService(EntitySpawns.class, new EntitySpawning());
|
||||
|
||||
Reference in new issue
Block a user