diff --git a/README.md b/README.md
index d10d9dae6..ffcece855 100644
--- a/README.md
+++ b/README.md
@@ -39,8 +39,15 @@ objects are trees) and says which biomes and regions place an object (`ObjectLoc
them (`LootValidator`), and provides `Loot` (`LootGiving`: which tables a container draws from and the `ItemDrop`s a
table gives) and `BlockDrops` (`BlockDropping`). `iris:spawn` owns spawners, entities and markers (`SpawnResources`,
folders `spawners`, `entities`, `markers`) and provides `EntitySpawns` (`EntitySpawning`: what to spawn in a chunk or at
-a marker, as `EntitySpec`s; `EntityResolution` makes the entity's random choices). Iris's Bukkit code creates the items
-and entities from those values (`BukkitItemStacks`, `BukkitEntitySpawner`).
+a marker, as `EntitySpec`s; `EntityResolution` makes the entity's random choices) and `AmbientEffects` (`AmbientEffecting`:
+the effects due around a player, with their random values). Iris's Bukkit code creates the items and entities from those
+values (`BukkitItemStacks`, `BukkitEntitySpawner`, `BukkitAmbientEffects`); the modded adapters, which cannot name IrisApi
+types, ask through the host-typed `ContentServices`.
+The settings of both modules are `builtin.loot` and `builtin.spawn` types of IrisApi annotations only: `iris:loot` declares
+`loot` (object, also the shape of an entity's `loot`) and `blockDrops` (list) for dimensions, regions and biomes;
+`iris:spawn` declares `entitySpawners` (list of spawner keys) for the same and `effects` (list, `iris:spawn/effects`) for
+regions and biomes. The loot tables, spawners, entities and markers are plain module types too (`LootTable`, `Spawner`,
+`EntityDefinition`, `SpawnMarker`). `PlacementLoot` picks the table an object placement gives one of its chests.
`iris:decorant` keeps its per-world `Decorating` in the world's state store (`context.world().state(...)`); the other
built-ins still reach the same store through `IrisChunk.state(...)` / `engine.getGeneration().state(...)`.
@@ -49,8 +56,8 @@ only: `DepositSettings` holds `DepositGenerator`s (blocks as `BlockSpec`, its en
`art.arcane.iris.builtin.deposit`), and packs write `"deposits": [...]`, as they always have (`@Feature(key = "deposits", root = "generators")`: the key holds the one option's list). What needs Iris (resolving the
palette, ore checks, clump shapes per world seed) lives in the module's own code, `ResolvedDeposit`.
-Settings that live inside a class of Iris's own, such as an object placement's clamp, stilt, vacuum and edit settings, its slope condition,
-a cave profile, a floating child biome or a procedural coral, are module-owned classes too (`art.arcane.iris.builtin.validate`,
+Settings that live inside a class of Iris's own, such as an object placement's clamp, stilt, vacuum and edit settings, its slope condition
+or a procedural coral, are module-owned classes too (`art.arcane.iris.builtin.validate`,
`.stilt`, `.vacuum`, `.blocks`, `.prepare`, `.carve`, `.floating`, `.objects.*`). The module registers each with
`registry.registerHeldType(...)` so studio describes it from the module's own annotations; packs write the same JSON as before. Behaviour
that needs Iris (noise built from the styles, blocks resolved through the pack, baked object variants) lives in `Resolved*` classes beside the
@@ -64,6 +71,27 @@ seed is the world's decorator seed, its biome's key and its place in the biome's
them ahead of generation; `iris:terrain` and `iris:objects` warm their ore generators, placements and procedural
objects the same way.
+`iris:terrain` and `iris:post` own the fields that shape a column's blocks. Per biome: `layers`, `seaLayers`, `caveCeilingLayers` (lists of
+`PaletteLayer`, the old biome palette layer, in `art.arcane.iris.builtin.terrain`), `slab` and `wall` (one `PaletteLayer` each), `lockLayers` (a
+boolean) and `lockLayersMax` (a number). Per dimension: `rockPalette` and `fluidPalette` (a `PaletteSpec` each) in `art.arcane.iris.builtin.terrain`, and
+`postProcessing`, `postProcessingSlabs`, `postProcessingWalls` (booleans) in `art.arcane.iris.builtin.post`. A key a pack leaves out has the
+default Iris always had (one grass layer, no slab or wall, stone and water, post processing on). `ResolvedLayer` resolves one layer's blocks and noise
+for a pack, `BiomeLayers`, the world's state, keeps them and stacks a biome's layers into the blocks of a column, and `TerrainPalettes` is the world's
+rock and fluid as a block for every column; the terrain, cave, floating and post stages ask them. The slope limit of a layer, a decorator and an
+object placement is the one `SlopeClip`.
+
+Caves, floating islands and ores are settings of their modules too, written under the keys they always had. `iris:carve` owns
+`caveProfile` (dimension, region, biome; an object, or a `snippet/cave-profile/...` reference), `carving` (dimension; a list of bands) and
+`carvingEnabled` (dimension; a boolean), `carvingBiome` (biome; a biome key) and `caveMinDepthBelowSurface` (biome; a number). `iris:floating`
+owns `floatingChildBiomes` (biome; a list) and `mergeFloatingChildBiomes` (biome; a boolean). `iris:terrain` owns `ores` (dimension, region,
+biome; a list of generators) and `hideOresForHiddenOre` (dimension; a boolean); `iris:deposit` owns `depositVariants` (dimension, region, biome; a list)
+and `oreDepositFrequencyMultiplier` and `oreDepositSizeMultiplier` (biome; numbers). Behaviour that needs Iris lives in the `Resolved*` classes beside the
+workers: `ResolvedOre`/`ResolvedOres` (blocks and chance noise per world, `TerrainOres` the world's state), `ResolvedDepositVariant`,
+`ResolvedCarvingEntry`/`CarvingBands`/`CarvingResolver` (the band for a position) and `ResolvedFloatingChild`. The settings that name biomes
+(`carvingBiome`, a band's biome, a floating child's target and carving) implement `LinkedBiomes`, which is how Iris's biome tree and the biomes a
+dimension reaches learn of them without reading the settings classes; and `iris:carve` provides the `CaveBiomes` service
+(`CaveBiomeBands`), which Iris asks for the dimension's carving band at a position and for a biome's minimum cave depth.
+
Packs write each settings feature under the short key it declares: `deposits` (dimension, region, biome; a list), `decorators`
(biome; a list) and `importedStructures` (dimension; an object of `disabled`, `adjustments` and the rest). The feature ids
(`iris:deposit`, `iris:decorant`, `iris:structure`) stay the modules' identity in the stage graph and logs. A key is unique
@@ -104,7 +132,8 @@ Iris no longer compiles them in (`IrisModuleHost.generationModules()`), so a pac
`iris-builtins.jar` into its `modules` folder; the built-ins that order after their stages (`iris:floating`,
`iris:decorant`, `iris:custom`) only order, so a pack without the jar still loads.
-`art.arcane.iris.builtin` also holds the few facades only Iris's own built-ins use, interfaces Iris's worlds implement:
-`IrisSeed` (Iris's per-feature world seeds, so existing worlds generate the same) and, until wave 3a's settings moves
-land, `PendingSettings` (the dimension's `hideOresForHiddenOre`, `postProcessingWalls`, `postProcessingSlabs` and a
-biome's `wall` and `slab`, which agents C and T are turning into module settings; it is deleted at that merge).
+`art.arcane.iris.builtin` also holds what the compiled-in built-ins and the jar must share, because each sees its own copy of
+every other class: `IrisSeed` (Iris's per-feature world seeds, a facade Iris's worlds implement, so existing worlds generate the
+same) and `terrain.LayerBlocks` (the world's picks from the biomes' palette layers: terrain, caves and post pick from the same
+layers, and a layer's noise is built once per world by whichever asks first). `iris:post` reads its switches
+(`postProcessingWalls`, `postProcessingSlabs`) and the biome's `wall` and `slab` as module settings through its context.
\ No newline at end of file
diff --git a/source-patterns.txt b/source-patterns.txt
index 31bac204e..c42d04a72 100644
--- a/source-patterns.txt
+++ b/source-patterns.txt
@@ -1,5 +1,6 @@
art/arcane/iris/engine/actuator/**
art/arcane/iris/engine/decorator/**
+art/arcane/iris/engine/terrain/**
art/arcane/iris/engine/modifier/**
art/arcane/iris/engine/mantle/components/**
art/arcane/iris/engine/object/**
diff --git a/src/main/java/art/arcane/iris/builtin/PendingSettings.java b/src/main/java/art/arcane/iris/builtin/PendingSettings.java
deleted file mode 100644
index e9010b830..000000000
--- a/src/main/java/art/arcane/iris/builtin/PendingSettings.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Servers
- * Copyright (c) 2026 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package art.arcane.iris.builtin;
-
-import com.volmit.block.BlockState;
-import com.volmit.world.PackWorld;
-
-import java.util.Optional;
-
-/**
- * Transitional: settings Iris's built-in modules read that still live on Iris's dimension and biome classes while
- * wave 3a moves them into module settings, {@code hideOresForHiddenOre} (agent C) and {@code postProcessingWalls},
- * {@code postProcessingSlabs} and a biome's {@code wall} and {@code slab} (agent T). Iris's worlds implement it. When
- * those settings land, each method gives way to a read of its module setting and this type is deleted; nothing else
- * may use it.
- */
-public interface PendingSettings {
- /** The pending settings of {@code world}, which must be a world Iris generates. */
- static PendingSettings of(PackWorld world) {
- if (world instanceof PendingSettings pending) {
- return pending;
- }
- throw new IllegalArgumentException("Built-in modules generate Iris's own worlds, not " + world);
- }
-
- /** The dimension's {@code hideOresForHiddenOre}. */
- boolean hidesOres();
-
- /** The dimension's {@code postProcessingWalls}. */
- boolean postProcessingWalls();
-
- /** The dimension's {@code postProcessingSlabs}. */
- boolean postProcessingSlabs();
-
- /** The {@code wall} of the surface biome of the column at {@code x}, {@code z}; empty when its palette lists no block. */
- Optional wall(int x, int z);
-
- /** The {@code slab} of the surface biome of the column at {@code x}, {@code z}. */
- BiomeLayer slab(int x, int z);
-
- /** One of a biome's palette layers, picking as Iris always picked it, with the world's post-processing seed. */
- interface BiomeLayer {
- /** The block the layer picks at {@code x}, {@code y}, {@code z}; empty when none of its blocks exists. */
- Optional at(double x, double y, double z);
-
- /** Whether the layer's slope condition holds where the terrain's slope is {@code slope}. */
- boolean allowsSlope(double slope);
- }
-}
diff --git a/src/main/java/art/arcane/iris/builtin/carve/CarvingBiomeSettings.java b/src/main/java/art/arcane/iris/builtin/carve/CarvingBiomeSettings.java
new file mode 100644
index 000000000..e2942aecb
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/carve/CarvingBiomeSettings.java
@@ -0,0 +1,54 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.carve;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.LinkedBiomes;
+import com.volmit.config.Ref;
+import com.volmit.config.Reference;
+
+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)
+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.")
+ private String biome = "";
+
+ public CarvingBiomeSettings() {
+ }
+
+ public CarvingBiomeSettings(String biome) {
+ this.biome = biome;
+ }
+
+ public String biome() {
+ return biome == null ? "" : biome;
+ }
+
+ @Override
+ public Set treeBiomes() {
+ return Set.of(biome());
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/carve/CarvingEnabledSettings.java b/src/main/java/art/arcane/iris/builtin/carve/CarvingEnabledSettings.java
new file mode 100644
index 000000000..d09f7e7ac
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/carve/CarvingEnabledSettings.java
@@ -0,0 +1,43 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.carve;
+
+import com.volmit.FeatureAttachment.Target;
+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)
+public final class CarvingEnabledSettings implements IrisFeature {
+ @Desc("Enable or disable all carving for this dimension")
+ private boolean enabled = true;
+
+ public CarvingEnabledSettings() {
+ }
+
+ public CarvingEnabledSettings(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public boolean enabled() {
+ return enabled;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/carve/CarvingEntry.java b/src/main/java/art/arcane/iris/builtin/carve/CarvingEntry.java
new file mode 100644
index 000000000..7508832a7
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/carve/CarvingEntry.java
@@ -0,0 +1,103 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.carve;
+
+import com.volmit.config.Desc;
+import com.volmit.config.Range;
+import com.volmit.config.Ref;
+import com.volmit.config.Reference;
+import com.volmit.config.Snippet;
+import com.volmit.noise.NoiseStyle;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * One dimension-level cave biome override, an entry of {@code carving}: a pack biome that replaces the cave biome within a band
+ * of world Y, optionally split into child entries by a noise pattern. IrisApi types only; {@code CarvingResolver} picks
+ * the entry for a position.
+ */
+@Snippet("dimension-carving-entry")
+@Desc("Dimension-level cave biome override with absolute world Y bounds.")
+public final class CarvingEntry {
+ private static final double DEFAULT_WORLD_Y_MIN = -64;
+ private static final double DEFAULT_WORLD_Y_MAX = 320;
+ private static final double DEFAULT_CHILD_SHRINK_FACTOR = 1.5;
+ private static final int DEFAULT_CHILD_RECURSION_DEPTH = 3;
+
+ @Desc("Stable id for this carving entry")
+ private String id = "";
+
+ @Desc("Enable or disable this carving entry")
+ private boolean enabled = true;
+
+ @Ref(Reference.PACK_BIOME)
+ @Desc("Cave biome to apply when world Y falls within worldYRange")
+ private String biome = "";
+
+ @Desc("Absolute world Y bounds where this carving entry applies")
+ private Range worldYRange = Range.of(DEFAULT_WORLD_Y_MIN, DEFAULT_WORLD_Y_MAX);
+
+ @Desc("If this carving entry has child carving entries, this controls how small those child carving patches are.")
+ private double childShrinkFactor = DEFAULT_CHILD_SHRINK_FACTOR;
+
+ @Desc("If this carving entry has child carving entries, this controls the shape pattern used to pick them.")
+ private NoiseStyle childStyle = NoiseStyle.of("CELLULAR_IRIS_DOUBLE");
+
+ @Desc("Child carving entry ids. Child ids can point back to parent ids to create cycles; recursion is bounded by childRecursionDepth.")
+ private List children = List.of();
+
+ @Desc("Maximum recursion depth when resolving child carving entries from this entry.")
+ private int childRecursionDepth = DEFAULT_CHILD_RECURSION_DEPTH;
+
+ public CarvingEntry() {
+ }
+
+ public String id() {
+ return id == null ? "" : id;
+ }
+
+ public boolean enabled() {
+ return enabled;
+ }
+
+ public String biome() {
+ return biome == null ? "" : biome;
+ }
+
+ public Range worldYRange() {
+ return worldYRange;
+ }
+
+ public double childShrinkFactor() {
+ return childShrinkFactor;
+ }
+
+ public NoiseStyle childStyle() {
+ return childStyle;
+ }
+
+ public List children() {
+ return children == null ? List.of() : Collections.unmodifiableList(children);
+ }
+
+ public int childRecursionDepth() {
+ return childRecursionDepth;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/carve/CarvingSettings.java b/src/main/java/art/arcane/iris/builtin/carve/CarvingSettings.java
new file mode 100644
index 000000000..afd544963
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/carve/CarvingSettings.java
@@ -0,0 +1,80 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.carve;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.LinkedBiomes;
+import com.volmit.config.MinItems;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * The cave biome overrides a dimension declares, written as {@code "carving": [...]}, the list of {@link CarvingEntry}s.
+ * 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)
+public final class CarvingSettings implements IrisFeature, LinkedBiomes {
+ @MinItems(1)
+ @Desc("Dimension-level cave biome carving overrides with absolute world Y ranges")
+ private List entries = List.of();
+
+ public CarvingSettings() {
+ }
+
+ public CarvingSettings(List entries) {
+ this.entries = List.copyOf(entries);
+ }
+
+ public List entries() {
+ return entries == null ? List.of() : Collections.unmodifiableList(entries);
+ }
+
+ /**
+ * The biome key {@code reference} stands for: the biome of the entry with that id, ignoring surrounding blanks, or
+ * {@code reference} itself when no entry has the id. When several entries share an id the last one counts.
+ */
+ public String biomeOf(String reference) {
+ CarvingEntry entry = null;
+ for (CarvingEntry candidate : entries()) {
+ if (candidate != null && !candidate.id().isBlank() && candidate.id().trim().equals(reference)) {
+ entry = candidate;
+ }
+ }
+ return entry == null ? reference : entry.biome();
+ }
+
+ @Override
+ public Set usedBiomes(Collection dimension) {
+ Set biomes = new LinkedHashSet<>();
+ for (CarvingEntry entry : entries()) {
+ if (entry != null && entry.enabled()) {
+ biomes.add(entry.biome());
+ }
+ }
+ return biomes;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/carve/CaveDepthSettings.java b/src/main/java/art/arcane/iris/builtin/carve/CaveDepthSettings.java
new file mode 100644
index 000000000..08f005403
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/carve/CaveDepthSettings.java
@@ -0,0 +1,47 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.carve;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.MaxNumber;
+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)
+public final class CaveDepthSettings implements IrisFeature {
+ @MinNumber(0)
+ @MaxNumber(256)
+ @Desc("Minimum depth below terrain surface required before this cave biome can be selected.")
+ private int depth = 0;
+
+ public CaveDepthSettings() {
+ }
+
+ public CaveDepthSettings(int depth) {
+ this.depth = depth;
+ }
+
+ public int depth() {
+ return depth;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/carve/CaveProfile.java b/src/main/java/art/arcane/iris/builtin/carve/CaveProfile.java
index 0884897b3..a64df4d67 100644
--- a/src/main/java/art/arcane/iris/builtin/carve/CaveProfile.java
+++ b/src/main/java/art/arcane/iris/builtin/carve/CaveProfile.java
@@ -19,7 +19,10 @@
package art.arcane.iris.builtin.carve;
import art.arcane.iris.builtin.anchor.ObjectPlaceMode;
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
import com.volmit.config.Desc;
+import com.volmit.config.Feature;
import com.volmit.config.MaxNumber;
import com.volmit.config.MinItems;
import com.volmit.config.MinNumber;
@@ -35,11 +38,13 @@ import java.util.Optional;
/**
* A 3D cave profile as packs write it for a dimension, region or biome ({@code caveProfile}) or under
* {@code snippet/cave-profile/}: the noise fields that decide where caves are, how they meet the surface, where
- * cave fluid may sit and how objects find anchors in them. IrisApi types only; the carving module builds the noise.
+ * cave fluid may sit and how objects find anchors in them. A level that writes none has no profile, which is the
+ * same as one that is not {@code enabled}. IrisApi types only; the carving module builds the noise.
*/
@Snippet("cave-profile")
@Desc("Represents a configurable 3D cave profile.")
-public final class CaveProfile {
+@Feature(id = "iris:carve/profile", name = "Cave profile", key = "caveProfile", targets = {Target.DIMENSION, Target.REGION, Target.BIOME})
+public final class CaveProfile implements IrisFeature {
@Desc("Enable profile-driven cave carving.")
private boolean enabled = false;
diff --git a/src/main/java/art/arcane/iris/builtin/decorant/Decorator.java b/src/main/java/art/arcane/iris/builtin/decorant/Decorator.java
index 891a7778b..db788c086 100644
--- a/src/main/java/art/arcane/iris/builtin/decorant/Decorator.java
+++ b/src/main/java/art/arcane/iris/builtin/decorant/Decorator.java
@@ -18,6 +18,7 @@
package art.arcane.iris.builtin.decorant;
+import art.arcane.iris.builtin.prepare.SlopeClip;
import com.volmit.block.BlockSpec;
import com.volmit.config.Desc;
import com.volmit.config.MaxNumber;
@@ -60,7 +61,7 @@ public final class Decorator {
private List blacklist;
@Desc("The slope at which this decorator can be placed. Range from 0 to 10 by default. Calculated from a 3-block radius from the center of the decorator placement.")
- private DecoratorSlope slopeCondition = new DecoratorSlope();
+ private SlopeClip slopeCondition = new SlopeClip();
@Desc("If stackMax is set to true, use this to limit its max height for large caverns")
private int absoluteMaxStack = 30;
@@ -143,8 +144,8 @@ public final class Decorator {
return blacklist != null;
}
- public DecoratorSlope slopeCondition() {
- return slopeCondition == null ? new DecoratorSlope() : slopeCondition;
+ public SlopeClip slopeCondition() {
+ return slopeCondition == null ? new SlopeClip() : slopeCondition;
}
public int absoluteMaxStack() {
diff --git a/src/main/java/art/arcane/iris/builtin/decorant/DecoratorSlope.java b/src/main/java/art/arcane/iris/builtin/decorant/DecoratorSlope.java
deleted file mode 100644
index f7ea80716..000000000
--- a/src/main/java/art/arcane/iris/builtin/decorant/DecoratorSlope.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Servers
- * Copyright (c) 2026 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package art.arcane.iris.builtin.decorant;
-
-import com.volmit.config.Desc;
-import com.volmit.config.MaxNumber;
-import com.volmit.config.MinNumber;
-
-/** The terrain slopes a decorator may be placed on, as packs write it in a decorator's {@code slopeCondition}. */
-@Desc("Limits placement to a minimum and maximum terrain slope")
-public final class DecoratorSlope {
- private static final double UNLIMITED_MINIMUM = 0;
- private static final double UNLIMITED_MAXIMUM = 10;
-
- @MinNumber(0)
- @MaxNumber(1024)
- @Desc("The minimum slope for placement")
- private double minimumSlope = UNLIMITED_MINIMUM;
-
- @MinNumber(0)
- @MaxNumber(1024)
- @Desc("The maximum slope for placement")
- private double maximumSlope = UNLIMITED_MAXIMUM;
-
- public DecoratorSlope() {
- }
-
- public double minimumSlope() {
- return minimumSlope;
- }
-
- public double maximumSlope() {
- return maximumSlope;
- }
-
- /** Whether every slope passes: the limits are the defaults, or looser. */
- public boolean isDefault() {
- return minimumSlope <= UNLIMITED_MINIMUM && maximumSlope >= UNLIMITED_MAXIMUM;
- }
-
- public boolean isValid(double slope) {
- if (isDefault()) {
- return true;
- }
-
- return !(minimumSlope > slope) && !(maximumSlope < slope);
- }
-}
diff --git a/src/main/java/art/arcane/iris/builtin/deposit/DepositVariant.java b/src/main/java/art/arcane/iris/builtin/deposit/DepositVariant.java
new file mode 100644
index 000000000..582301354
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/deposit/DepositVariant.java
@@ -0,0 +1,67 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.deposit;
+
+import com.volmit.config.Desc;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Required;
+import com.volmit.config.Snippet;
+
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * One deposit ore remap rule, an entry of {@code depositVariants}: within a vertical band, ore blocks are rewritten to
+ * alternate blocks. A value of IrisApi types only; {@code ResolvedDepositVariant} resolves the blocks.
+ */
+@Snippet("deposit-variant")
+@Desc("Remaps ore block ids to alternate block ids within a vertical band. Ores declared at dimension, region, and biome scope can be rewritten at placement time (for example, iron_ore -> deepslate_iron_ore inside a deep carving band, or yourmod:iron -> yourmod:moon_iron inside a lunar biome).")
+public final class DepositVariant {
+ @Required
+ @MinNumber(-2048)
+ @MaxNumber(8192)
+ @Desc("Inclusive minimum world Y this variant applies at.")
+ private int minHeight = 0;
+
+ @Required
+ @MinNumber(-2048)
+ @MaxNumber(8192)
+ @Desc("Inclusive maximum world Y this variant applies at.")
+ private int maxHeight = 0;
+
+ @Required
+ @Desc("Source block id (for example `minecraft:iron_ore`) -> replacement block id (for example `minecraft:deepslate_iron_ore`). Any block id the data loader resolves is accepted, including external/mod blocks. Source match is by material only, so block properties on the source key are ignored.")
+ private Map remap = Map.of();
+
+ public DepositVariant() {
+ }
+
+ public int minHeight() {
+ return minHeight;
+ }
+
+ public int maxHeight() {
+ return maxHeight;
+ }
+
+ public Map remap() {
+ return remap == null ? Map.of() : Collections.unmodifiableMap(remap);
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/deposit/DepositVariantSettings.java b/src/main/java/art/arcane/iris/builtin/deposit/DepositVariantSettings.java
new file mode 100644
index 000000000..e6a6d15ef
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/deposit/DepositVariantSettings.java
@@ -0,0 +1,52 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.deposit;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.MinItems;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * The deposit ore remap rules one dimension, region or biome declares, written as {@code "depositVariants": [...]}, the list
+ * of {@link DepositVariant}s. The biome's rules apply first, then the region's, then the dimension's; the first matching rule wins.
+ */
+@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})
+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.")
+ private List variants = List.of();
+
+ public DepositVariantSettings() {
+ }
+
+ public DepositVariantSettings(List variants) {
+ this.variants = List.copyOf(variants);
+ }
+
+ public List variants() {
+ return variants == null ? List.of() : Collections.unmodifiableList(variants);
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/deposit/OreFrequencySettings.java b/src/main/java/art/arcane/iris/builtin/deposit/OreFrequencySettings.java
new file mode 100644
index 000000000..e279b0df6
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/deposit/OreFrequencySettings.java
@@ -0,0 +1,49 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.deposit;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.MaxNumber;
+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)
+public final class OreFrequencySettings implements IrisFeature {
+ private static final double UNCHANGED = 1D;
+
+ @MinNumber(0)
+ @MaxNumber(1)
+ @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.")
+ private double multiplier = UNCHANGED;
+
+ public OreFrequencySettings() {
+ }
+
+ public OreFrequencySettings(double multiplier) {
+ this.multiplier = multiplier;
+ }
+
+ public double multiplier() {
+ return multiplier;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/deposit/OreSizeSettings.java b/src/main/java/art/arcane/iris/builtin/deposit/OreSizeSettings.java
new file mode 100644
index 000000000..80e1d5892
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/deposit/OreSizeSettings.java
@@ -0,0 +1,49 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.deposit;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.MaxNumber;
+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)
+public final class OreSizeSettings implements IrisFeature {
+ private static final double UNCHANGED = 1D;
+
+ @MinNumber(0.01)
+ @MaxNumber(16)
+ @Desc("Multiplier applied to the block count of every ore deposit whose center is inside this biome. Non-ore deposits are unchanged.")
+ private double multiplier = UNCHANGED;
+
+ public OreSizeSettings() {
+ }
+
+ public OreSizeSettings(double multiplier) {
+ this.multiplier = multiplier;
+ }
+
+ public double multiplier() {
+ return multiplier;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/floating/FloatingChildBiome.java b/src/main/java/art/arcane/iris/builtin/floating/FloatingChildBiome.java
index 608be30c7..efd8dd462 100644
--- a/src/main/java/art/arcane/iris/builtin/floating/FloatingChildBiome.java
+++ b/src/main/java/art/arcane/iris/builtin/floating/FloatingChildBiome.java
@@ -19,7 +19,7 @@
package art.arcane.iris.builtin.floating;
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
-import art.arcane.iris.engine.object.terrain.IrisBiomePaletteLayer;
+import art.arcane.iris.builtin.terrain.PaletteLayer;
import com.volmit.config.Desc;
import com.volmit.config.MaxNumber;
import com.volmit.config.MinItems;
@@ -149,7 +149,7 @@ public final class FloatingChildBiome {
@MinItems(1)
@Desc("Custom palette layers used near the underside when bottomPaletteMode=CUSTOM. The layer format is the same as normal biome layers.")
- private List bottomPalette = List.of();
+ private List bottomPalette = List.of();
@MinNumber(1)
@MaxNumber(512)
@@ -315,7 +315,7 @@ public final class FloatingChildBiome {
return bottomPaletteMode == null ? FloatingBottomPaletteMode.DEPTH : bottomPaletteMode;
}
- public List bottomPalette() {
+ public List bottomPalette() {
return bottomPalette == null ? List.of() : Collections.unmodifiableList(bottomPalette);
}
diff --git a/src/main/java/art/arcane/iris/builtin/floating/FloatingChildSettings.java b/src/main/java/art/arcane/iris/builtin/floating/FloatingChildSettings.java
new file mode 100644
index 000000000..796b062f8
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/floating/FloatingChildSettings.java
@@ -0,0 +1,70 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.floating;
+
+import art.arcane.iris.builtin.carve.CarvingSettings;
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.LinkedBiomes;
+import com.volmit.config.MinItems;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * The floating child biomes one biome declares, written as {@code "floatingChildBiomes": [...]}, the list of
+ * {@link FloatingChildBiome}s. The target biome of every child, and the biome its {@code carving} names, take part in the
+ * 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)
+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.")
+ private List children = List.of();
+
+ public FloatingChildSettings() {
+ }
+
+ public FloatingChildSettings(List children) {
+ this.children = List.copyOf(children);
+ }
+
+ public List children() {
+ return children == null ? List.of() : Collections.unmodifiableList(children);
+ }
+
+ @Override
+ public Set usedBiomes(Collection dimension) {
+ CarvingSettings carving = dimension.stream().filter(CarvingSettings.class::isInstance).map(CarvingSettings.class::cast).findFirst().orElse(null);
+ Set biomes = new LinkedHashSet<>();
+ for (FloatingChildBiome child : children()) {
+ if (child != null) {
+ biomes.add(child.biome());
+ biomes.add(carving == null ? child.carving() : carving.biomeOf(child.carving()));
+ }
+ }
+ return biomes;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/floating/MergeFloatingChildrenSettings.java b/src/main/java/art/arcane/iris/builtin/floating/MergeFloatingChildrenSettings.java
new file mode 100644
index 000000000..24224b836
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/floating/MergeFloatingChildrenSettings.java
@@ -0,0 +1,43 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.floating;
+
+import com.volmit.FeatureAttachment.Target;
+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)
+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;
+
+ public MergeFloatingChildrenSettings() {
+ }
+
+ public MergeFloatingChildrenSettings(boolean merge) {
+ this.merge = merge;
+ }
+
+ public boolean merge() {
+ return merge;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/loot/BlockDrop.java b/src/main/java/art/arcane/iris/builtin/loot/BlockDrop.java
new file mode 100644
index 000000000..75151041e
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/loot/BlockDrop.java
@@ -0,0 +1,73 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.loot;
+
+import com.volmit.block.BlockSpec;
+import com.volmit.config.Desc;
+import com.volmit.config.MinItems;
+import com.volmit.config.Required;
+import com.volmit.config.Snippet;
+
+import java.util.Collections;
+import java.util.List;
+
+@Snippet("block-drops")
+@Desc("Represents a block drop list")
+public final class BlockDrop {
+ @Required
+ @MinItems(1)
+ @Desc("The blocks that drop loot")
+ private List blocks = List.of();
+
+ @Desc("If exact blocks is set to true, minecraft:barrel[axis=x] will only drop for that axis. When exact is false (default) any barrel will drop the defined drops.")
+ private boolean exactBlocks = false;
+
+ @MinItems(1)
+ @Desc("Add in specific items to drop")
+ private List drops = List.of();
+
+ @Desc("If this is in a biome, setting skipParents to true will ignore the drops in the region and dimension for this block type. The default (false) will allow all three nodes to fire and add to a list of drops.")
+ private boolean skipParents = false;
+
+ @Desc("Removes the default vanilla block drops and only drops the given items & any parent loot tables specified for this block type.")
+ private boolean replaceVanillaDrops = false;
+
+ public BlockDrop() {
+ }
+
+ public List blocks() {
+ return blocks == null ? List.of() : Collections.unmodifiableList(blocks);
+ }
+
+ public boolean exactBlocks() {
+ return exactBlocks;
+ }
+
+ public List drops() {
+ return drops == null ? List.of() : Collections.unmodifiableList(drops);
+ }
+
+ public boolean skipParents() {
+ return skipParents;
+ }
+
+ public boolean replaceVanillaDrops() {
+ return replaceVanillaDrops;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/loot/BlockDropSettings.java b/src/main/java/art/arcane/iris/builtin/loot/BlockDropSettings.java
new file mode 100644
index 000000000..a58786622
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/loot/BlockDropSettings.java
@@ -0,0 +1,48 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.loot;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.MinItems;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * The block drops one dimension, region or biome declares, written as {@code "blockDrops": [...]}, the list of
+ * {@link BlockDrop}s. A broken block drops those of its biome, then, unless one of them skips its parents, those of its
+ * 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})
+public final class BlockDropSettings implements IrisFeature {
+ @MinItems(1)
+ @Desc("Define custom block drops for this area")
+ private List drops = List.of();
+
+ public BlockDropSettings() {
+ }
+
+ public List drops() {
+ return drops == null ? List.of() : Collections.unmodifiableList(drops);
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/object/entity/IrisAttributeModifier.java b/src/main/java/art/arcane/iris/builtin/loot/ItemAttributeModifier.java
similarity index 74%
rename from src/main/java/art/arcane/iris/engine/object/entity/IrisAttributeModifier.java
rename to src/main/java/art/arcane/iris/builtin/loot/ItemAttributeModifier.java
index 52e4d068c..f5a87fe35 100644
--- a/src/main/java/art/arcane/iris/engine/object/entity/IrisAttributeModifier.java
+++ b/src/main/java/art/arcane/iris/builtin/loot/ItemAttributeModifier.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,32 +16,21 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.entity;
-
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.MaxNumber;
-import art.arcane.iris.engine.object.annotations.MinNumber;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.volmlib.util.math.RNG;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
+package art.arcane.iris.builtin.loot;
+import com.volmit.config.Desc;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Required;
+import com.volmit.config.Snippet;
@Snippet("attribute-modifier")
-@Accessors(chain = true)
-@AllArgsConstructor
-@NoArgsConstructor
@Desc("Represents an attribute modifier for an item or an entity. This allows you to create modifications to basic game attributes such as MAX_HEALTH or ARMOR_VALUE.")
-@Data
-public class IrisAttributeModifier {
+public final class ItemAttributeModifier {
@Required
@Desc("The Attribute type key such as max_health or minecraft:armor. This type is pulled from the game attributes. Zombie & Horse attributes will not work on non-zombie/horse entities.\nUsing an attribute on an item will have affects when held, or worn. There is no way to specify further granularity as the game picks this depending on the item type.")
private String attribute = null;
- @MinNumber(2)
@Required
@Desc("The Attribute Name is used internally only for the game. This value should be unique to all other attributes applied to this item/entity. It is not shown in game.")
private String name = "";
@@ -60,7 +49,30 @@ public class IrisAttributeModifier {
@Desc("The chance that this attribute is applied (0 to 1). If the chance is 0.5 (50%), then Iris will only apply this attribute 50% of the time.")
private double chance = 1;
- public double getAmount(RNG rng) {
- return rng.d(getMinAmount(), getMaxAmount());
+ public ItemAttributeModifier() {
+ }
+
+ public String attribute() {
+ return attribute;
+ }
+
+ public String name() {
+ return name;
+ }
+
+ public String operation() {
+ return operation;
+ }
+
+ public double minAmount() {
+ return minAmount;
+ }
+
+ public double maxAmount() {
+ return maxAmount;
+ }
+
+ public double chance() {
+ return chance;
}
}
diff --git a/src/main/java/art/arcane/iris/engine/object/loot/IrisEnchantment.java b/src/main/java/art/arcane/iris/builtin/loot/LootEnchantment.java
similarity index 52%
rename from src/main/java/art/arcane/iris/engine/object/loot/IrisEnchantment.java
rename to src/main/java/art/arcane/iris/builtin/loot/LootEnchantment.java
index b3253cc09..0e8d2d405 100644
--- a/src/main/java/art/arcane/iris/engine/object/loot/IrisEnchantment.java
+++ b/src/main/java/art/arcane/iris/builtin/loot/LootEnchantment.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,33 +16,21 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.loot;
-
-import art.arcane.iris.engine.framework.LootResolver;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.MaxNumber;
-import art.arcane.iris.engine.object.annotations.MinNumber;
-import art.arcane.iris.engine.object.annotations.RegistryListEnchantment;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.iris.spi.IrisLogging;
-import art.arcane.volmlib.util.math.RNG;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
+package art.arcane.iris.builtin.loot;
+import com.volmit.config.Desc;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Ref;
+import com.volmit.config.Reference;
+import com.volmit.config.Required;
+import com.volmit.config.Snippet;
@Snippet("enchantment")
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
@Desc("Represents an enchantment & level")
-@Data
-public class IrisEnchantment {
+public final class LootEnchantment {
@Required
- @RegistryListEnchantment
+ @Ref(Reference.ENCHANTMENT)
@Desc("The enchantment")
private String enchantment;
@@ -59,7 +47,22 @@ public class IrisEnchantment {
@Desc("The chance that this enchantment is applied (0 to 1)")
private double chance = 1;
- public int getLevel(RNG rng) {
- return LootResolver.inclusive(rng, getMinLevel(), getMaxLevel());
+ public LootEnchantment() {
+ }
+
+ public String enchantment() {
+ return enchantment;
+ }
+
+ public int minLevel() {
+ return minLevel;
+ }
+
+ public int maxLevel() {
+ return maxLevel;
+ }
+
+ public double chance() {
+ return chance;
}
}
diff --git a/src/main/java/art/arcane/iris/builtin/loot/LootEntry.java b/src/main/java/art/arcane/iris/builtin/loot/LootEntry.java
new file mode 100644
index 000000000..b90fa6d8d
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/loot/LootEntry.java
@@ -0,0 +1,181 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.loot;
+
+import com.volmit.config.Desc;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinItems;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Ref;
+import com.volmit.config.Reference;
+import com.volmit.config.Required;
+import com.volmit.config.Snippet;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+@Snippet("loot")
+@Desc("Represents a loot entry")
+public final class LootEntry {
+ public static final int MAX_AMOUNT = 64;
+
+ @Desc("The target inventory slot types to fill this loot with. World generation only ever fills STORAGE; the other values are inert during worldgen.")
+ private LootSlot slotTypes = LootSlot.STORAGE;
+
+ @MinNumber(1)
+ @Desc("The sub rarity of this loot. Calculated after this loot table has been picked.")
+ private int rarity = 1;
+
+ @MinNumber(1)
+ @MaxNumber(MAX_AMOUNT)
+ @Desc("Minimum amount of this loot, from 1 to 64")
+ private int minAmount = 1;
+
+ @MinNumber(1)
+ @MaxNumber(MAX_AMOUNT)
+ @Desc("Maximum amount of this loot, from 1 to 64")
+ private int maxAmount = 1;
+
+ @Desc("The display name of this item")
+ private String displayName = null;
+
+ @MinNumber(0)
+ @MaxNumber(1)
+ @Desc("Minimum durability percent")
+ private double minDurability = 0;
+
+ @MinNumber(0)
+ @MaxNumber(1)
+ @Desc("Maximum durability percent")
+ private double maxDurability = 1;
+
+ @Desc("Define a custom model identifier 1.14+ only")
+ private Integer customModel = null;
+
+ @Desc("Set this to true to prevent it from being broken")
+ private boolean unbreakable = false;
+
+ @MinItems(1)
+ @Desc("The item flags to add")
+ private List itemFlags = List.of();
+
+ @MinItems(1)
+ @Desc("Apply enchantments to this item")
+ private List enchantments = List.of();
+
+ @MinItems(1)
+ @Desc("Apply attribute modifiers to this item")
+ private List attributes = List.of();
+
+ @MinItems(1)
+ @Desc("Add lore to this item")
+ private List lore = List.of();
+
+ @Ref(Reference.ITEM)
+ @Required
+ @Desc("This is the item or block type. Does not accept minecraft:*, only materials such as DIAMOND_SWORD or DIRT. The exception are modded materials, as they require a namespace.")
+ private String type = "";
+
+ @Desc("The dye color")
+ private String dyeColor = null;
+
+ @Desc("The leather armor color")
+ private String leatherColor = null;
+
+ @Desc("Defines a custom NBT Tag for the item.")
+ private Map customNbt;
+
+ public LootEntry() {
+ }
+
+ public LootSlot slotTypes() {
+ return slotTypes == null ? LootSlot.STORAGE : slotTypes;
+ }
+
+ public int rarity() {
+ return rarity;
+ }
+
+ public int minAmount() {
+ return minAmount;
+ }
+
+ public int maxAmount() {
+ return maxAmount;
+ }
+
+ public String displayName() {
+ return displayName;
+ }
+
+ public double minDurability() {
+ return minDurability;
+ }
+
+ public double maxDurability() {
+ return maxDurability;
+ }
+
+ public Integer customModel() {
+ return customModel;
+ }
+
+ public boolean unbreakable() {
+ return unbreakable;
+ }
+
+ public List itemFlags() {
+ return listOrEmpty(itemFlags);
+ }
+
+ public List enchantments() {
+ return listOrEmpty(enchantments);
+ }
+
+ public List attributes() {
+ return listOrEmpty(attributes);
+ }
+
+ public List lore() {
+ return listOrEmpty(lore);
+ }
+
+ /** The authored item key, exactly as written in the pack. Each platform resolves it against its own item registry. */
+ public String type() {
+ return type;
+ }
+
+ public String dyeColor() {
+ return dyeColor;
+ }
+
+ public String leatherColor() {
+ return leatherColor;
+ }
+
+ /** The custom data of the item; empty when unset. */
+ public Map customNbt() {
+ return customNbt == null ? Map.of() : Collections.unmodifiableMap(customNbt);
+ }
+
+ private static List listOrEmpty(List list) {
+ return list == null ? List.of() : Collections.unmodifiableList(list);
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/object/loot/IrisLootMode.java b/src/main/java/art/arcane/iris/builtin/loot/LootMode.java
similarity index 84%
rename from src/main/java/art/arcane/iris/engine/object/loot/IrisLootMode.java
rename to src/main/java/art/arcane/iris/builtin/loot/LootMode.java
index 622d7f825..7fe817478 100644
--- a/src/main/java/art/arcane/iris/engine/object/loot/IrisLootMode.java
+++ b/src/main/java/art/arcane/iris/builtin/loot/LootMode.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,12 +16,12 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.loot;
+package art.arcane.iris.builtin.loot;
-import art.arcane.iris.engine.object.annotations.Desc;
+import com.volmit.config.Desc;
@Desc("A loot mode is used to describe what to do with the existing loot layers before adding this loot. ADD appends to the building list of tables (dimension tables, then region tables, then biome tables). REPLACE swaps the parent tables for this reference's tables. CLEAR suppresses loot entirely at this point.")
-public enum IrisLootMode {
+public enum LootMode {
@Desc("Add to the existing parent loot tables")
ADD,
@Desc("Clear all parent loot tables and contribute nothing at this level. Any tables listed here are ignored.")
diff --git a/src/main/java/art/arcane/iris/builtin/loot/LootSettings.java b/src/main/java/art/arcane/iris/builtin/loot/LootSettings.java
new file mode 100644
index 000000000..5d9b12ae7
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/loot/LootSettings.java
@@ -0,0 +1,72 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.loot;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinNumber;
+import com.volmit.config.ResourceRef;
+import com.volmit.config.Snippet;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * The loot tables one dimension, region or biome adds to the containers it covers, written as
+ * {@code "loot": {"mode": "ADD", "tables": [...], "multiplier": 1}}. Levels stack, dimension first, then region and
+ * biome; {@link LootMode} says what each does with the tables before it. An entity's {@code loot} has the same shape.
+ */
+@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})
+public final class LootSettings implements IrisFeature {
+ public static final double MAX_MULTIPLIER = 16D;
+
+ @Desc("ADD = add on top of parent tables. REPLACE = clear parent tables, then add these. CLEAR = clear parent tables and add nothing, even if tables are listed. FALLBACK = only used when nothing else defined a table.")
+ private LootMode mode = LootMode.ADD;
+
+ @ResourceRef(LootTable.class)
+ @Desc("Add loot table registries here")
+ private List tables = List.of();
+
+ @MinNumber(0)
+ @MaxNumber(MAX_MULTIPLIER)
+ @Desc("Scale loot sources in this area from 0 to 16 times their normal count")
+ private double multiplier = 1D;
+
+ /** Nothing added, nothing scaled: what a level without loot settings means. */
+ public LootSettings() {
+ }
+
+ public LootMode mode() {
+ return mode == null ? LootMode.ADD : mode;
+ }
+
+ /** The keys of the loot tables, in order. */
+ public List tables() {
+ return tables == null ? List.of() : Collections.unmodifiableList(tables);
+ }
+
+ public double multiplier() {
+ return multiplier;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/object/loot/InventorySlotType.java b/src/main/java/art/arcane/iris/builtin/loot/LootSlot.java
similarity index 82%
rename from src/main/java/art/arcane/iris/engine/object/loot/InventorySlotType.java
rename to src/main/java/art/arcane/iris/builtin/loot/LootSlot.java
index 574fc301f..6723d461a 100644
--- a/src/main/java/art/arcane/iris/engine/object/loot/InventorySlotType.java
+++ b/src/main/java/art/arcane/iris/builtin/loot/LootSlot.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,12 +16,12 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.loot;
+package art.arcane.iris.builtin.loot;
-import art.arcane.iris.engine.object.annotations.Desc;
+import com.volmit.config.Desc;
@Desc("An inventory slot type is used to represent a type of slot for items to fit into in any given inventory.")
-public enum InventorySlotType {
+public enum LootSlot {
@Desc("Typically the one you want to go with. Storage represnents most slots in inventories.")
STORAGE,
diff --git a/src/main/java/art/arcane/iris/engine/object/loot/IrisLootTable.java b/src/main/java/art/arcane/iris/builtin/loot/LootTable.java
similarity index 58%
rename from src/main/java/art/arcane/iris/engine/object/loot/IrisLootTable.java
rename to src/main/java/art/arcane/iris/builtin/loot/LootTable.java
index d92ff93ee..5c495b3db 100644
--- a/src/main/java/art/arcane/iris/engine/object/loot/IrisLootTable.java
+++ b/src/main/java/art/arcane/iris/builtin/loot/LootTable.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,34 +16,25 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.loot;
+package art.arcane.iris.builtin.loot;
-import art.arcane.iris.core.loader.IrisRegistrant;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.MaxNumber;
-import art.arcane.iris.engine.object.annotations.MinNumber;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
+import com.volmit.config.Desc;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinItems;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Required;
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
+import java.util.Collections;
+import java.util.List;
+
+/** A loot table of the pack, one file of {@code loot/}. */
@Desc("Represents a loot table. Biomes, Regions & Objects can add or replace the virtual table with these loot tables")
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class IrisLootTable extends IrisRegistrant {
+public final class LootTable {
public static final int MAX_PICKED = 64;
public static final int MAX_TRIES = 256;
@Required
@Desc("The name of this loot table")
- @MinNumber(2)
private String name = "";
@MinNumber(1)
@@ -65,17 +56,34 @@ public class IrisLootTable extends IrisRegistrant {
@Desc("The maximum amount of tries to generate loot, from 1 to 256")
private int maxTries = 10;
+ @MinItems(1)
@Desc("The loot in this table")
- @ArrayType(min = 1, type = IrisLoot.class)
- private KList loot = new KList<>();
+ private List loot = List.of();
- @Override
- public String getFolderName() {
- return "loot";
+ public LootTable() {
}
- @Override
- public String getTypeName() {
- return "Loot";
+ public String name() {
+ return name == null ? "" : name;
+ }
+
+ public int rarity() {
+ return rarity;
+ }
+
+ public int maxPicked() {
+ return maxPicked;
+ }
+
+ public int minPicked() {
+ return minPicked;
+ }
+
+ public int maxTries() {
+ return maxTries;
+ }
+
+ public List loot() {
+ return loot == null ? List.of() : Collections.unmodifiableList(loot);
}
}
diff --git a/src/main/java/art/arcane/iris/builtin/package-info.java b/src/main/java/art/arcane/iris/builtin/package-info.java
index b9f9bccec..4e62e77b1 100644
--- a/src/main/java/art/arcane/iris/builtin/package-info.java
+++ b/src/main/java/art/arcane/iris/builtin/package-info.java
@@ -27,9 +27,10 @@
* subpackage per built-in module, named after the module path, such as {@code art.arcane.iris.builtin.deposit}
* for {@code iris:deposit}.
*
- * Besides those, it holds narrow facades only Iris's own built-ins use, interfaces Iris's worlds implement, for what
- * they need from Iris's internals and no pack module does: {@link art.arcane.iris.builtin.IrisSeed}, and the transitional
- * {@link art.arcane.iris.builtin.PendingSettings}. Keep them few: each is a promise.
+ * Besides those, it holds what the compiled-in built-ins and the built-ins jar must share, since each sees its own copy
+ * of every other class: narrow facades only Iris's own built-ins use, interfaces Iris's worlds implement
+ * ({@link art.arcane.iris.builtin.IrisSeed}), and per-world state several of them use
+ * ({@link art.arcane.iris.builtin.terrain.LayerBlocks}). Keep them few: each is a promise.
*
* Some built-in stages produce Iris's own types, such as the placement settings of {@code iris:prepare}. A
* pack module can require such a stage to run after it, but cannot read its output: the pack load rejects
diff --git a/src/main/java/art/arcane/iris/builtin/post/PostProcessingSettings.java b/src/main/java/art/arcane/iris/builtin/post/PostProcessingSettings.java
new file mode 100644
index 000000000..ceb2f1442
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/post/PostProcessingSettings.java
@@ -0,0 +1,44 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.post;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+
+/**
+ * Whether a dimension is post processed, written as {@code "postProcessing": true}. Iris has never read this flag: surface smoothing runs
+ * 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)
+public final class PostProcessingSettings implements IrisFeature {
+ public static final boolean DEFAULT_ENABLED = true;
+
+ @Desc("Use post processing or not")
+ private boolean enabled = DEFAULT_ENABLED;
+
+ public PostProcessingSettings() {
+ }
+
+ public boolean enabled() {
+ return enabled;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/post/PostProcessingSlabsSettings.java b/src/main/java/art/arcane/iris/builtin/post/PostProcessingSlabsSettings.java
new file mode 100644
index 000000000..a6bffc932
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/post/PostProcessingSlabsSettings.java
@@ -0,0 +1,43 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.post;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+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)
+public final class PostProcessingSlabsSettings implements IrisFeature {
+ public static final boolean DEFAULT_ENABLED = true;
+
+ @Desc("Add slabs in post processing")
+ private boolean enabled = DEFAULT_ENABLED;
+
+ public PostProcessingSlabsSettings() {
+ }
+
+ public boolean enabled() {
+ return enabled;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/post/PostProcessingWallsSettings.java b/src/main/java/art/arcane/iris/builtin/post/PostProcessingWallsSettings.java
new file mode 100644
index 000000000..f49e5e6a7
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/post/PostProcessingWallsSettings.java
@@ -0,0 +1,43 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.post;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+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)
+public final class PostProcessingWallsSettings implements IrisFeature {
+ public static final boolean DEFAULT_ENABLED = true;
+
+ @Desc("Add painted walls in post processing")
+ private boolean enabled = DEFAULT_ENABLED;
+
+ public PostProcessingWallsSettings() {
+ }
+
+ public boolean enabled() {
+ return enabled;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/prepare/SlopeClip.java b/src/main/java/art/arcane/iris/builtin/prepare/SlopeClip.java
index 9d2030c1d..c5686d1c6 100644
--- a/src/main/java/art/arcane/iris/builtin/prepare/SlopeClip.java
+++ b/src/main/java/art/arcane/iris/builtin/prepare/SlopeClip.java
@@ -23,7 +23,7 @@ import com.volmit.config.MaxNumber;
import com.volmit.config.MinNumber;
import com.volmit.config.Snippet;
-/** The terrain slopes a placement or decorator may sit on, written as its {@code slopeCondition}. */
+/** The terrain slopes an object placement, a decorator or a terrain layer may sit on, written as its {@code slopeCondition}. */
@Snippet("slope-clip")
@Desc("Limits placement to a minimum and maximum terrain slope")
public final class SlopeClip {
diff --git a/src/main/java/art/arcane/iris/builtin/spawn/AmbientEffect.java b/src/main/java/art/arcane/iris/builtin/spawn/AmbientEffect.java
new file mode 100644
index 000000000..090e3ee97
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/spawn/AmbientEffect.java
@@ -0,0 +1,247 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.spawn;
+
+import com.volmit.config.Desc;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Ref;
+import com.volmit.config.Reference;
+import com.volmit.config.Required;
+import com.volmit.config.Snippet;
+
+/**
+ * A sound, particles, potion effect or commands that play now and then around the players in an area. The same
+ * settings make the effect an entity shows when it appears ({@link EntityDefinition#spawnEffect()}).
+ */
+@Snippet("effect")
+@Desc("An iris effect")
+public final class AmbientEffect {
+ @Ref(Reference.POTION_EFFECT)
+ @Desc("The potion effect to apply in this area")
+ private String potionEffect = "";
+
+ @Desc("The particle effect to apply in the area")
+ private String particleEffect = null;
+
+ @MinNumber(-32)
+ @MaxNumber(32)
+ @Desc("Randomly offset from the surface to this surface+value")
+ private int particleOffset = 0;
+
+ @MinNumber(-8)
+ @MaxNumber(8)
+ @Desc("The alt x, usually represents motion if the particle count is zero. Otherwise an offset.")
+ private double particleAltX = 0;
+
+ @MinNumber(-8)
+ @MaxNumber(8)
+ @Desc("The alt y, usually represents motion if the particle count is zero. Otherwise an offset.")
+ private double particleAltY = 0;
+
+ @MinNumber(-8)
+ @MaxNumber(8)
+ @Desc("The alt z, usually represents motion if the particle count is zero. Otherwise an offset.")
+ private double particleAltZ = 0;
+
+ @Desc("Randomize the altX by -altX to altX")
+ private boolean randomAltX = true;
+
+ @Desc("Randomize the altY by -altY to altY")
+ private boolean randomAltY = false;
+
+ @Desc("Randomize the altZ by -altZ to altZ")
+ private boolean randomAltZ = true;
+
+ @Desc("The sound to play")
+ private String sound = null;
+
+ @MinNumber(0)
+ @MaxNumber(512)
+ @Desc("The max distance from the player the sound will play")
+ private int soundDistance = 12;
+
+ @MinNumber(0.01)
+ @MaxNumber(1.99)
+ @Desc("The minimum sound pitch")
+ private double minPitch = 0.5D;
+
+ @MinNumber(0.01)
+ @MaxNumber(1.99)
+ @Desc("The max sound pitch")
+ private double maxPitch = 1.5D;
+
+ @MinNumber(0.001)
+ @MaxNumber(512)
+ @Desc("The sound volume.")
+ private double volume = 1.5D;
+
+ @MinNumber(0)
+ @MaxNumber(512)
+ @Desc("The particle count. Try setting to zero for using the alt xyz to a motion value instead of an offset")
+ private int particleCount = 0;
+
+ @MinNumber(0)
+ @MaxNumber(64)
+ @Desc("How far away from the player particles can play")
+ private int particleDistance = 20;
+
+ @MinNumber(0)
+ @MaxNumber(128)
+ @Desc("How wide the particles can play (player's view left and right) RADIUS")
+ private int particleDistanceWidth = 24;
+
+ @Desc("An extra value for some particles... Which bukkit doesn't even document.")
+ private double extra = 0;
+
+ @MinNumber(-1)
+ @MaxNumber(1024)
+ @Desc("The Potion Strength or -1 to disable")
+ private int potionStrength = -1;
+
+ @MinNumber(1)
+ @Desc("The max time the potion will last for")
+ private int potionTicksMax = 155;
+
+ @MinNumber(1)
+ @Desc("The min time the potion will last for")
+ private int potionTicksMin = 75;
+
+ @Required
+ @MinNumber(0)
+ @Desc("The effect interval in milliseconds")
+ private int interval = 150;
+
+ @MinNumber(0)
+ @MaxNumber(16)
+ @Desc("The effect distance start away")
+ private int particleAway = 5;
+
+ @Required
+ @MinNumber(1)
+ @Desc("The chance is 1 in CHANCE per interval")
+ private int chance = 50;
+
+ @Desc("Run commands, with configurable location parameters")
+ private EffectCommands commandRegistry = null;
+
+ public AmbientEffect() {
+ }
+
+ public String potionEffect() {
+ return potionEffect;
+ }
+
+ public String particleEffect() {
+ return particleEffect;
+ }
+
+ public int particleOffset() {
+ return particleOffset;
+ }
+
+ public double particleAltX() {
+ return particleAltX;
+ }
+
+ public double particleAltY() {
+ return particleAltY;
+ }
+
+ public double particleAltZ() {
+ return particleAltZ;
+ }
+
+ public boolean randomAltX() {
+ return randomAltX;
+ }
+
+ public boolean randomAltY() {
+ return randomAltY;
+ }
+
+ public boolean randomAltZ() {
+ return randomAltZ;
+ }
+
+ public String sound() {
+ return sound;
+ }
+
+ public int soundDistance() {
+ return soundDistance;
+ }
+
+ public double minPitch() {
+ return minPitch;
+ }
+
+ public double maxPitch() {
+ return maxPitch;
+ }
+
+ public double volume() {
+ return volume;
+ }
+
+ public int particleCount() {
+ return particleCount;
+ }
+
+ public int particleDistance() {
+ return particleDistance;
+ }
+
+ public int particleDistanceWidth() {
+ return particleDistanceWidth;
+ }
+
+ public double extra() {
+ return extra;
+ }
+
+ public int potionStrength() {
+ return potionStrength;
+ }
+
+ public int potionTicksMax() {
+ return potionTicksMax;
+ }
+
+ public int potionTicksMin() {
+ return potionTicksMin;
+ }
+
+ public int interval() {
+ return interval;
+ }
+
+ public int particleAway() {
+ return particleAway;
+ }
+
+ public int chance() {
+ return chance;
+ }
+
+ /** The commands the effect runs; null for none. */
+ public EffectCommands commandRegistry() {
+ return commandRegistry;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/spawn/EffectCommands.java b/src/main/java/art/arcane/iris/builtin/spawn/EffectCommands.java
new file mode 100644
index 000000000..48ed35cc8
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/spawn/EffectCommands.java
@@ -0,0 +1,100 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.spawn;
+
+import com.volmit.config.Desc;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinItems;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Required;
+import com.volmit.config.Snippet;
+
+import java.util.Collections;
+import java.util.List;
+
+@Snippet("command-registry")
+@Desc("Represents a casting location for a command")
+public final class EffectCommands {
+ @Required
+ @MinItems(1)
+ @Desc("Run commands, at the exact location of the player")
+ private List rawCommands = List.of();
+
+ @MinNumber(-8)
+ @MaxNumber(8)
+ @Desc("The alt x, usually represents motion if the particle count is zero. Otherwise an offset.")
+ private double commandOffsetX = 0;
+
+ @MinNumber(-8)
+ @MaxNumber(8)
+ @Desc("The alt y, usually represents motion if the particle count is zero. Otherwise an offset.")
+ private double commandOffsetY = 0;
+
+ @MinNumber(-8)
+ @MaxNumber(8)
+ @Desc("The alt z, usually represents motion if the particle count is zero. Otherwise an offset.")
+ private double commandOffsetZ = 0;
+
+ @Desc("Randomize the altX from -altX to altX")
+ private boolean commandRandomAltX = true;
+
+ @Desc("Randomize the altY from -altY to altY")
+ private boolean commandRandomAltY = false;
+
+ @Desc("Randomize the altZ from -altZ to altZ")
+ private boolean commandRandomAltZ = true;
+
+ @Desc("Randomize location for all separate commands (true), or run all on the same location (false)")
+ private boolean commandAllRandomLocations = true;
+
+ public EffectCommands() {
+ }
+
+ public List rawCommands() {
+ return rawCommands == null ? List.of() : Collections.unmodifiableList(rawCommands);
+ }
+
+ public double commandOffsetX() {
+ return commandOffsetX;
+ }
+
+ public double commandOffsetY() {
+ return commandOffsetY;
+ }
+
+ public double commandOffsetZ() {
+ return commandOffsetZ;
+ }
+
+ public boolean commandRandomAltX() {
+ return commandRandomAltX;
+ }
+
+ public boolean commandRandomAltY() {
+ return commandRandomAltY;
+ }
+
+ public boolean commandRandomAltZ() {
+ return commandRandomAltZ;
+ }
+
+ public boolean commandAllRandomLocations() {
+ return commandAllRandomLocations;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/spawn/EffectSettings.java b/src/main/java/art/arcane/iris/builtin/spawn/EffectSettings.java
new file mode 100644
index 000000000..49f90914c
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/spawn/EffectSettings.java
@@ -0,0 +1,47 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.spawn;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.MinItems;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * The ambient effects one region or biome declares, written as {@code "effects": [...]}, the list of
+ * {@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})
+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.")
+ private List effects = List.of();
+
+ public EffectSettings() {
+ }
+
+ public List effects() {
+ return effects == null ? List.of() : Collections.unmodifiableList(effects);
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/object/entity/IrisEntity.java b/src/main/java/art/arcane/iris/builtin/spawn/EntityDefinition.java
similarity index 50%
rename from src/main/java/art/arcane/iris/engine/object/entity/IrisEntity.java
rename to src/main/java/art/arcane/iris/builtin/spawn/EntityDefinition.java
index 709d4c2b1..a1258af7d 100644
--- a/src/main/java/art/arcane/iris/engine/object/entity/IrisEntity.java
+++ b/src/main/java/art/arcane/iris/builtin/spawn/EntityDefinition.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,34 +16,25 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.entity;
+package art.arcane.iris.builtin.spawn;
-import art.arcane.iris.engine.object.entity.spawn.IrisSurface;
-import art.arcane.iris.engine.object.loot.IrisLoot;
-import art.arcane.iris.engine.object.loot.IrisLootReference;
-import art.arcane.iris.engine.object.marker.IrisCommand;
-import art.arcane.iris.core.loader.IrisRegistrant;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.RegistryListEntityType;
-import art.arcane.iris.engine.object.annotations.RegistryListSpecialEntity;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
+import art.arcane.iris.builtin.loot.ItemAttributeModifier;
+import art.arcane.iris.builtin.loot.LootEntry;
+import art.arcane.iris.builtin.loot.LootSettings;
+import com.volmit.config.Desc;
+import com.volmit.config.MinItems;
+import com.volmit.config.Ref;
+import com.volmit.config.Reference;
+import com.volmit.config.Required;
-@SuppressWarnings("ALL")
-@Accessors(chain = true)
-@NoArgsConstructor
+import java.util.Collections;
+import java.util.List;
+/** An entity of the pack, one file of {@code entities/}: what spawners and markers spawn, with its equipment, attributes, passengers and loot. */
@Desc("Represents an iris entity.")
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class IrisEntity extends IrisRegistrant {
+public final class EntityDefinition {
@Required
- @RegistryListEntityType
+ @Ref(Reference.ENTITY)
@Desc("The namespaced key of the entity type to spawn, such as minecraft:zombie or alexsmobs:grizzly_bear. To spawn a mob from another plugin or provider, set this type to unknown and define the special type.")
private String type = null;
@@ -81,39 +72,39 @@ public class IrisEntity extends IrisRegistrant {
private boolean removable = false;
@Desc("Entity helmet equipment")
- private IrisLoot helmet = null;
+ private LootEntry helmet = null;
@Desc("Entity chestplate equipment")
- private IrisLoot chestplate = null;
+ private LootEntry chestplate = null;
@Desc("Entity boots equipment")
- private IrisLoot boots = null;
+ private LootEntry boots = null;
@Desc("Entity leggings equipment")
- private IrisLoot leggings = null;
+ private LootEntry leggings = null;
@Desc("Entity main hand equipment")
- private IrisLoot mainHand = null;
+ private LootEntry mainHand = null;
@Desc("Entity off hand equipment")
- private IrisLoot offHand = null;
+ private LootEntry offHand = null;
+ @MinItems(1)
@Desc("Make other entities ride this entity")
- @ArrayType(min = 1, type = IrisEntity.class)
- private KList passengers = new KList<>();
+ private List passengers = List.of();
+ @MinItems(1)
@Desc("Attribute modifiers for this entity")
- @ArrayType(min = 1, type = IrisAttributeModifier.class)
- private KList attributes = new KList<>();
+ private List attributes = List.of();
@Desc("Loot tables for drops. Only the tables list is honored for entities; mode and multiplier are ignored, and the tables replace vanilla drops entirely.")
- private IrisLootReference loot = new IrisLootReference();
+ private LootSettings loot = new LootSettings();
@Desc("If specified, this entity will be leashed by this entity. I.e. THIS ENTITY Leashed by SPECIFIED. This has no effect on EnderDragons, Withers, Players, or Bats.Non-living entities excluding leashes will not persist as leashholders.")
- private IrisEntity leashHolder = null;
+ private EntityDefinition leashHolder = null;
@Desc("If specified, this entity will spawn with an effect")
- private IrisEffect spawnEffect = null;
+ private AmbientEffect spawnEffect = null;
@Desc("Simply moves the entity from below the surface slowly out of the ground as a spawn-in effect")
private boolean spawnEffectRiseOutOfGround = false;
@@ -131,30 +122,153 @@ public class IrisEntity extends IrisRegistrant {
private boolean keepEntity = false;
@Desc("The surface type to spawn this mob on")
- private IrisSurface surface = IrisSurface.LAND;
+ private SpawnSurface surface = SpawnSurface.LAND;
- @RegistryListSpecialEntity
+ @Ref(Reference.SPECIAL_ENTITY)
@Desc("Create a mob from another plugin, such as Mythic Mobs. Should be in the format of a namespace of PluginName:MobName")
private String specialType = "";
@Desc("Set to true if you want to apply all of the settings here to the mob, even though an external plugin has already done so.")
private boolean applySettingsToCustomMobAnyways = false;
- @ArrayType(min = 1, type = IrisCommand.class)
+ @MinItems(1)
@Desc("Run raw commands when this entity is spawned. Use {x}, {y}, and {z} for location. /summon pig {x} {y} {z}")
- private KList rawCommands = new KList<>();
+ private List rawCommands = List.of();
+ public EntityDefinition() {
+ }
+
+ public String type() {
+ return type;
+ }
+
+ public String reason() {
+ return reason;
+ }
+
+ public String customName() {
+ return customName;
+ }
+
+ public boolean customNameVisible() {
+ return customNameVisible;
+ }
+
+ public boolean aware() {
+ return aware;
+ }
+
+ public boolean ai() {
+ return ai;
+ }
+
+ public boolean glowing() {
+ return glowing;
+ }
+
+ public boolean gravity() {
+ return gravity;
+ }
+
+ public boolean invulnerable() {
+ return invulnerable;
+ }
+
+ public boolean silent() {
+ return silent;
+ }
+
+ public boolean pickupItems() {
+ return pickupItems;
+ }
+
+ public boolean removable() {
+ return removable;
+ }
+
+ public LootEntry helmet() {
+ return helmet;
+ }
+
+ public LootEntry chestplate() {
+ return chestplate;
+ }
+
+ public LootEntry boots() {
+ return boots;
+ }
+
+ public LootEntry leggings() {
+ return leggings;
+ }
+
+ public LootEntry mainHand() {
+ return mainHand;
+ }
+
+ public LootEntry offHand() {
+ return offHand;
+ }
+
+ public List passengers() {
+ return passengers == null ? List.of() : Collections.unmodifiableList(passengers);
+ }
+
+ public List attributes() {
+ return attributes == null ? List.of() : Collections.unmodifiableList(attributes);
+ }
+
+ /** The loot the entity drops when it dies; only its tables count. */
+ public LootSettings loot() {
+ return loot == null ? new LootSettings() : loot;
+ }
+
+ public EntityDefinition leashHolder() {
+ return leashHolder;
+ }
+
+ public AmbientEffect spawnEffect() {
+ return spawnEffect;
+ }
+
+ public boolean spawnEffectRiseOutOfGround() {
+ return spawnEffectRiseOutOfGround;
+ }
+
+ public String pandaMainGene() {
+ return pandaMainGene;
+ }
+
+ public String pandaHiddenGene() {
+ return pandaHiddenGene;
+ }
+
+ public boolean baby() {
+ return baby;
+ }
+
+ public boolean keepEntity() {
+ return keepEntity;
+ }
+
+ public SpawnSurface surface() {
+ return surface == null ? SpawnSurface.LAND : surface;
+ }
+
+ public String specialType() {
+ return specialType;
+ }
+
+ /** Whether the entity is a mob of another plugin. */
public boolean isSpecialType() {
- return specialType != null && !specialType.equals("");
+ return specialType != null && !specialType.isEmpty();
}
- @Override
- public String getFolderName() {
- return "entities";
+ public boolean applySettingsToCustomMobAnyways() {
+ return applySettingsToCustomMobAnyways;
}
- @Override
- public String getTypeName() {
- return "Entity";
+ public List rawCommands() {
+ return rawCommands == null ? List.of() : Collections.unmodifiableList(rawCommands);
}
}
diff --git a/src/main/java/art/arcane/iris/builtin/spawn/EntitySpawn.java b/src/main/java/art/arcane/iris/builtin/spawn/EntitySpawn.java
new file mode 100644
index 000000000..34acbcae5
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/spawn/EntitySpawn.java
@@ -0,0 +1,66 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.spawn;
+
+import com.volmit.config.Desc;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Required;
+import com.volmit.config.ResourceRef;
+import com.volmit.config.Snippet;
+
+@Snippet("entity-spawn")
+@Desc("Represents an entity spawn during initial chunk generation")
+public final class EntitySpawn {
+ @ResourceRef(EntityDefinition.class)
+ @Required
+ @Desc("The entity")
+ private String entity = "";
+
+ @MinNumber(1)
+ @Desc("The 1 in RARITY chance for this entity to spawn")
+ private int rarity = 1;
+
+ @MinNumber(1)
+ @Desc("The minumum of this entity to spawn")
+ private int minSpawns = 1;
+
+ @MinNumber(1)
+ @Desc("The max of this entity to spawn")
+ private int maxSpawns = 1;
+
+ public EntitySpawn() {
+ }
+
+ /** The key of the entity of the pack. */
+ public String entity() {
+ return entity;
+ }
+
+ public int rarity() {
+ return rarity;
+ }
+
+ public int minSpawns() {
+ return minSpawns;
+ }
+
+ public int maxSpawns() {
+ return maxSpawns;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/object/marker/IrisCommand.java b/src/main/java/art/arcane/iris/builtin/spawn/SpawnCommand.java
similarity index 51%
rename from src/main/java/art/arcane/iris/engine/object/marker/IrisCommand.java
rename to src/main/java/art/arcane/iris/builtin/spawn/SpawnCommand.java
index 5062b80b5..cfd8f5b64 100644
--- a/src/main/java/art/arcane/iris/engine/object/marker/IrisCommand.java
+++ b/src/main/java/art/arcane/iris/builtin/spawn/SpawnCommand.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,32 +16,23 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.marker;
+package art.arcane.iris.builtin.spawn;
-import art.arcane.iris.engine.object.world.IrisTimeBlock;
-import art.arcane.iris.engine.object.world.IrisWeather;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.Required;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.iris.spi.PlatformWorld;
-import art.arcane.iris.util.common.scheduling.ConsoleCommands;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
+import com.volmit.config.Desc;
+import com.volmit.config.MinItems;
+import com.volmit.config.Required;
+import com.volmit.config.Snippet;
+
+import java.util.Collections;
+import java.util.List;
@Snippet("command")
-@Accessors(chain = true)
-@NoArgsConstructor
@Desc("Represents a set of Iris commands")
-@Data
-public class IrisCommand {
-
+public final class SpawnCommand {
@Required
- @ArrayType(min = 1, type = String.class)
+ @MinItems(1)
@Desc("List of commands. Iris replaces {x} {y} and {z} with the location of the entity spawn")
- private KList commands = new KList<>();
+ private List commands = List.of();
@Desc("The delay for running the command. Instant by default")
private long delay = 0;
@@ -53,20 +44,35 @@ public class IrisCommand {
private long repeatDelay = 100;
@Desc("The block of 24 hour time in which the command should execute.")
- private IrisTimeBlock timeBlock = new IrisTimeBlock();
+ private SpawnTimeBlock timeBlock = new SpawnTimeBlock();
@Desc("The weather that is required for the command to execute.")
- private IrisWeather weather = IrisWeather.ANY;
+ private SpawnWeather weather = SpawnWeather.ANY;
- public boolean isValid(PlatformWorld world) {
- return timeBlock.isWithin(world) && weather.is(world);
+ public SpawnCommand() {
}
- public void run(PlatformWorld world, int x, int y, int z) {
- if (!isValid(world)) {
- return;
- }
+ public List commands() {
+ return commands == null ? List.of() : Collections.unmodifiableList(commands);
+ }
- ConsoleCommands.run(commands, delay, repeat, repeatDelay, x, y, z);
+ public long delay() {
+ return delay;
+ }
+
+ public boolean repeat() {
+ return repeat;
+ }
+
+ public long repeatDelay() {
+ return repeatDelay;
+ }
+
+ public SpawnTimeBlock timeBlock() {
+ return timeBlock == null ? new SpawnTimeBlock() : timeBlock;
+ }
+
+ public SpawnWeather weather() {
+ return weather == null ? SpawnWeather.ANY : weather;
}
}
diff --git a/src/main/java/art/arcane/iris/engine/object/value/IrisDuration.java b/src/main/java/art/arcane/iris/builtin/spawn/SpawnDuration.java
similarity index 58%
rename from src/main/java/art/arcane/iris/engine/object/value/IrisDuration.java
rename to src/main/java/art/arcane/iris/builtin/spawn/SpawnDuration.java
index 822bd6962..afe1263b5 100644
--- a/src/main/java/art/arcane/iris/engine/object/value/IrisDuration.java
+++ b/src/main/java/art/arcane/iris/builtin/spawn/SpawnDuration.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,19 +16,22 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.value;
+package art.arcane.iris.builtin.spawn;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.volmlib.util.format.Form;
-import lombok.Data;
+import com.volmit.config.Desc;
+import com.volmit.config.Snippet;
import java.util.concurrent.TimeUnit;
@Snippet("duration")
-@Data
@Desc("Represents a combined duration. Fill each property to add time into a single duration")
-public class IrisDuration {
+public final class SpawnDuration {
+ private static final long MILLISECONDS_PER_MINECRAFT_TICK = 50L;
+ private static final long MILLISECONDS_PER_MINECRAFT_HOUR = 50_000L;
+ private static final long MILLISECONDS_PER_MINECRAFT_DAY = 1_200_000L;
+ private static final long MILLISECONDS_PER_MINECRAFT_WEEK = 8_400_000L;
+ private static final long MILLISECONDS_PER_MINECRAFT_LUNAR_CYCLE = 9_600_000L;
+
@Desc("Milliseconds (1000ms = 1 second)")
private int milliseconds = 0;
@@ -59,20 +62,19 @@ public class IrisDuration {
@Desc("REAL (not minecraft) Days")
private int days = 0;
- public String toString() {
- return Form.duration((double) toMilliseconds(), 2);
+ public SpawnDuration() {
}
public long toMilliseconds() {
- return getMilliseconds()
- + TimeUnit.SECONDS.toMillis(getSeconds())
- + TimeUnit.MINUTES.toMillis(getMinutes())
- + TimeUnit.HOURS.toMillis(getHours())
- + TimeUnit.DAYS.toMillis(getDays())
- + (getMinecraftTicks() * 50L)
- + (getMinecraftHours() * 50000L)
- + (getMinecraftDays() * 1_200_000L)
- + (getMinecraftWeeks() * 8_400_000L)
- + (getMinecraftLunarCycles() * 9_600_000L);
+ return milliseconds
+ + TimeUnit.SECONDS.toMillis(seconds)
+ + TimeUnit.MINUTES.toMillis(minutes)
+ + TimeUnit.HOURS.toMillis(hours)
+ + TimeUnit.DAYS.toMillis(days)
+ + (minecraftTicks * MILLISECONDS_PER_MINECRAFT_TICK)
+ + (minecraftHours * MILLISECONDS_PER_MINECRAFT_HOUR)
+ + (minecraftDays * MILLISECONDS_PER_MINECRAFT_DAY)
+ + (minecraftWeeks * MILLISECONDS_PER_MINECRAFT_WEEK)
+ + (minecraftLunarCycles * MILLISECONDS_PER_MINECRAFT_LUNAR_CYCLE);
}
}
diff --git a/src/main/java/art/arcane/iris/engine/object/entity/spawn/IrisSpawnGroup.java b/src/main/java/art/arcane/iris/builtin/spawn/SpawnGroup.java
similarity index 79%
rename from src/main/java/art/arcane/iris/engine/object/entity/spawn/IrisSpawnGroup.java
rename to src/main/java/art/arcane/iris/builtin/spawn/SpawnGroup.java
index 20f8b65f1..0e2b1abd8 100644
--- a/src/main/java/art/arcane/iris/engine/object/entity/spawn/IrisSpawnGroup.java
+++ b/src/main/java/art/arcane/iris/builtin/spawn/SpawnGroup.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,12 +16,12 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.entity.spawn;
+package art.arcane.iris.builtin.spawn;
-import art.arcane.iris.engine.object.annotations.Desc;
+import com.volmit.config.Desc;
@Desc("Terrain modes are used to decide the generator type currently used")
-public enum IrisSpawnGroup {
+public enum SpawnGroup {
@Desc("Spawns on the terrain surface")
NORMAL,
diff --git a/src/main/java/art/arcane/iris/engine/object/marker/IrisMarker.java b/src/main/java/art/arcane/iris/builtin/spawn/SpawnMarker.java
similarity index 51%
rename from src/main/java/art/arcane/iris/engine/object/marker/IrisMarker.java
rename to src/main/java/art/arcane/iris/builtin/spawn/SpawnMarker.java
index 1cb419299..249b8fb5a 100644
--- a/src/main/java/art/arcane/iris/engine/object/marker/IrisMarker.java
+++ b/src/main/java/art/arcane/iris/builtin/spawn/SpawnMarker.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,32 +16,22 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.marker;
+package art.arcane.iris.builtin.spawn;
-import art.arcane.iris.engine.object.entity.spawn.IrisSpawner;
-import art.arcane.iris.core.loader.IrisRegistrant;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.RegistryListResource;
-import art.arcane.volmlib.util.collection.KList;
-import art.arcane.volmlib.util.math.RNG;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
+import com.volmit.config.Desc;
+import com.volmit.config.MinItems;
+import com.volmit.config.ResourceRef;
-@Accessors(chain = true)
-@AllArgsConstructor
-@NoArgsConstructor
+import java.util.Collections;
+import java.util.List;
+
+/** A marker of the pack, one file of {@code markers/}: object placements put markers in the world and a marker names the spawners that fire there. */
@Desc("Represents a marker")
-@Data
-@EqualsAndHashCode(callSuper = false)
-public class IrisMarker extends IrisRegistrant {
+public final class SpawnMarker {
@Desc("A list of spawners to add to anywhere this marker is.")
- @RegistryListResource(IrisSpawner.class)
- @ArrayType(type = String.class, min = 1)
- private KList spawners = new KList<>();
+ @ResourceRef(Spawner.class)
+ @MinItems(1)
+ private List spawners = List.of();
@Desc("Remove this marker when the block it's assigned to is changed.")
private boolean removeOnChange = true;
@@ -52,17 +42,23 @@ public class IrisMarker extends IrisRegistrant {
@Desc("If this marker is used, what is the chance it removes itself. For example 25% (0.25) would mean that on average 4 uses will remove a specific marker. Set this below 0 (-1) to never exhaust & set this to 1 or higher to always exhaust on first use.")
private double exhaustionChance = 0;
- public boolean shouldExhaust() {
- return exhaustionChance > RNG.r.nextDouble();
+ public SpawnMarker() {
}
- @Override
- public String getFolderName() {
- return "markers";
+ /** The keys of the spawners that fire at the marker. */
+ public List spawners() {
+ return spawners == null ? List.of() : Collections.unmodifiableList(spawners);
}
- @Override
- public String getTypeName() {
- return "Marker";
+ public boolean removeOnChange() {
+ return removeOnChange;
+ }
+
+ public boolean emptyAbove() {
+ return emptyAbove;
+ }
+
+ public double exhaustionChance() {
+ return exhaustionChance;
}
}
diff --git a/src/main/java/art/arcane/iris/engine/object/value/IrisRate.java b/src/main/java/art/arcane/iris/builtin/spawn/SpawnRate.java
similarity index 54%
rename from src/main/java/art/arcane/iris/engine/object/value/IrisRate.java
rename to src/main/java/art/arcane/iris/builtin/spawn/SpawnRate.java
index f347b6085..05e226551 100644
--- a/src/main/java/art/arcane/iris/engine/object/value/IrisRate.java
+++ b/src/main/java/art/arcane/iris/builtin/spawn/SpawnRate.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,42 +16,35 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.value;
+package art.arcane.iris.builtin.spawn;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.volmlib.util.format.Form;
-import art.arcane.volmlib.util.scheduling.ChronoLatch;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
+import com.volmit.config.Desc;
+import com.volmit.config.Snippet;
@Snippet("rate")
-@NoArgsConstructor
-@AllArgsConstructor
-@Data
@Desc("Represents a count of something per time duration")
-public class IrisRate {
+public final class SpawnRate {
@Desc("The amount of things. Leave 0 for infinite (meaning always spawn whenever)")
private int amount = 0;
@Desc("The time interval. Leave blank for infinite 0 (meaning always spawn all the time)")
- private IrisDuration per = new IrisDuration();
+ private SpawnDuration per = new SpawnDuration();
- public String toString() {
- return Form.f(amount) + "/" + per;
+ public SpawnRate() {
}
- public long getInterval() {
- long t = per.toMilliseconds() / (amount == 0 ? 1 : amount);
+ /** The milliseconds between two things: the interval divided by the amount, at least 1. */
+ public long interval() {
+ long t = duration().toMilliseconds() / (amount == 0 ? 1 : amount);
return Math.abs(t <= 0 ? 1 : t);
}
- public ChronoLatch toChronoLatch() {
- return new ChronoLatch(getInterval());
+ /** Whether there is no limit: no interval was given. */
+ public boolean isInfinite() {
+ return duration().toMilliseconds() == 0;
}
- public boolean isInfinite() {
- return per.toMilliseconds() == 0;
+ private SpawnDuration duration() {
+ return per == null ? new SpawnDuration() : per;
}
}
diff --git a/src/main/java/art/arcane/iris/engine/object/entity/spawn/IrisSurface.java b/src/main/java/art/arcane/iris/builtin/spawn/SpawnSurface.java
similarity index 79%
rename from src/main/java/art/arcane/iris/engine/object/entity/spawn/IrisSurface.java
rename to src/main/java/art/arcane/iris/builtin/spawn/SpawnSurface.java
index 8a7677d15..45a9ad3c8 100644
--- a/src/main/java/art/arcane/iris/engine/object/entity/spawn/IrisSurface.java
+++ b/src/main/java/art/arcane/iris/builtin/spawn/SpawnSurface.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,12 +16,12 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.entity.spawn;
+package art.arcane.iris.builtin.spawn;
-import art.arcane.iris.engine.object.annotations.Desc;
+import com.volmit.config.Desc;
@Desc("The type of surface entities should spawn on")
-public enum IrisSurface {
+public enum SpawnSurface {
@Desc("Land surfaces")
LAND,
@@ -36,5 +36,5 @@ public enum IrisSurface {
OVERWORLD,
@Desc("Within lava")
- LAVA;
+ LAVA
}
diff --git a/src/main/java/art/arcane/iris/engine/object/world/IrisTimeBlock.java b/src/main/java/art/arcane/iris/builtin/spawn/SpawnTimeBlock.java
similarity index 71%
rename from src/main/java/art/arcane/iris/engine/object/world/IrisTimeBlock.java
rename to src/main/java/art/arcane/iris/builtin/spawn/SpawnTimeBlock.java
index b4035203c..5fc38b4b9 100644
--- a/src/main/java/art/arcane/iris/engine/object/world/IrisTimeBlock.java
+++ b/src/main/java/art/arcane/iris/builtin/spawn/SpawnTimeBlock.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,30 +16,29 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.world;
+package art.arcane.iris.builtin.spawn;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.Snippet;
-import art.arcane.iris.spi.PlatformWorld;
-import lombok.Data;
+import com.volmit.config.Desc;
+import com.volmit.config.Snippet;
@Snippet("time-block")
-@Data
@Desc("Represents a time of day (24h time, not 12h am/pm). Set both to the same number for any time. If they are both set to -1, it will always be not allowed.")
-public class IrisTimeBlock {
+public final class SpawnTimeBlock {
+ private static final double NEVER = -1;
+
@Desc("The beginning hour. Set both to the same number for any time. If they are both set to -1, it will always be not allowed.")
private double startHour = 0;
@Desc("The ending hour. Set both to the same number for any time. If they are both set to -1, it will always be not allowed.")
private double endHour = 0;
- public boolean isWithin(PlatformWorld world) {
- return isWithin(((world.getTime() / 1000D) + 6) % 24);
+ public SpawnTimeBlock() {
}
- public boolean isWithin(double hour) {
+ /** Whether {@code hour}, a time of day from 0 to 24, lies in the block; a block that wraps past midnight includes both ends. */
+ public boolean contains(double hour) {
if (startHour == endHour) {
- return endHour != -1;
+ return endHour != NEVER;
}
if (startHour > endHour) {
diff --git a/src/main/java/art/arcane/iris/engine/object/world/IrisWeather.java b/src/main/java/art/arcane/iris/builtin/spawn/SpawnWeather.java
similarity index 65%
rename from src/main/java/art/arcane/iris/engine/object/world/IrisWeather.java
rename to src/main/java/art/arcane/iris/builtin/spawn/SpawnWeather.java
index db242e502..a19bd6eda 100644
--- a/src/main/java/art/arcane/iris/engine/object/world/IrisWeather.java
+++ b/src/main/java/art/arcane/iris/builtin/spawn/SpawnWeather.java
@@ -1,6 +1,6 @@
/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,13 +16,12 @@
* along with this program. If not, see .
*/
-package art.arcane.iris.engine.object.world;
+package art.arcane.iris.builtin.spawn;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.spi.PlatformWorld;
+import com.volmit.config.Desc;
@Desc("Represents a weather type")
-public enum IrisWeather {
+public enum SpawnWeather {
@Desc("Represents when weather is not causing downfall")
NONE,
@@ -35,11 +34,12 @@ public enum IrisWeather {
@Desc("Any weather")
ANY;
- public boolean is(PlatformWorld world) {
+ /** Whether the weather of a world, which is {@code storming} and {@code thundering} or neither, is this one. */
+ public boolean matches(boolean storming, boolean thundering) {
return switch (this) {
- case NONE -> !world.isStorming() && !world.isThundering();
- case DOWNFALL -> world.isStorming();
- case DOWNFALL_WITH_THUNDER -> world.isStorming() && world.isThundering();
+ case NONE -> !storming && !thundering;
+ case DOWNFALL -> storming;
+ case DOWNFALL_WITH_THUNDER -> storming && thundering;
case ANY -> true;
};
}
diff --git a/src/main/java/art/arcane/iris/builtin/spawn/Spawner.java b/src/main/java/art/arcane/iris/builtin/spawn/Spawner.java
new file mode 100644
index 000000000..e688df757
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/spawn/Spawner.java
@@ -0,0 +1,98 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.spawn;
+
+import com.volmit.config.Desc;
+import com.volmit.config.MinItems;
+import com.volmit.config.Range;
+
+import java.util.Collections;
+import java.util.List;
+
+/** A spawner of the pack, one file of {@code spawners/}: which entities appear where, when and how often. */
+@Desc("Represents an entity spawn during initial chunk generation")
+public final class Spawner {
+ @MinItems(1)
+ @Desc("The entity spawns to add")
+ private List spawns = List.of();
+
+ @MinItems(1)
+ @Desc("The entity spawns to add initially. EXECUTES PER CHUNK!")
+ private List initialSpawns = List.of();
+
+ @Desc("This spawner will not spawn in a given chunk if that chunk has more than the defined amount of living entities.")
+ private int maxEntitiesPerChunk = 1;
+
+ @Desc("The block of 24 hour time to contain this spawn in.")
+ private SpawnTimeBlock timeBlock = new SpawnTimeBlock();
+
+ @Desc("The weather condition required for this spawner to fire.")
+ private SpawnWeather weather = SpawnWeather.ANY;
+
+ @Desc("The maximum rate this spawner can fire")
+ private SpawnRate maximumRate = new SpawnRate();
+
+ @Desc("The maximum rate this spawner can fire on a specific chunk")
+ private SpawnRate maximumRatePerChunk = new SpawnRate();
+
+ @Desc("The light levels this spawn is allowed to run in (0-15 inclusive)")
+ private Range allowedLightLevels = Range.of(0, 15);
+
+ @Desc("Where should these spawns be placed")
+ private SpawnGroup group = SpawnGroup.NORMAL;
+
+ public Spawner() {
+ }
+
+ public List spawns() {
+ return spawns == null ? List.of() : Collections.unmodifiableList(spawns);
+ }
+
+ public List initialSpawns() {
+ return initialSpawns == null ? List.of() : Collections.unmodifiableList(initialSpawns);
+ }
+
+ public int maxEntitiesPerChunk() {
+ return maxEntitiesPerChunk;
+ }
+
+ public SpawnTimeBlock timeBlock() {
+ return timeBlock == null ? new SpawnTimeBlock() : timeBlock;
+ }
+
+ public SpawnWeather weather() {
+ return weather == null ? SpawnWeather.ANY : weather;
+ }
+
+ public SpawnRate maximumRate() {
+ return maximumRate == null ? new SpawnRate() : maximumRate;
+ }
+
+ public SpawnRate maximumRatePerChunk() {
+ return maximumRatePerChunk == null ? new SpawnRate() : maximumRatePerChunk;
+ }
+
+ public Range allowedLightLevels() {
+ return allowedLightLevels == null ? Range.of(0, 15) : allowedLightLevels;
+ }
+
+ public SpawnGroup group() {
+ return group == null ? SpawnGroup.NORMAL : group;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/spawn/SpawnerSettings.java b/src/main/java/art/arcane/iris/builtin/spawn/SpawnerSettings.java
new file mode 100644
index 000000000..b4e976c52
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/spawn/SpawnerSettings.java
@@ -0,0 +1,49 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.spawn;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.MinItems;
+import com.volmit.config.ResourceRef;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * The spawners one dimension, region or biome lists, written as {@code "entitySpawners": [...]}, the keys of the
+ * {@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})
+public final class SpawnerSettings implements IrisFeature {
+ @MinItems(1)
+ @ResourceRef(Spawner.class)
+ @Desc("Entity spawners to add to this area")
+ private List spawners = List.of();
+
+ public SpawnerSettings() {
+ }
+
+ public List spawners() {
+ return spawners == null ? List.of() : Collections.unmodifiableList(spawners);
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/CaveCeilingLayersSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/CaveCeilingLayersSettings.java
new file mode 100644
index 000000000..e8ce22b91
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/CaveCeilingLayersSettings.java
@@ -0,0 +1,43 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+
+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)
+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 layers = List.of();
+
+ public CaveCeilingLayersSettings() {
+ }
+
+ public List layers() {
+ return layers == null ? List.of() : layers;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/FluidPaletteSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/FluidPaletteSettings.java
new file mode 100644
index 000000000..3dbaef879
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/FluidPaletteSettings.java
@@ -0,0 +1,47 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.block.BlockSpec;
+import com.volmit.block.PaletteSpec;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+
+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)
+public final class FluidPaletteSettings implements IrisFeature {
+ private static final String DEFAULT_BLOCK = "water";
+
+ @Desc("The dimension fluid block palette used for ocean columns and cave aquifers.")
+ private PaletteSpec palette = PaletteSpec.of(List.of(BlockSpec.of(DEFAULT_BLOCK)));
+
+ public FluidPaletteSettings() {
+ }
+
+ public PaletteSpec palette() {
+ return palette == null ? PaletteSpec.of(List.of(BlockSpec.of(DEFAULT_BLOCK))) : palette;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/HideOresSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/HideOresSettings.java
new file mode 100644
index 000000000..afebc3443
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/HideOresSettings.java
@@ -0,0 +1,46 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+
+/**
+ * A dimension's {@code hideOresForHiddenOre}: whether every ore block the generator would place is replaced with its base
+ * 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)
+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;
+
+ public HideOresSettings() {
+ }
+
+ public HideOresSettings(boolean hide) {
+ this.hide = hide;
+ }
+
+ public boolean hide() {
+ return hide;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/LayerBlocks.java b/src/main/java/art/arcane/iris/builtin/terrain/LayerBlocks.java
new file mode 100644
index 000000000..6ae0f400b
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/LayerBlocks.java
@@ -0,0 +1,129 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import art.arcane.volmlib.util.math.RNG;
+import com.volmit.block.BlockRegistry;
+import com.volmit.block.BlockSpec;
+import com.volmit.block.BlockState;
+import com.volmit.noise.NoiseSampler;
+import com.volmit.resource.PackResources;
+import com.volmit.world.PackWorld;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * What the blocks of the biomes' palette layers ({@link PaletteLayer}) are in one world, and which of them a layer picks
+ * where. Terrain, caves and post processing all pick from the same layers (a biome's wall is painted in caves and on
+ * cliffs), and a layer's block noise is built once per world, from the random of whichever of them asks first, as layers
+ * always were. So the picks live here, in the world's state under this class, which the compiled-in built-ins and the
+ * built-ins jar both see: one place, one noise per layer, whichever module asks.
+ */
+public final class LayerBlocks {
+ /** A layer without blocks picks none. */
+ public static final int NONE = -1;
+
+ private final PackResources resources;
+ private final Map picks = new ConcurrentHashMap<>();
+
+ private LayerBlocks(PackResources resources) {
+ this.resources = resources;
+ }
+
+ /** The layer blocks of {@code world}. */
+ public static LayerBlocks of(PackWorld world) {
+ return world.state(LayerBlocks.class, created -> new LayerBlocks(created.resources()));
+ }
+
+ /** The layer's blocks resolved for the world's pack, each repeated by its weight: what an index from {@link #pick} names. */
+ public List blocks(PaletteLayer layer) {
+ return picksOf(layer).blocks();
+ }
+
+ /**
+ * The index into {@link #blocks(PaletteLayer)} the layer picks at the position, or {@link #NONE} when it has no block.
+ * The noise is seeded from {@code parent} and {@code signature} the first time anyone asks about this layer; a pick
+ * outside the palette falls back to its first block.
+ */
+ public int pick(PaletteLayer layer, RNG parent, int signature, double x, double y, double z) {
+ Picks layerPicks = picksOf(layer);
+ int size = layerPicks.blocks().size();
+ if (size <= 1) {
+ return size - 1;
+ }
+ double zoom = layer.zoom();
+ double noise = layerPicks.noise(parent, signature).sample(x / zoom, y / zoom, z / zoom);
+ int index = (int) Math.round(noise * (size - 1));
+ return index < 0 || index >= size ? 0 : index;
+ }
+
+ private Picks picksOf(PaletteLayer layer) {
+ Picks known = picks.get(layer);
+ if (known != null) {
+ return known;
+ }
+ return picks.computeIfAbsent(layer, declared -> new Picks(declared, weighted(resources.blocks(), declared.palette()), resources));
+ }
+
+ private static List weighted(BlockRegistry registry, List palette) {
+ List weighted = new ArrayList<>();
+ for (BlockSpec spec : palette) {
+ BlockState block = registry.resolve(spec);
+ for (int n = 0; n < spec.weight(); n++) {
+ weighted.add(block);
+ }
+ }
+ return List.copyOf(weighted);
+ }
+
+ /** One layer's blocks and its block noise, built by the first caller. */
+ private static final class Picks {
+ private final PaletteLayer layer;
+ private final List blocks;
+ private final PackResources resources;
+ private volatile NoiseSampler noise;
+
+ Picks(PaletteLayer layer, List blocks, PackResources resources) {
+ this.layer = layer;
+ this.blocks = blocks;
+ this.resources = resources;
+ }
+
+ List blocks() {
+ return blocks;
+ }
+
+ NoiseSampler noise(RNG parent, int signature) {
+ NoiseSampler built = noise;
+ if (built != null) {
+ return built;
+ }
+ synchronized (this) {
+ if (noise == null) {
+ long seed = parent.nextParallelRNG(signature).nextParallelRNG(layer.minHeight() + layer.maxHeight() + blocks.size()).getSeed();
+ noise = resources.noise().sampler(layer.style(), seed);
+ }
+ return noise;
+ }
+ }
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/LayersSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/LayersSettings.java
new file mode 100644
index 000000000..02f2ba399
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/LayersSettings.java
@@ -0,0 +1,44 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+
+import java.util.List;
+
+/**
+ * The layers of material a biome is made of below its surface, written as {@code "layers": [...]}, the list of layers. A biome
+ * 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)
+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 layers = List.of(new PaletteLayer());
+
+ public LayersSettings() {
+ }
+
+ public List layers() {
+ return layers == null ? List.of() : layers;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/LockLayersMaxSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/LockLayersMaxSettings.java
new file mode 100644
index 000000000..9b18cf7f1
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/LockLayersMaxSettings.java
@@ -0,0 +1,41 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+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)
+public final class LockLayersMaxSettings implements IrisFeature {
+ public static final int DEFAULT_LAYERS = 7;
+
+ @Desc("The max layers to iterate below the surface for locked layer biomes (mesa).")
+ private int layers = DEFAULT_LAYERS;
+
+ public LockLayersMaxSettings() {
+ }
+
+ public int layers() {
+ return layers;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/LockLayersSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/LockLayersSettings.java
new file mode 100644
index 000000000..a8a98063c
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/LockLayersSettings.java
@@ -0,0 +1,39 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+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)
+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;
+
+ public LockLayersSettings() {
+ }
+
+ public boolean locked() {
+ return locked;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/OreGenerator.java b/src/main/java/art/arcane/iris/builtin/terrain/OreGenerator.java
new file mode 100644
index 000000000..1f9cb8f47
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/OreGenerator.java
@@ -0,0 +1,80 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.block.PaletteSpec;
+import com.volmit.config.Desc;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Range;
+import com.volmit.noise.NoiseStyle;
+
+import java.util.List;
+
+/**
+ * One ore generator of a dimension, region or biome, an entry of its {@code ores} list: single ore blocks scattered
+ * through the terrain by a noise field, in a vertical band. A value of IrisApi types only; the terrain module resolves
+ * its blocks and builds its noise ({@code ResolvedOre}).
+ */
+@Desc("Scatters single ore blocks through terrain by sampling a noise field at every block in a vertical band. Defined on dimensions, regions, or biomes; the most specific level wins.")
+public final class OreGenerator {
+ private static final double DEFAULT_THRESHOLD = 0.5;
+ private static final double DEFAULT_RANGE_MIN = 30;
+ private static final double DEFAULT_RANGE_MAX = 80;
+
+ @Desc("The ore blocks to place. An empty palette generates nothing, so this must be set for the generator to have any effect.")
+ private PaletteSpec palette = PaletteSpec.of(List.of());
+
+ @Desc("The noise style sampled per block to decide where ore appears. STATIC gives independent random speckle; smoother styles give veiny clusters.")
+ private NoiseStyle chanceStyle = NoiseStyle.of("STATIC");
+
+ @Desc("When true this generator also replaces surface-layer blocks (it runs before layers and fluid); when false it only replaces underground rock.")
+ private boolean generateSurface = false;
+
+ @MinNumber(0)
+ @MaxNumber(1)
+ @Desc("Noise cutoff: a block becomes ore when the sampled noise is at or below this value, so higher means more ore. 0 disables, 1 replaces everything in range.")
+ private double threshold = DEFAULT_THRESHOLD;
+
+ @Desc("Vertical band (min, max) this ore can generate in, in engine-local Y where 0 is the bottom of the dimension, not world Y.")
+ private Range range = Range.of(DEFAULT_RANGE_MIN, DEFAULT_RANGE_MAX);
+
+ public OreGenerator() {
+ }
+
+ public PaletteSpec palette() {
+ return palette;
+ }
+
+ public NoiseStyle chanceStyle() {
+ return chanceStyle;
+ }
+
+ public boolean generateSurface() {
+ return generateSurface;
+ }
+
+ public double threshold() {
+ return threshold;
+ }
+
+ public Range range() {
+ return range;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/OreSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/OreSettings.java
new file mode 100644
index 000000000..ae2d39553
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/OreSettings.java
@@ -0,0 +1,52 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+import com.volmit.config.MinItems;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * The ore generators one dimension, region or biome declares, written as {@code "ores": [...]}, the list of generators.
+ * Levels stack: a column's ores come from its biome first, then its region, then the dimension. IrisApi types only,
+ * 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})
+public final class OreSettings implements IrisFeature {
+ @MinItems(1)
+ @Desc("Collection of ores to be generated")
+ private List generators = List.of();
+
+ public OreSettings() {
+ }
+
+ public OreSettings(List generators) {
+ this.generators = List.copyOf(generators);
+ }
+
+ public List generators() {
+ return generators == null ? List.of() : Collections.unmodifiableList(generators);
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/PaletteLayer.java b/src/main/java/art/arcane/iris/builtin/terrain/PaletteLayer.java
new file mode 100644
index 000000000..a6d68d388
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/PaletteLayer.java
@@ -0,0 +1,103 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import art.arcane.iris.builtin.prepare.SlopeClip;
+import com.volmit.block.BlockSpec;
+import com.volmit.config.Desc;
+import com.volmit.config.MaxNumber;
+import com.volmit.config.MinItems;
+import com.volmit.config.MinNumber;
+import com.volmit.config.Required;
+import com.volmit.config.Snippet;
+import com.volmit.noise.NoiseStyle;
+
+import java.util.List;
+
+/**
+ * One layer of surface or subsurface material of a biome, as packs write it in the biome's layers, sea layers, cave
+ * ceiling layers, slab and wall, in a floating island's bottom palette or under {@code snippet/biome-palette/}. A value of
+ * IrisApi types only; the terrain module resolves the blocks and builds the noise.
+ */
+@Snippet("biome-palette")
+@Desc("A layer of surface / subsurface material in biomes")
+public final class PaletteLayer {
+ private static final String STATIC_NOISE = "STATIC";
+ private static final String DEFAULT_BLOCK = "grass_block";
+
+ @Desc("The style of noise")
+ private NoiseStyle style = NoiseStyle.of(STATIC_NOISE);
+
+ @MinNumber(0)
+ @MaxNumber(2032)
+ @Desc("The min thickness of this layer")
+ private int minHeight = 1;
+
+ @MinNumber(1)
+ @MaxNumber(2032)
+ @Desc("The max thickness of this layer")
+ private int maxHeight = 1;
+
+ @Desc("If set, this layer only shows where the terrain slope is within these bounds; outside them the layer is skipped entirely. Thickness is not scaled by slope.")
+ private SlopeClip slopeCondition = new SlopeClip();
+
+ @MinNumber(0.0001)
+ @Desc("The terrain zoom mostly for zooming in on a wispy palette")
+ private double zoom = 5;
+
+ @Required
+ @MinItems(1)
+ @Desc("The palette of blocks to be used in this layer")
+ private List palette = List.of(BlockSpec.of(DEFAULT_BLOCK));
+
+ /** A layer with every option at its default, as packs get it from {@code {}}. */
+ public PaletteLayer() {
+ }
+
+ /** A layer with the default options and no block to place, which is what a biome without a slab or wall has. */
+ public static PaletteLayer withoutBlocks() {
+ PaletteLayer layer = new PaletteLayer();
+ layer.palette = List.of();
+ return layer;
+ }
+
+ public NoiseStyle style() {
+ return style == null ? NoiseStyle.of(STATIC_NOISE) : style;
+ }
+
+ public int minHeight() {
+ return minHeight;
+ }
+
+ public int maxHeight() {
+ return maxHeight;
+ }
+
+ public SlopeClip slopeCondition() {
+ return slopeCondition == null ? new SlopeClip() : slopeCondition;
+ }
+
+ public double zoom() {
+ return zoom;
+ }
+
+ public List palette() {
+ return palette == null ? List.of() : palette;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/RockPaletteSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/RockPaletteSettings.java
new file mode 100644
index 000000000..786c25326
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/RockPaletteSettings.java
@@ -0,0 +1,47 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.block.BlockSpec;
+import com.volmit.block.PaletteSpec;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+
+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)
+public final class RockPaletteSettings implements IrisFeature {
+ private static final String DEFAULT_BLOCK = "stone";
+
+ @Desc("The palette of blocks for 'stone'")
+ private PaletteSpec palette = PaletteSpec.of(List.of(BlockSpec.of(DEFAULT_BLOCK)));
+
+ public RockPaletteSettings() {
+ }
+
+ public PaletteSpec palette() {
+ return palette == null ? PaletteSpec.of(List.of(BlockSpec.of(DEFAULT_BLOCK))) : palette;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/SeaLayersSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/SeaLayersSettings.java
new file mode 100644
index 000000000..d6693e572
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/SeaLayersSettings.java
@@ -0,0 +1,43 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+
+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)
+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 layers = List.of();
+
+ public SeaLayersSettings() {
+ }
+
+ public List layers() {
+ return layers == null ? List.of() : layers;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/SlabSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/SlabSettings.java
new file mode 100644
index 000000000..a9f1d9f0d
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/SlabSettings.java
@@ -0,0 +1,41 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+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)
+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();
+
+ public SlabSettings() {
+ }
+
+ public PaletteLayer layer() {
+ return layer == null ? PaletteLayer.withoutBlocks() : layer;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/builtin/terrain/WallSettings.java b/src/main/java/art/arcane/iris/builtin/terrain/WallSettings.java
new file mode 100644
index 000000000..4c700b1e4
--- /dev/null
+++ b/src/main/java/art/arcane/iris/builtin/terrain/WallSettings.java
@@ -0,0 +1,42 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.builtin.terrain;
+
+import com.volmit.FeatureAttachment.Target;
+import com.volmit.IrisFeature;
+import com.volmit.config.Desc;
+import com.volmit.config.Feature;
+
+/**
+ * The wall post processing paints on steep faces, and caves paint on their walls, in a biome, written as {@code "wall": {...}}, one layer.
+ * 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)
+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();
+
+ public WallSettings() {
+ }
+
+ public PaletteLayer layer() {
+ return layer == null ? PaletteLayer.withoutBlocks() : layer;
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/actuator/HiddenOres.java b/src/main/java/art/arcane/iris/engine/actuator/HiddenOres.java
new file mode 100644
index 000000000..48b5a3535
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/actuator/HiddenOres.java
@@ -0,0 +1,32 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.engine.actuator;
+
+import art.arcane.iris.builtin.terrain.HideOresSettings;
+import art.arcane.iris.engine.object.world.dimension.IrisDimension;
+
+/** Whether a dimension hides its ores ({@code hideOresForHiddenOre}): the terrain places none and the perfection pass turns the rest into their base blocks. */
+public final class HiddenOres {
+ private HiddenOres() {
+ }
+
+ public static boolean in(IrisDimension dimension) {
+ return dimension.getModuleSettings().find(HideOresSettings.class).map(HideOresSettings::hide).orElse(false);
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/actuator/OreWarmUp.java b/src/main/java/art/arcane/iris/engine/actuator/OreWarmUp.java
index 0e5bbbaf9..11935ef1f 100644
--- a/src/main/java/art/arcane/iris/engine/actuator/OreWarmUp.java
+++ b/src/main/java/art/arcane/iris/engine/actuator/OreWarmUp.java
@@ -19,55 +19,52 @@
package art.arcane.iris.engine.actuator;
import art.arcane.iris.engine.framework.Engine;
-import art.arcane.iris.engine.object.terrain.deposit.IrisOreGenerator;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
import art.arcane.iris.engine.object.world.region.IrisRegion;
import art.arcane.volmlib.util.collection.KList;
import art.arcane.volmlib.util.math.RNG;
import java.util.Comparator;
+import java.util.function.LongSupplier;
/**
* Builds the noise of every ore generator the world's biomes, regions and dimension declare before generation needs it.
- * A generator keeps the noise of the first random it is given, so each one is warmed with the random of its place in
+ * A generator keeps the noise of the first seed it is given, so each one is warmed with the seed of its place in
* this order: the biomes by key, the regions by key, then the dimension. The order is part of what a world generates.
*/
final class OreWarmUp {
private static final long ROOT_SEED_SALT = 7777L;
private final Engine engine;
+ private final TerrainOres ores;
private final RNG root;
private int warmed;
OreWarmUp(Engine engine) {
+ this(engine, TerrainOres.of(engine));
+ }
+
+ OreWarmUp(Engine engine, TerrainOres ores) {
this.engine = engine;
+ this.ores = ores;
this.root = new RNG(engine.getSeedManager().getComponent() + ROOT_SEED_SALT);
}
void warm() {
+ LongSupplier seeds = () -> root.nextParallelRNG(warmed++).getSeed();
+
KList biomes = engine.getAllBiomes();
biomes.sort(Comparator.comparing(IrisBiome::getLoadKey));
for (IrisBiome biome : biomes) {
- warmAll(biome.getOres());
+ ores.of(biome).warm(seeds);
}
KList regions = engine.getDimension().getAllRegions(engine);
regions.sort(Comparator.comparing(IrisRegion::getLoadKey));
for (IrisRegion region : regions) {
- warmAll(region.getOres());
+ ores.of(region).warm(seeds);
}
- warmAll(engine.getDimension().getOres());
- }
-
- private void warmAll(KList ores) {
- if (ores == null) {
- return;
- }
- for (IrisOreGenerator ore : ores) {
- if (ore != null) {
- ore.warm(root.nextParallelRNG(warmed++), engine.getData());
- }
- }
+ ores.of(engine.getDimension()).warm(seeds);
}
}
diff --git a/src/main/java/art/arcane/iris/engine/actuator/ResolvedOre.java b/src/main/java/art/arcane/iris/engine/actuator/ResolvedOre.java
new file mode 100644
index 000000000..721dbbb0c
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/actuator/ResolvedOre.java
@@ -0,0 +1,133 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.engine.actuator;
+
+import art.arcane.iris.builtin.terrain.OreGenerator;
+import art.arcane.iris.engine.data.cache.AtomicCache;
+import art.arcane.iris.engine.framework.Engine;
+import art.arcane.iris.spi.PlatformBlockState;
+import art.arcane.iris.util.common.data.B;
+import com.volmit.block.BlockRegistry;
+import com.volmit.block.BlockSpec;
+import com.volmit.block.PaletteSampler;
+import com.volmit.noise.NoiseFactory;
+import com.volmit.noise.NoiseSampler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * One {@link OreGenerator} made ready for one world: its palette resolved to the platform's blocks and the noise that
+ * decides where it places ore, built from the seed it is warmed with or, when nothing warmed it, from the terrain seed
+ * of its first use. The palette picks with the terrain seed. What the generator describes stays in the settings;
+ * everything that needs the platform, the pack or the world seed is here.
+ */
+final class ResolvedOre {
+ private final OreGenerator settings;
+ private final NoiseFactory noise;
+ private final BlockRegistry blockRegistry;
+ private final long terrainSeed;
+ private final List blocks;
+ private final AtomicCache chance = new AtomicCache<>();
+ private final AtomicCache palette = new AtomicCache<>();
+
+ /**
+ * @param terrainSeed the seed the palette picks with, and the noise is built from when nothing warmed it first
+ * @param blocks the palette as the platform's blocks, each repeated by its weight
+ */
+ ResolvedOre(OreGenerator settings, NoiseFactory noise, BlockRegistry blockRegistry, long terrainSeed, List blocks) {
+ this.settings = settings;
+ this.noise = noise;
+ this.blockRegistry = blockRegistry;
+ this.terrainSeed = terrainSeed;
+ this.blocks = List.copyOf(blocks);
+ }
+
+ /** {@code settings} ready for {@code engine}: its blocks resolved through the pack, its picks seeded with the terrain seed. */
+ static ResolvedOre of(OreGenerator settings, Engine engine) {
+ var resources = engine.getData().getPackResources();
+ BlockRegistry registry = resources.blocks();
+ return new ResolvedOre(settings, resources.noise(), registry, engine.getSeedManager().getTerrain(), weighted(registry, settings.palette().palette()));
+ }
+
+ private static List weighted(BlockRegistry registry, List specs) {
+ List weighted = new ArrayList<>();
+ for (BlockSpec spec : specs) {
+ PlatformBlockState state = B.getState(registry.resolve(spec).key());
+ if (state == null) {
+ continue;
+ }
+ for (int n = 0; n < spec.weight(); n++) {
+ weighted.add(state);
+ }
+ }
+ return weighted;
+ }
+
+ boolean generatesSurface() {
+ return settings.generateSurface();
+ }
+
+ double minY() {
+ return settings.range().min();
+ }
+
+ double maxY() {
+ return settings.range().max();
+ }
+
+ /** Builds the chance noise from {@code seed}, unless it is built already: the first seed it is given is the one it keeps. */
+ void warm(long seed) {
+ chance.aquire(() -> noise.sampler(settings.chanceStyle(), seed));
+ }
+
+ /** The ore block at the position, or null when the position is out of the band, the chance noise is above the threshold or the palette has no block. */
+ PlatformBlockState generate(int x, int y, int z) {
+ if (!settings.range().contains(y)) {
+ return null;
+ }
+ if (settings.palette().palette().isEmpty()) {
+ return null;
+ }
+ if (chanceNoise().sample(x, y, z) > settings.threshold()) {
+ return null;
+ }
+ return pick(x, y, z);
+ }
+
+ /** The chance noise, which this runs per block of the terrain, so a built one is read without creating a supplier. */
+ private NoiseSampler chanceNoise() {
+ NoiseSampler built = chance.getIfPresent();
+ if (built != null) {
+ return built;
+ }
+ return chance.aquire(() -> noise.sampler(settings.chanceStyle(), terrainSeed));
+ }
+
+ private PlatformBlockState pick(int x, int y, int z) {
+ if (blocks.isEmpty()) {
+ return null;
+ }
+ if (blocks.size() == 1) {
+ return blocks.getFirst();
+ }
+ PaletteSampler sampler = palette.aquire(() -> blockRegistry.palette(settings.palette(), terrainSeed));
+ return B.getState(sampler.at(x, y, z).key());
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/actuator/ResolvedOres.java b/src/main/java/art/arcane/iris/engine/actuator/ResolvedOres.java
new file mode 100644
index 000000000..e3df4ad35
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/actuator/ResolvedOres.java
@@ -0,0 +1,119 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.engine.actuator;
+
+import art.arcane.iris.builtin.terrain.OreGenerator;
+import art.arcane.iris.builtin.terrain.OreSettings;
+import art.arcane.iris.engine.framework.Engine;
+import art.arcane.iris.spi.PlatformBlockState;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.LongSupplier;
+
+/**
+ * The ore generators of one dimension, region or biome made ready ({@link ResolvedOre}), in the order its settings list them
+ * and split into the ones that also replace surface blocks and the ones that only replace rock. A level without ores is
+ * {@link #NONE}.
+ */
+final class ResolvedOres {
+ static final ResolvedOres NONE = new ResolvedOres(List.of());
+
+ private final List all;
+ private final List surface;
+ private final List underground;
+ private final YBand surfaceBand;
+ private final YBand undergroundBand;
+
+ ResolvedOres(List all) {
+ this.all = List.copyOf(all);
+ this.surface = this.all.stream().filter(ResolvedOre::generatesSurface).toList();
+ this.underground = this.all.stream().filter(ore -> !ore.generatesSurface()).toList();
+ this.surfaceBand = YBand.of(surface);
+ this.undergroundBand = YBand.of(underground);
+ }
+
+ /** {@code settings} ready for {@code engine}; generators the pack wrote as {@code null} are left out. */
+ static ResolvedOres of(OreSettings settings, Engine engine) {
+ List ores = new ArrayList<>();
+ for (OreGenerator generator : settings.generators()) {
+ if (generator != null) {
+ ores.add(ResolvedOre.of(generator, engine));
+ }
+ }
+ return ores.isEmpty() ? NONE : new ResolvedOres(ores);
+ }
+
+ /** The heights where any surface ore can generate. */
+ YBand surfaceBand() {
+ return surfaceBand;
+ }
+
+ /** The heights where any rock-only ore can generate. */
+ YBand undergroundBand() {
+ return undergroundBand;
+ }
+
+ /** Warms every ore in the order the settings list them, each with the next seed. */
+ void warm(LongSupplier seeds) {
+ for (ResolvedOre ore : all) {
+ ore.warm(seeds.getAsLong());
+ }
+ }
+
+ PlatformBlockState generateSurface(int x, int y, int z) {
+ return firstOre(surface, x, y, z);
+ }
+
+ PlatformBlockState generateUnderground(int x, int y, int z) {
+ return firstOre(underground, x, y, z);
+ }
+
+ private static PlatformBlockState firstOre(List ores, int x, int y, int z) {
+ for (int index = 0; index < ores.size(); index++) {
+ PlatformBlockState ore = ores.get(index).generate(x, y, z);
+ if (ore != null) {
+ return ore;
+ }
+ }
+ return null;
+ }
+
+ /** The lowest and highest height any of a set of ores reaches; empty when there are none. */
+ record YBand(boolean hasOres, double min, double max) {
+ static final YBand EMPTY = new YBand(false, 0, 0);
+
+ static YBand of(List ores) {
+ if (ores.isEmpty()) {
+ return EMPTY;
+ }
+ double min = Double.POSITIVE_INFINITY;
+ double max = Double.NEGATIVE_INFINITY;
+ for (ResolvedOre ore : ores) {
+ min = Math.min(min, ore.minY());
+ max = Math.max(max, ore.maxY());
+ }
+ return new YBand(true, min, max);
+ }
+
+ boolean contains(int y) {
+ return hasOres && y >= min && y <= max;
+ }
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/actuator/TerrainModule.java b/src/main/java/art/arcane/iris/engine/actuator/TerrainModule.java
index 7926c0357..279980029 100644
--- a/src/main/java/art/arcane/iris/engine/actuator/TerrainModule.java
+++ b/src/main/java/art/arcane/iris/engine/actuator/TerrainModule.java
@@ -19,17 +19,29 @@
package art.arcane.iris.engine.actuator;
import art.arcane.iris.builtin.IrisStages;
+import art.arcane.iris.builtin.terrain.CaveCeilingLayersSettings;
+import art.arcane.iris.builtin.terrain.FluidPaletteSettings;
+import art.arcane.iris.builtin.terrain.LayersSettings;
+import art.arcane.iris.builtin.terrain.LockLayersMaxSettings;
+import art.arcane.iris.builtin.terrain.LockLayersSettings;
+import art.arcane.iris.builtin.terrain.RockPaletteSettings;
+import art.arcane.iris.builtin.terrain.SeaLayersSettings;
+import art.arcane.iris.builtin.terrain.SlabSettings;
+import art.arcane.iris.builtin.terrain.WallSettings;
+import art.arcane.iris.builtin.terrain.HideOresSettings;
+import art.arcane.iris.builtin.terrain.OreSettings;
import art.arcane.iris.core.loader.IrisData;
import art.arcane.iris.core.modules.IrisChunk;
import art.arcane.iris.core.modules.IrisPackWorld;
import art.arcane.iris.engine.IrisComplex;
import art.arcane.iris.engine.UpperDimensionContext;
+import art.arcane.iris.engine.actuator.ResolvedOres.YBand;
import art.arcane.iris.engine.framework.Engine;
-import art.arcane.iris.engine.object.terrain.deposit.IrisOreGenerator;
-import art.arcane.iris.engine.object.terrain.deposit.IrisOreGeneratorBounds;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
import art.arcane.iris.engine.object.world.region.IrisRegion;
+import art.arcane.iris.engine.terrain.BiomeLayers;
+import art.arcane.iris.engine.terrain.TerrainPalettes;
import art.arcane.iris.spi.PlatformBlockState;
import art.arcane.iris.util.common.data.B;
import art.arcane.iris.util.project.context.ChunkContext;
@@ -51,7 +63,7 @@ import com.volmit.world.PackWorld;
* Module {@code iris:terrain}: the chunk's ground, fluids and biome layers. Each column is filled from bedrock up
* to its height and the fluid height with its biome's layers, with ore generators of the dimension, region and
* biome replacing blocks on the way and the upper dimension's ground filled in from the top. The ore generators' noise
- * is built ahead of generation, in {@link #warmUp}.
+ * and the rock and fluid palettes' noise are built ahead of generation, in {@link #warmUp}.
*/
public final class TerrainModule implements IrisModule, ModuleLifecycle {
private static final String VERSION = "built-in";
@@ -63,12 +75,25 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
@Override
public void register(FeatureRegistry 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.registerLifecycle(this);
}
@Override
public void warmUp(PackWorld world) {
- new OreWarmUp(IrisPackWorld.of(world).engine()).warm();
+ Engine engine = IrisPackWorld.of(world).engine();
+ TerrainPalettes.of(engine).warm();
+ new OreWarmUp(engine).warm();
}
@Override
@@ -86,10 +111,20 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
private static final PlatformBlockState BEDROCK = B.getState("BEDROCK");
private final Engine engine;
+ private final TerrainPalettes palettes;
+ private final BiomeLayers layers;
+ private final TerrainOres ores;
private final RNG rng;
TerrainShaper(Engine engine) {
+ this(engine, TerrainPalettes.of(engine), BiomeLayers.of(engine), TerrainOres.of(engine));
+ }
+
+ TerrainShaper(Engine engine, TerrainPalettes palettes, BiomeLayers layers, TerrainOres ores) {
this.engine = engine;
+ this.palettes = palettes;
+ this.layers = layers;
+ this.ores = ores;
this.rng = new RNG(engine.getSeedManager().getTerrain());
}
@@ -115,19 +150,16 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
int fluidHeight = dimension.getFluidHeight();
int clampedFluidHeight = Math.min(chunkHeight, fluidHeight);
boolean bedrockEnabled = dimension.isBedrock();
- boolean hideOres = dimension.isHideOresForHiddenOre();
+ boolean hideOres = HiddenOres.in(dimension);
ChunkedDataCache biomeCache = context.getBiome();
ChunkedDataCache regionCache = context.getRegion();
- ChunkedDataCache fluidCache = context.getFluid();
- ChunkedDataCache rockCache = context.getRock();
int realX = xf + x;
UpperDimensionContext upperContext = engine.getUpperContext();
// Dimension-level ore lookups are chunk-invariant; resolving them per column paid
- // four accessor chains times 256 per chunk for constants.
- KList dimensionSurfaceOres = hideOres ? null : dimension.getSurfaceOreGenerators();
- KList dimensionUndergroundOres = hideOres ? null : dimension.getUndergroundOreGenerators();
- IrisOreGeneratorBounds dimensionSurfaceOreBounds = hideOres ? IrisOreGeneratorBounds.EMPTY : dimension.getSurfaceOreGeneratorBounds();
- IrisOreGeneratorBounds dimensionUndergroundOreBounds = hideOres ? IrisOreGeneratorBounds.EMPTY : dimension.getUndergroundOreGeneratorBounds();
+ // the settings lookup times 256 per chunk for a constant.
+ ResolvedOres dimensionOres = hideOres ? ResolvedOres.NONE : ores.of(dimension);
+ YBand dimensionSurfaceBand = dimensionOres.surfaceBand();
+ YBand dimensionUndergroundBand = dimensionOres.undergroundBand();
for (int zf = 0; zf < chunkDepth; zf++) {
int realZ = zf + z;
@@ -140,19 +172,17 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
}
int topY = Math.min(hf, chunkHeight - 1);
- PlatformBlockState fluid = fluidCache.get(xf, zf);
- PlatformBlockState rock = rockCache.get(xf, zf);
+ PlatformBlockState fluid = palettes.fluidAt(realX, realZ);
+ PlatformBlockState rock = palettes.rockAt(realX, realZ);
PlatformBlockState mappedSurfaceBlock = complex.getImageMapRuntime().sampleSurfaceBlock(realX, realZ);
- KList biomeSurfaceOres = hideOres ? null : biome.getSurfaceOreGenerators();
- KList regionSurfaceOres = hideOres ? null : region.getSurfaceOreGenerators();
- KList biomeUndergroundOres = hideOres ? null : biome.getUndergroundOreGenerators();
- KList regionUndergroundOres = hideOres ? null : region.getUndergroundOreGenerators();
- IrisOreGeneratorBounds biomeSurfaceOreBounds = hideOres ? IrisOreGeneratorBounds.EMPTY : biome.getSurfaceOreGeneratorBounds();
- IrisOreGeneratorBounds regionSurfaceOreBounds = hideOres ? IrisOreGeneratorBounds.EMPTY : region.getSurfaceOreGeneratorBounds();
- IrisOreGeneratorBounds biomeUndergroundOreBounds = hideOres ? IrisOreGeneratorBounds.EMPTY : biome.getUndergroundOreGeneratorBounds();
- IrisOreGeneratorBounds regionUndergroundOreBounds = hideOres ? IrisOreGeneratorBounds.EMPTY : region.getUndergroundOreGeneratorBounds();
- boolean hasSurfaceOres = biomeSurfaceOreBounds.hasOres() || regionSurfaceOreBounds.hasOres() || dimensionSurfaceOreBounds.hasOres();
- boolean hasUndergroundOres = biomeUndergroundOreBounds.hasOres() || regionUndergroundOreBounds.hasOres() || dimensionUndergroundOreBounds.hasOres();
+ ResolvedOres biomeOres = hideOres ? ResolvedOres.NONE : ores.of(biome);
+ ResolvedOres regionOres = hideOres ? ResolvedOres.NONE : ores.of(region);
+ YBand biomeSurfaceBand = biomeOres.surfaceBand();
+ YBand regionSurfaceBand = regionOres.surfaceBand();
+ YBand biomeUndergroundBand = biomeOres.undergroundBand();
+ YBand regionUndergroundBand = regionOres.undergroundBand();
+ boolean hasSurfaceOres = biomeSurfaceBand.hasOres() || regionSurfaceBand.hasOres() || dimensionSurfaceBand.hasOres();
+ boolean hasUndergroundOres = biomeUndergroundBand.hasOres() || regionUndergroundBand.hasOres() || dimensionUndergroundBand.hasOres();
KList blocks = null;
KList fblocks = null;
@@ -164,14 +194,14 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
PlatformBlockState ore = null;
if (hasSurfaceOres) {
- if (biomeSurfaceOreBounds.contains(i)) {
- ore = generateOres(biomeSurfaceOres, realX, i, realZ, localRng, data);
+ if (biomeSurfaceBand.contains(i)) {
+ ore = biomeOres.generateSurface(realX, i, realZ);
}
- if (ore == null && regionSurfaceOreBounds.contains(i)) {
- ore = generateOres(regionSurfaceOres, realX, i, realZ, localRng, data);
+ if (ore == null && regionSurfaceBand.contains(i)) {
+ ore = regionOres.generateSurface(realX, i, realZ);
}
- if (ore == null && dimensionSurfaceOreBounds.contains(i)) {
- ore = generateOres(dimensionSurfaceOres, realX, i, realZ, localRng, data);
+ if (ore == null && dimensionSurfaceBand.contains(i)) {
+ ore = dimensionOres.generateSurface(realX, i, realZ);
}
}
if (ore != null) {
@@ -182,7 +212,7 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
if (i > he && i <= hf) {
int fdepth = hf - i;
if (fblocks == null) {
- fblocks = biome.generateSeaLayers(realX, realZ, localRng, hf - he, data);
+ fblocks = layers.generateSeaLayers(biome, realX, realZ, localRng, hf - he, data);
}
if (fblocks.hasIndex(fdepth)) {
@@ -200,7 +230,7 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
continue;
}
if (blocks == null) {
- blocks = biome.generateLayers(dimension, realX, realZ, localRng, he, he, data, complex);
+ blocks = layers.generateLayers(biome, dimension, realX, realZ, localRng, he, he, data, complex);
}
if (blocks.hasIndex(depth)) {
@@ -209,14 +239,14 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
}
if (hasUndergroundOres) {
- if (biomeUndergroundOreBounds.contains(i)) {
- ore = generateOres(biomeUndergroundOres, realX, i, realZ, localRng, data);
+ if (biomeUndergroundBand.contains(i)) {
+ ore = biomeOres.generateUnderground(realX, i, realZ);
}
- if (ore == null && regionUndergroundOreBounds.contains(i)) {
- ore = generateOres(regionUndergroundOres, realX, i, realZ, localRng, data);
+ if (ore == null && regionUndergroundBand.contains(i)) {
+ ore = regionOres.generateUnderground(realX, i, realZ);
}
- if (ore == null && dimensionUndergroundOreBounds.contains(i)) {
- ore = generateOres(dimensionUndergroundOres, realX, i, realZ, localRng, data);
+ if (ore == null && dimensionUndergroundBand.contains(i)) {
+ ore = dimensionOres.generateUnderground(realX, i, realZ);
}
}
@@ -235,11 +265,11 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
if (upperSurfaceY < chunkHeight - 1) {
IrisBiome upperBiome = upperContext.getUpperBiome(realX, realZ);
- PlatformBlockState upperRock = upperContext.getRockBlock(realX, realZ);
+ PlatformBlockState upperRock = palettes.upperRockAt(upperContext, realX, realZ);
PlatformBlockState upperMappedSurface = upperContext.getSurfaceBlock(realX, realZ);
int upperThickness = chunkHeight - 1 - upperSurfaceY;
KList upperBlocks = upperBiome != null
- ? upperBiome.generateLayers(upperContext.getDimension(),
+ ? layers.generateLayers(upperBiome, upperContext.getDimension(),
realX, realZ, localRng, upperThickness, upperThickness,
upperContext.getData(), complex)
: null;
@@ -264,22 +294,5 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
}
}
}
-
- private PlatformBlockState generateOres(KList oreGenerators, int x, int y, int z, RNG rng, IrisData data) {
- if (oreGenerators == null || oreGenerators.isEmpty()) {
- return null;
- }
-
- int oreCount = oreGenerators.size();
- for (int oreIndex = 0; oreIndex < oreCount; oreIndex++) {
- IrisOreGenerator oreGenerator = oreGenerators.get(oreIndex);
- PlatformBlockState ore = oreGenerator.generate(x, y, z, rng, data);
- if (ore != null) {
- return ore;
- }
- }
-
- return null;
- }
}
}
diff --git a/src/main/java/art/arcane/iris/engine/actuator/TerrainOres.java b/src/main/java/art/arcane/iris/engine/actuator/TerrainOres.java
new file mode 100644
index 000000000..1eb73d719
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/actuator/TerrainOres.java
@@ -0,0 +1,60 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.engine.actuator;
+
+import art.arcane.iris.builtin.terrain.OreSettings;
+import art.arcane.iris.core.loader.IrisRegistrant;
+import art.arcane.iris.engine.framework.Engine;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * What the terrain module keeps for one world: the ore generators of its dimension, regions and biomes made ready
+ * ({@link ResolvedOres}), built from their {@link OreSettings} when first asked for or ahead of generation by {@link OreWarmUp}.
+ */
+final class TerrainOres {
+ private final Engine engine;
+ private final Map resolved = new ConcurrentHashMap<>();
+
+ TerrainOres(Engine engine) {
+ this.engine = engine;
+ }
+
+ /** The ores of the world {@code engine} generates now. */
+ static TerrainOres of(Engine engine) {
+ return engine.getGeneration().state(TerrainOres.class, TerrainOres::new);
+ }
+
+ /**
+ * The ore generators {@code owner}, a dimension, region or biome, declares; {@link ResolvedOres#NONE} when it declares none. The
+ * terrain asks this for two owners per column, so a resolved set is read without taking the map's lock.
+ */
+ ResolvedOres of(IrisRegistrant owner) {
+ OreSettings settings = owner.getModuleSettings().find(OreSettings.class).orElse(null);
+ if (settings == null) {
+ return ResolvedOres.NONE;
+ }
+ ResolvedOres existing = resolved.get(settings);
+ if (existing != null) {
+ return existing;
+ }
+ return resolved.computeIfAbsent(settings, declared -> ResolvedOres.of(declared, engine));
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/loot/BlockDropping.java b/src/main/java/art/arcane/iris/engine/loot/BlockDropping.java
index e1ff26a61..55b501500 100644
--- a/src/main/java/art/arcane/iris/engine/loot/BlockDropping.java
+++ b/src/main/java/art/arcane/iris/engine/loot/BlockDropping.java
@@ -18,20 +18,25 @@
package art.arcane.iris.engine.loot;
+import art.arcane.iris.builtin.loot.BlockDrop;
+import art.arcane.iris.builtin.loot.BlockDropSettings;
+import art.arcane.iris.builtin.loot.LootEntry;
+import art.arcane.iris.core.loader.IrisRegistrant;
import art.arcane.iris.core.modules.IrisPackWorld;
import art.arcane.iris.engine.framework.Engine;
-import art.arcane.iris.engine.object.loot.IrisBlockDrops;
+import art.arcane.iris.engine.framework.LootResolver;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
import art.arcane.iris.engine.object.world.region.IrisRegion;
import art.arcane.iris.spi.IrisPlatforms;
-import art.arcane.iris.spi.PlatformBlockState;
-import art.arcane.volmlib.util.collection.KList;
+import art.arcane.volmlib.util.math.RNG;
import com.volmit.item.ItemDrop;
import com.volmit.service.BlockDrops;
import com.volmit.world.PackWorld;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
/**
* How {@code iris:loot} drops items for broken blocks: the block drops of the biome, the region and the dimension, the
@@ -44,23 +49,53 @@ public final class BlockDropping implements BlockDrops {
int x = broken.position().x();
int y = broken.position().y();
int z = broken.position().z();
- PlatformBlockState block = IrisPlatforms.get().registries().block(broken.block().key());
+ String brokenKey = IrisPlatforms.get().registries().block(broken.block().key()).key();
+ ResolvedDrops resolved = world.state(ResolvedDrops.class, ignored -> new ResolvedDrops());
IrisBiome biome = engine.getBiome(x, y, z);
- List providers = dropsFor(biome.getBlockDrops(), block, engine);
- if (providers.stream().noneMatch(IrisBlockDrops::isSkipParents)) {
+ List providers = dropsFor(biome, brokenKey, resolved, world);
+ if (providers.stream().noneMatch(provider -> provider.drop().skipParents())) {
IrisRegion region = engine.getRegion(x, z);
- providers.addAll(dropsFor(region.getBlockDrops(), block, engine));
- providers.addAll(dropsFor(engine.getDimension().getBlockDrops(), block, engine));
+ providers.addAll(dropsFor(region, brokenKey, resolved, world));
+ providers.addAll(dropsFor(engine.getDimension(), brokenKey, resolved, world));
}
LootItems items = new LootItems(world.resources().items(), false);
List drops = new ArrayList<>();
- providers.forEach(provider -> provider.fillDrops(items, drops));
- return new Result(drops, providers.stream().anyMatch(IrisBlockDrops::isReplaceVanillaDrops));
+ providers.forEach(provider -> fillDrops(provider.drop(), items, drops));
+ return new Result(drops, providers.stream().anyMatch(provider -> provider.drop().replaceVanillaDrops()));
}
- private static List dropsFor(KList candidates, PlatformBlockState block, Engine engine) {
- return new KList<>(candidates.stream().filter(drops -> drops.shouldDropFor(block, engine.getData())).toList());
+ /** Adds the items of the drops that pass their rarity to {@code into}. */
+ private static void fillDrops(BlockDrop drop, LootItems items, List into) {
+ for (LootEntry entry : drop.drops()) {
+ if (!LootResolver.oneIn(RNG.r, entry.rarity())) {
+ continue;
+ }
+ ItemDrop given = items.give(entry, RNG.r);
+ if (given != null) {
+ into.add(given);
+ }
+ }
+ }
+
+ private static List dropsFor(IrisRegistrant owner, String brokenKey, ResolvedDrops resolved, PackWorld world) {
+ List matching = new ArrayList<>();
+ for (BlockDrop drop : owner.getModuleSettings().find(BlockDropSettings.class).map(BlockDropSettings::drops).orElse(List.of())) {
+ ResolvedBlockDrop candidate = resolved.of(drop, world);
+ if (candidate.dropsFor(brokenKey)) {
+ matching.add(candidate);
+ }
+ }
+ return matching;
+ }
+
+ /** The drops of the world with their blocks resolved, once per drop. */
+ private static final class ResolvedDrops {
+ private final ConcurrentMap byDrop = new ConcurrentHashMap<>();
+
+ private ResolvedBlockDrop of(BlockDrop drop, PackWorld world) {
+ return byDrop.computeIfAbsent(drop, key -> ResolvedBlockDrop.of(key, world.resources().blocks()));
+ }
}
}
diff --git a/src/main/java/art/arcane/iris/engine/loot/LootGiving.java b/src/main/java/art/arcane/iris/engine/loot/LootGiving.java
index 3613ff1cb..94db333c0 100644
--- a/src/main/java/art/arcane/iris/engine/loot/LootGiving.java
+++ b/src/main/java/art/arcane/iris/engine/loot/LootGiving.java
@@ -18,22 +18,22 @@
package art.arcane.iris.engine.loot;
+import art.arcane.iris.builtin.loot.LootTable;
import art.arcane.iris.core.modules.IrisPackWorld;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.framework.LootResolver;
import art.arcane.iris.engine.framework.PlacedObject;
-import art.arcane.iris.engine.object.loot.IrisLootTable;
-import art.arcane.iris.engine.object.loot.IrisVanillaLootTable;
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
import art.arcane.iris.spi.IrisPlatforms;
import art.arcane.iris.spi.PlatformBlockState;
-import art.arcane.volmlib.util.collection.KList;
import art.arcane.volmlib.util.math.RNG;
import com.volmit.item.ItemDrop;
import com.volmit.service.Loot;
import com.volmit.world.PackWorld;
+import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
/**
* How {@code iris:loot} fills containers: the tables of the object placed around a container, then those of the
@@ -47,36 +47,42 @@ public final class LootGiving implements Loot {
int x = site.position().x();
int z = site.position().z();
int relativeY = site.position().y();
- RNG rng = LootResolver.containerRng(lootSeed(engine), x, relativeY + engine.getMinHeight(), z);
+ int worldY = relativeY + engine.getMinHeight();
+ RNG rng = LootResolver.containerRng(lootSeed(engine), x, worldY, z);
- List tables = new KList<>();
+ List sources = new ArrayList<>();
boolean objectLootDefined = site.nativeLootDefined();
IrisObjectPlacement placement = site.container() == null ? null : placementAt(engine, x, relativeY, z);
if (placement != null) {
objectLootDefined = objectLootDefined || placement.getLoot().isNotEmpty() || placement.getVanillaLoot().isNotEmpty();
- IrisLootTable table = placement.getTable(platformState(site), engine.getData(), rng);
- if (table != null) {
- tables.add(table);
+ Source picked = placementLoot(world, engine).pick(placement.getVanillaLoot(), placement.getLoot(), platformState(site), rng, x, worldY, z);
+ if (picked != null) {
+ sources.add(picked);
if (placement.isOverrideGlobalLoot()) {
- return sourcesOf(engine, site, List.of(table));
+ return sources;
}
}
}
- LootTables.resolveEnvironmentSources(tables, engine, rng, x, relativeY, z, objectLootDefined, table -> table);
- return sourcesOf(engine, site, tables);
+ LootTables.resolveEnvironmentSources(sources, engine, rng, x, relativeY, z, objectLootDefined, Table::new);
+ return sources;
}
@Override
public List items(PackWorld world, Site site, String key) {
Engine engine = engine(world);
- IrisLootTable table = LootResources.table(engine.getData(), key);
+ LootTable table = LootResources.table(engine.getData(), key);
if (table == null) {
return List.of();
}
int worldY = site.position().y() + engine.getMinHeight();
return new LootItems(world.resources().items(), site.debug())
- .draw(table, lootSeed(engine), site.position().x(), worldY, site.position().z());
+ .draw(key, table, lootSeed(engine), site.position().x(), worldY, site.position().z());
+ }
+
+ private static PlacementLoot placementLoot(PackWorld world, Engine engine) {
+ PlatformLootTables platformTables = world.state(PlatformLootTables.class, ignored -> new PlatformLootTables());
+ return new PlacementLoot(engine.getData(), platformTables::keys, lootSeed(engine));
}
private static IrisObjectPlacement placementAt(Engine engine, int x, int relativeY, int z) {
@@ -84,22 +90,6 @@ public final class LootGiving implements Loot {
return placed == null ? null : placed.getPlacement();
}
- private static List sourcesOf(Engine engine, Site site, List tables) {
- int worldY = site.position().y() + engine.getMinHeight();
- List sources = new KList<>();
- for (IrisLootTable table : tables) {
- if (table instanceof IrisVanillaLootTable vanilla) {
- long seed = LootTables.seed(lootSeed(engine), vanilla, site.position().x(), worldY, site.position().z());
- sources.add(new PlatformTable(vanilla.getLootTableKey(), seed));
- continue;
- }
- if (table != null && table.getLoadKey() != null) {
- sources.add(new Table(table.getLoadKey()));
- }
- }
- return sources;
- }
-
private static PlatformBlockState platformState(Site site) {
return IrisPlatforms.get().registries().block(site.container().key());
}
@@ -111,4 +101,18 @@ public final class LootGiving implements Loot {
private static Engine engine(PackWorld world) {
return IrisPackWorld.of(world).engine();
}
+
+ /** The loot table keys of the platform, which do not change while a world runs. */
+ private static final class PlatformLootTables {
+ private volatile Set keys;
+
+ private Set keys() {
+ Set known = keys;
+ if (known == null) {
+ known = PlacementLoot.platformTableKeys();
+ keys = known;
+ }
+ return known;
+ }
+ }
}
diff --git a/src/main/java/art/arcane/iris/engine/loot/LootItems.java b/src/main/java/art/arcane/iris/engine/loot/LootItems.java
index d1b3247d5..1c2300261 100644
--- a/src/main/java/art/arcane/iris/engine/loot/LootItems.java
+++ b/src/main/java/art/arcane/iris/engine/loot/LootItems.java
@@ -18,12 +18,12 @@
package art.arcane.iris.engine.loot;
+import art.arcane.iris.builtin.loot.ItemAttributeModifier;
+import art.arcane.iris.builtin.loot.LootEnchantment;
+import art.arcane.iris.builtin.loot.LootEntry;
+import art.arcane.iris.builtin.loot.LootSlot;
+import art.arcane.iris.builtin.loot.LootTable;
import art.arcane.iris.engine.framework.LootResolver;
-import art.arcane.iris.engine.object.entity.IrisAttributeModifier;
-import art.arcane.iris.engine.object.loot.IrisEnchantment;
-import art.arcane.iris.engine.object.loot.InventorySlotType;
-import art.arcane.iris.engine.object.loot.IrisLoot;
-import art.arcane.iris.engine.object.loot.IrisLootTable;
import art.arcane.volmlib.util.math.RNG;
import com.volmit.item.ItemAttribute;
import com.volmit.item.ItemDrop;
@@ -54,26 +54,28 @@ public final class LootItems {
}
/**
- * The items {@code table} gives at the spot {@code x}, {@code y}, {@code z} (world coordinates): picks entries
- * from the table's own random stream until it has the number of items the table asks for or runs out of tries.
+ * The items {@code table}, which the pack names {@code tableKey}, gives at the spot {@code x}, {@code y}, {@code z}
+ * (world coordinates): picks entries from the table's own random stream until it has the number of items the table
+ * asks for or runs out of tries.
*/
- public List draw(IrisLootTable table, long lootSeed, int x, int y, int z) {
+ public List draw(String tableKey, LootTable table, long lootSeed, int x, int y, int z) {
List drops = new ArrayList<>();
- List entries = table.getLoot();
- if (entries.isEmpty() || table.getMaxTries() <= 0) {
+ List entries = table.loot();
+ if (entries.isEmpty() || table.maxTries() <= 0) {
return drops;
}
- RNG rng = LootTables.rng(lootSeed, table, x, y, z);
- int wanted = Math.max(0, LootResolver.inclusive(rng, table.getMinPicked(), table.getMaxPicked()));
+ String identity = LootTables.identity(tableKey);
+ RNG rng = LootTables.rng(lootSeed, identity, x, y, z);
+ int wanted = Math.max(0, LootResolver.inclusive(rng, table.minPicked(), table.maxPicked()));
int tries = 0;
- while (drops.size() < wanted && tries++ < table.getMaxTries()) {
+ while (drops.size() < wanted && tries++ < table.maxTries()) {
int index = rng.nextInt(entries.size());
- IrisLoot entry = entries.get(index);
- if (entry == null || entry.getSlotTypes() != InventorySlotType.STORAGE) {
+ LootEntry entry = entries.get(index);
+ if (entry == null || entry.slotTypes() != LootSlot.STORAGE) {
continue;
}
- ItemDrop drop = drawEntry(entry, table, rng, lootSeed, index, x, y, z);
+ ItemDrop drop = drawEntry(entry, table, identity, rng, lootSeed, index, x, y, z);
if (drop != null) {
drops.add(drop);
}
@@ -82,66 +84,67 @@ public final class LootItems {
}
/** The item {@code entry} gives when nothing else decides whether it does, such as a block's drop or a mob's equipment; null for no item. */
- public ItemDrop give(IrisLoot entry, RNG rng) {
+ public ItemDrop give(LootEntry entry, RNG rng) {
return resolve(entry, rng, null);
}
- private ItemDrop drawEntry(IrisLoot entry, IrisLootTable table, RNG rng, long lootSeed, int index, int x, int y, int z) {
- long combinedRarity = LootResolver.combinedRarity(entry.getRarity(), table.getRarity());
- if (!LootTables.spatialOneIn(lootSeed, table, index, x, y, z, combinedRarity)) {
+ private ItemDrop drawEntry(LootEntry entry, LootTable table, String identity, RNG rng, long lootSeed, int index, int x, int y, int z) {
+ long combinedRarity = LootResolver.combinedRarity(entry.rarity(), table.rarity());
+ if (!LootTables.spatialOneIn(lootSeed, identity, index, x, y, z, combinedRarity)) {
return null;
}
return resolve(entry, rng, table);
}
- private ItemDrop resolve(IrisLoot entry, RNG rng, IrisLootTable table) {
- String type = entry.getTypeKey();
+ private ItemDrop resolve(LootEntry entry, RNG rng, LootTable table) {
+ String type = entry.type();
OptionalInt maxDurability = items.maxDurability(type);
if (maxDurability.isEmpty() || isAir(type)) {
return null;
}
- int amount = Math.max(MIN_AMOUNT, LootResolver.inclusive(rng, entry.getMinAmount(), entry.getMaxAmount()));
+ int amount = Math.max(MIN_AMOUNT, LootResolver.inclusive(rng, entry.minAmount(), entry.maxAmount()));
List enchantments = drawEnchantments(entry, rng);
List attributes = drawAttributes(entry, rng);
- Double damage = maxDurability.getAsInt() > 0 ? 1D - rng.d(entry.getMinDurability(), entry.getMaxDurability()) : null;
- return new ItemDrop(type, amount, entry.getDisplayName(), entry.getLore(), enchantments, attributes,
- entry.isUnbreakable(), entry.getItemFlags(), entry.getCustomModel(), damage, entry.getLeatherColor(),
- entry.getDyeColorKey(), entry.getCustomNbt(), debug ? sourceOf(entry, table) : null);
+ Double damage = maxDurability.getAsInt() > 0 ? 1D - rng.d(entry.minDurability(), entry.maxDurability()) : null;
+ return new ItemDrop(type, amount, entry.displayName(), entry.lore(), enchantments, attributes,
+ entry.unbreakable(), entry.itemFlags(), entry.customModel(), damage, entry.leatherColor(),
+ entry.dyeColor(), entry.customNbt(), debug ? sourceOf(entry, table) : null);
}
- private static List drawEnchantments(IrisLoot entry, RNG rng) {
+ private static List drawEnchantments(LootEntry entry, RNG rng) {
List enchantments = new ArrayList<>();
- for (IrisEnchantment enchantment : entry.getEnchantments()) {
- String key = enchantment.getEnchantment();
- if (key == null || key.isBlank() || rng.nextDouble() >= enchantment.getChance()) {
+ for (LootEnchantment enchantment : entry.enchantments()) {
+ String key = enchantment.enchantment();
+ if (key == null || key.isBlank() || rng.nextDouble() >= enchantment.chance()) {
continue;
}
- enchantments.add(new ItemEnchantment(key, Math.max(1, enchantment.getLevel(rng))));
+ int level = LootResolver.inclusive(rng, enchantment.minLevel(), enchantment.maxLevel());
+ enchantments.add(new ItemEnchantment(key, Math.max(1, level)));
}
return enchantments;
}
- private static List drawAttributes(IrisLoot entry, RNG rng) {
+ private static List drawAttributes(LootEntry entry, RNG rng) {
List attributes = new ArrayList<>();
- for (IrisAttributeModifier modifier : entry.getAttributes()) {
- if (rng.nextDouble() >= modifier.getChance()) {
+ for (ItemAttributeModifier modifier : entry.attributes()) {
+ if (rng.nextDouble() >= modifier.chance()) {
continue;
}
- String attribute = modifier.getAttribute();
+ String attribute = modifier.attribute();
if (attribute == null || attribute.isBlank()) {
continue;
}
- attributes.add(new ItemAttribute(attribute, modifier.getName(), modifier.getOperation(), modifier.getAmount(rng)));
+ attributes.add(new ItemAttribute(attribute, modifier.name(), modifier.operation(), rng.d(modifier.minAmount(), modifier.maxAmount())));
}
return attributes;
}
- private static ItemDrop.Source sourceOf(IrisLoot entry, IrisLootTable table) {
+ private static ItemDrop.Source sourceOf(LootEntry entry, LootTable table) {
if (table == null) {
- return new ItemDrop.Source(null, 0, entry.getRarity());
+ return new ItemDrop.Source(null, 0, entry.rarity());
}
- return new ItemDrop.Source(table.getName(), table.getRarity(), entry.getRarity());
+ return new ItemDrop.Source(table.name(), table.rarity(), entry.rarity());
}
private static boolean isAir(String type) {
diff --git a/src/main/java/art/arcane/iris/engine/loot/LootModule.java b/src/main/java/art/arcane/iris/engine/loot/LootModule.java
index 939bcccb7..aa2041db9 100644
--- a/src/main/java/art/arcane/iris/engine/loot/LootModule.java
+++ b/src/main/java/art/arcane/iris/engine/loot/LootModule.java
@@ -18,6 +18,8 @@
package art.arcane.iris.engine.loot;
+import art.arcane.iris.builtin.loot.BlockDropSettings;
+import art.arcane.iris.builtin.loot.LootSettings;
import com.volmit.FeatureRegistry;
import com.volmit.IrisModule;
import com.volmit.ModuleInfo;
@@ -26,9 +28,10 @@ import com.volmit.service.Loot;
import com.volmit.stage.StageGraph;
/**
- * Module {@code iris:loot}: the loot tables of the pack ({@link LootResources}) and the items they and the block drops
- * of the dimension, regions and biomes give. It checks the tables and the references to them ({@link LootValidator}). It has no generation stage; Iris asks it through {@link Loot} when a container is filled and through
- * {@link BlockDrops} when a player breaks a block.
+ * Module {@code iris:loot}: the loot tables of the pack ({@link LootResources}), the {@link LootSettings} and
+ * {@link BlockDropSettings} that dimensions, regions and biomes declare, and the items they give. It checks the tables
+ * and the references to them ({@link LootValidator}). It has no generation stage; Iris asks it through {@link Loot} when
+ * a container is filled and through {@link BlockDrops} when a player breaks a block.
*/
public final class LootModule implements IrisModule {
private static final String VERSION = "built-in";
@@ -44,6 +47,8 @@ public final class LootModule implements IrisModule {
@Override
public void register(FeatureRegistry registry) {
+ registry.registerSettings(LootSettings.class);
+ registry.registerSettings(BlockDropSettings.class);
LootResources.kinds().forEach(registry::registerResourceKind);
registry.registerValidator(new LootValidator());
registry.registerService(Loot.class, new LootGiving());
diff --git a/src/main/java/art/arcane/iris/engine/loot/LootResources.java b/src/main/java/art/arcane/iris/engine/loot/LootResources.java
index 3c0a8faa1..b21985205 100644
--- a/src/main/java/art/arcane/iris/engine/loot/LootResources.java
+++ b/src/main/java/art/arcane/iris/engine/loot/LootResources.java
@@ -18,10 +18,9 @@
package art.arcane.iris.engine.loot;
+import art.arcane.iris.builtin.loot.LootTable;
import art.arcane.iris.core.loader.IrisData;
import art.arcane.iris.core.modules.IrisPackResources;
-import art.arcane.iris.engine.object.loot.IrisLootTable;
-import art.arcane.volmlib.util.collection.KList;
import com.volmit.resource.ResourceId;
import com.volmit.resource.ResourceKind;
@@ -37,7 +36,7 @@ import java.util.List;
*/
public final class LootResources {
/** Loot tables, in {@code loot/}. */
- public static final ResourceKind TABLES = ResourceKind.of("iris:loot/table", "loot", IrisLootTable.class);
+ public static final ResourceKind TABLES = ResourceKind.of("iris:loot/table", "loot", LootTable.class);
private LootResources() {
}
@@ -47,7 +46,7 @@ public final class LootResources {
return List.of(TABLES);
}
- public static IrisLootTable table(IrisData data, String key) {
+ public static LootTable table(IrisData data, String key) {
if (key == null || key.isBlank()) {
return null;
}
@@ -59,18 +58,6 @@ public final class LootResources {
}
}
- /** The tables of the pack named by {@code keys}, in order, without the ones the pack lacks. */
- public static KList tables(IrisData data, List keys) {
- KList tables = new KList<>();
- for (String key : keys) {
- IrisLootTable table = table(data, key);
- if (table != null) {
- tables.add(table);
- }
- }
- return tables;
- }
-
/** The key of every loot table of the pack, in key order. */
public static List tableKeys(IrisData data) {
return data.getPackResources().ids(TABLES.type()).stream().map(ResourceId::path).toList();
diff --git a/src/main/java/art/arcane/iris/engine/loot/LootTables.java b/src/main/java/art/arcane/iris/engine/loot/LootTables.java
index 021c3c2b1..c1d0cb067 100644
--- a/src/main/java/art/arcane/iris/engine/loot/LootTables.java
+++ b/src/main/java/art/arcane/iris/engine/loot/LootTables.java
@@ -18,14 +18,13 @@
package art.arcane.iris.engine.loot;
+import art.arcane.iris.builtin.loot.LootMode;
+import art.arcane.iris.builtin.loot.LootSettings;
+import art.arcane.iris.core.loader.IrisRegistrant;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.framework.LootResolver;
-import art.arcane.iris.engine.object.loot.IrisLootMode;
-import art.arcane.iris.engine.object.loot.IrisLootReference;
-import art.arcane.iris.engine.object.loot.IrisLootTable;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
import art.arcane.iris.engine.object.world.region.IrisRegion;
-import art.arcane.volmlib.util.collection.KList;
import art.arcane.volmlib.util.math.RNG;
import java.util.List;
@@ -34,42 +33,46 @@ import java.util.function.Function;
/**
* Which loot tables a place in the world draws from, and the random streams that draw from them: the part of loot
- * that reads the pack's tables, loot references and layout. The streams themselves are
- * {@link LootResolver}'s; here a table is named by its {@linkplain #identity identity}.
+ * that reads the pack's tables, loot settings and layout. The streams themselves are {@link LootResolver}'s; here a
+ * table is named by its {@linkplain #identity identity}, the key the pack names it by.
*/
public final class LootTables {
+ private static final String VANILLA_IDENTITY_PREFIX = "Vanilla ";
+
private LootTables() {
}
- /** What names a table in the random streams: its key, else its name. */
- public static String identity(IrisLootTable table) {
- if (table == null) {
- return "";
- }
- String loadKey = table.getLoadKey();
- if (loadKey != null && !loadKey.isBlank()) {
- return loadKey;
- }
- String name = table.getName();
- return name == null ? "" : name;
+ /** What names a table in the random streams: the key a pack table is named by. */
+ public static String identity(String tableKey) {
+ return tableKey;
}
- public static RNG rng(long lootSeed, IrisLootTable table, int x, int y, int z) {
- return LootResolver.tableRng(lootSeed, identity(table), x, y, z);
+ /** What names a table of the platform in the random streams. */
+ public static String platformIdentity(String platformKey) {
+ return VANILLA_IDENTITY_PREFIX + platformKey;
}
- public static long seed(long lootSeed, IrisLootTable table, int x, int y, int z) {
- return LootResolver.tableSeed(lootSeed, identity(table), x, y, z);
+ public static RNG rng(long lootSeed, String identity, int x, int y, int z) {
+ return LootResolver.tableRng(lootSeed, identity, x, y, z);
}
- public static boolean spatialOneIn(long lootSeed, IrisLootTable table, int entryIndex, int x, int y, int z, long rarity) {
- return LootResolver.spatialOneIn(lootSeed, identity(table), entryIndex, x, y, z, rarity);
+ public static long seed(long lootSeed, String identity, int x, int y, int z) {
+ return LootResolver.tableSeed(lootSeed, identity, x, y, z);
+ }
+
+ public static boolean spatialOneIn(long lootSeed, String identity, int entryIndex, int x, int y, int z, long rarity) {
+ return LootResolver.spatialOneIn(lootSeed, identity, entryIndex, x, y, z, rarity);
+ }
+
+ /** The loot settings a dimension, region or biome declares; the defaults, which add nothing, when it declares none. */
+ public static LootSettings settingsOf(IrisRegistrant owner) {
+ return owner.getModuleSettings().find(LootSettings.class).orElseGet(LootSettings::new);
}
/**
* Adds the tables of the dimension, the region, the surface biome and (below the surface) the cave biome at a
- * column to {@code sources}, as their loot references say, then scales their number by the areas' multipliers.
- * {@code mapper} turns a table into the caller's own source; a null result skips it.
+ * column to {@code sources}, as their loot settings say, then scales their number by the areas' multipliers.
+ * {@code mapper} turns the key of a table into the caller's own source; a null result skips it.
*/
public static void resolveEnvironmentSources(
List sources,
@@ -79,7 +82,7 @@ public final class LootTables {
int relativeY,
int z,
boolean objectLootDefined,
- Function mapper
+ Function mapper
) {
IrisRegion region = engine.getComplex().getRegionStream().get(x, z);
IrisBiome surfaceBiome = engine.getComplex().getTrueBiomeStream().get(x, z);
@@ -91,20 +94,21 @@ public final class LootTables {
contextualBiome = surfaceBiome;
}
+ LootSettings dimensionLoot = settingsOf(engine.getDimension());
+ LootSettings regionLoot = settingsOf(region);
+ LootSettings surfaceLoot = settingsOf(surfaceBiome);
boolean distinctContextualBiome = !sameBiome(surfaceBiome, contextualBiome);
- double multiplier = engine.getDimension().getLoot().getMultiplier()
- * region.getLoot().getMultiplier()
- * surfaceBiome.getLoot().getMultiplier();
+ double multiplier = dimensionLoot.multiplier() * regionLoot.multiplier() * surfaceLoot.multiplier();
if (distinctContextualBiome) {
- multiplier *= contextualBiome.getLoot().getMultiplier();
+ multiplier *= settingsOf(contextualBiome).multiplier();
}
boolean fallback = !objectLootDefined;
- injectReference(sources, engine.getDimension().getLoot(), engine, mapper, fallback);
- injectReference(sources, region.getLoot(), engine, mapper, fallback);
- injectReference(sources, surfaceBiome.getLoot(), engine, mapper, fallback);
+ injectReference(sources, dimensionLoot, engine, mapper, fallback);
+ injectReference(sources, regionLoot, engine, mapper, fallback);
+ injectReference(sources, surfaceLoot, engine, mapper, fallback);
if (distinctContextualBiome) {
- injectReference(sources, contextualBiome.getLoot(), engine, mapper, fallback);
+ injectReference(sources, settingsOf(contextualBiome), engine, mapper, fallback);
}
LootResolver.scaleSources(sources, multiplier, rng);
}
@@ -113,17 +117,17 @@ public final class LootTables {
public static void injectSources(
List sources,
List extends T> additions,
- IrisLootMode mode,
+ LootMode mode,
boolean fallback
) {
- if (mode == IrisLootMode.FALLBACK && !fallback) {
+ if (mode == LootMode.FALLBACK && !fallback) {
return;
}
- if (mode == IrisLootMode.CLEAR) {
+ if (mode == LootMode.CLEAR) {
sources.clear();
return;
}
- if (mode == IrisLootMode.REPLACE) {
+ if (mode == LootMode.REPLACE) {
sources.clear();
}
sources.addAll(additions);
@@ -141,22 +145,16 @@ public final class LootTables {
private static void injectReference(
List sources,
- IrisLootReference reference,
+ LootSettings loot,
Engine engine,
- Function mapper,
+ Function mapper,
boolean fallback
) {
- KList tables = reference.getLootTables(engine.getComplex());
- KList additions = new KList<>();
- for (IrisLootTable table : tables) {
- if (table == null) {
- continue;
- }
- T source = mapper.apply(table);
- if (source != null) {
- additions.add(source);
- }
- }
- injectSources(sources, additions, reference.getMode(), fallback);
+ List additions = loot.tables().stream()
+ .filter(key -> LootResources.table(engine.getData(), key) != null)
+ .map(mapper)
+ .filter(Objects::nonNull)
+ .toList();
+ injectSources(sources, additions, loot.mode(), fallback);
}
}
diff --git a/src/main/java/art/arcane/iris/engine/loot/LootValidator.java b/src/main/java/art/arcane/iris/engine/loot/LootValidator.java
index e5f256fcb..cb4fef3d0 100644
--- a/src/main/java/art/arcane/iris/engine/loot/LootValidator.java
+++ b/src/main/java/art/arcane/iris/engine/loot/LootValidator.java
@@ -21,9 +21,9 @@ package art.arcane.iris.engine.loot;
import art.arcane.iris.core.modules.IrisValidationContext;
import art.arcane.iris.core.pack.PackIntegerChecks;
import art.arcane.iris.core.pack.PackValidationIo;
-import art.arcane.iris.engine.object.loot.IrisLoot;
-import art.arcane.iris.engine.object.loot.IrisLootReference;
-import art.arcane.iris.engine.object.loot.IrisLootTable;
+import art.arcane.iris.builtin.loot.LootEntry;
+import art.arcane.iris.builtin.loot.LootSettings;
+import art.arcane.iris.builtin.loot.LootTable;
import art.arcane.volmlib.util.json.JSONArray;
import art.arcane.volmlib.util.json.JSONObject;
import com.volmit.validation.Problem;
@@ -162,9 +162,9 @@ public final class LootValidator implements Validator {
PackIntegerChecks.requireMinimum(path + ".minPicked", minimumPicked, 0, blockingErrors);
PackIntegerChecks.requireMinimum(path + ".maxPicked", maximumPicked, 1, blockingErrors);
PackIntegerChecks.requireMinimum(path + ".maxTries", maximumTries, 1, blockingErrors);
- PackIntegerChecks.requireMaximum(path + ".minPicked", minimumPicked, IrisLootTable.MAX_PICKED, blockingErrors);
- PackIntegerChecks.requireMaximum(path + ".maxPicked", maximumPicked, IrisLootTable.MAX_PICKED, blockingErrors);
- PackIntegerChecks.requireMaximum(path + ".maxTries", maximumTries, IrisLootTable.MAX_TRIES, blockingErrors);
+ PackIntegerChecks.requireMaximum(path + ".minPicked", minimumPicked, LootTable.MAX_PICKED, blockingErrors);
+ PackIntegerChecks.requireMaximum(path + ".maxPicked", maximumPicked, LootTable.MAX_PICKED, blockingErrors);
+ PackIntegerChecks.requireMaximum(path + ".maxTries", maximumTries, LootTable.MAX_TRIES, blockingErrors);
PackIntegerChecks.requireOrdered(path + ".minPicked", minimumPicked, path + ".maxPicked", maximumPicked, blockingErrors);
JSONArray entries = table.optJSONArray("loot");
@@ -189,8 +189,8 @@ public final class LootValidator implements Validator {
PackIntegerChecks.requireMinimum(entryPath + ".rarity", entryRarity, 1, blockingErrors);
PackIntegerChecks.requireMinimum(entryPath + ".minAmount", minimumAmount, 1, blockingErrors);
PackIntegerChecks.requireMinimum(entryPath + ".maxAmount", maximumAmount, 1, blockingErrors);
- PackIntegerChecks.requireMaximum(entryPath + ".minAmount", minimumAmount, IrisLoot.MAX_AMOUNT, blockingErrors);
- PackIntegerChecks.requireMaximum(entryPath + ".maxAmount", maximumAmount, IrisLoot.MAX_AMOUNT, blockingErrors);
+ PackIntegerChecks.requireMaximum(entryPath + ".minAmount", minimumAmount, LootEntry.MAX_AMOUNT, blockingErrors);
+ PackIntegerChecks.requireMaximum(entryPath + ".maxAmount", maximumAmount, LootEntry.MAX_AMOUNT, blockingErrors);
PackIntegerChecks.requireOrdered(entryPath + ".minAmount", minimumAmount,
entryPath + ".maxAmount", maximumAmount, blockingErrors);
validateLootEnchantments(entryPath, entry.opt("enchantments"), blockingErrors);
@@ -256,9 +256,9 @@ public final class LootValidator implements Validator {
if (!(rawMultiplier instanceof Number multiplier)
|| !Double.isFinite(multiplier.doubleValue())
|| multiplier.doubleValue() < 0D
- || multiplier.doubleValue() > IrisLootReference.MAX_MULTIPLIER) {
+ || multiplier.doubleValue() > LootSettings.MAX_MULTIPLIER) {
blockingErrors.add(path + ".multiplier must be a finite number from 0 to "
- + (int) IrisLootReference.MAX_MULTIPLIER + ".");
+ + (int) LootSettings.MAX_MULTIPLIER + ".");
}
}
if (!reference.has("tables")) {
diff --git a/src/main/java/art/arcane/iris/engine/loot/PlacementLoot.java b/src/main/java/art/arcane/iris/engine/loot/PlacementLoot.java
new file mode 100644
index 000000000..e059d4a06
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/loot/PlacementLoot.java
@@ -0,0 +1,154 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.engine.loot;
+
+import art.arcane.iris.core.loader.IrisData;
+import art.arcane.iris.engine.framework.LootResolver;
+import art.arcane.iris.engine.object.loot.IObjectLoot;
+import art.arcane.iris.spi.IrisLogging;
+import art.arcane.iris.spi.IrisPlatforms;
+import art.arcane.iris.spi.PlatformBlockState;
+import art.arcane.volmlib.util.math.RNG;
+import com.volmit.service.Loot;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Supplier;
+
+/**
+ * The loot table an object placement gives to one of its containers: the placement's tables and the platform's own,
+ * each with the blocks it applies to and a weight. A table that names the container's exact block wins over one that
+ * names the container's kind of block, which wins over one that names no blocks; among equals the weights pick.
+ */
+final class PlacementLoot {
+ private static final String VANILLA_NAMESPACE = "minecraft:";
+ private static final char NAMESPACE_SEPARATOR = ':';
+ private static final char PROPERTIES_START = '[';
+
+ private final IrisData data;
+ private final Supplier> platformTables;
+ private final long lootSeed;
+
+ /** @param platformTables the keys of the loot tables the platform has, asked for only when a placement names one */
+ PlacementLoot(IrisData data, Supplier> platformTables, long lootSeed) {
+ this.data = data;
+ this.platformTables = platformTables;
+ this.lootSeed = lootSeed;
+ }
+
+ /** The platform's loot table keys, which a placement may name, in the form a placement names them. */
+ static Set platformTableKeys() {
+ return Set.copyOf(IrisPlatforms.get().registries().lootTableKeys());
+ }
+
+ /**
+ * The table a placement, whose platform tables are {@code platformLoot} and whose pack tables are {@code packLoot},
+ * gives {@code container}, a storage chest, at the spot {@code x}, {@code worldY}, {@code z}; null when it gives
+ * it none.
+ */
+ Loot.Source pick(List extends IObjectLoot> platformLoot, List extends IObjectLoot> packLoot, PlatformBlockState container,
+ RNG rng, int x, int worldY, int z) {
+ Candidates candidates = new Candidates(container);
+ add(candidates, platformLoot, name -> platformSource(name, x, worldY, z));
+ add(candidates, packLoot, this::packSource);
+ List pool = candidates.pool();
+ Candidate picked = LootResolver.pickWeighted(pool, Candidate::weight, rng);
+ return picked == null ? null : picked.source();
+ }
+
+ private void add(Candidates candidates, List extends IObjectLoot> entries, Function sourceOf) {
+ for (IObjectLoot entry : entries) {
+ if (entry == null || entry.getWeight() <= 0) {
+ continue;
+ }
+ Loot.Source source = sourceOf.apply(entry.getName());
+ if (source == null) {
+ IrisLogging.warn("Couldn't find loot table " + entry.getName());
+ continue;
+ }
+ candidates.add(entry, data, new Candidate(source, entry.getWeight()));
+ }
+ }
+
+ private Loot.Source packSource(String key) {
+ return LootResources.table(data, key) == null ? null : new Loot.Table(key);
+ }
+
+ private Loot.Source platformSource(String name, int x, int worldY, int z) {
+ String key = platformKey(name);
+ if (key == null || !platformTables.get().contains(key)) {
+ return null;
+ }
+ return new Loot.PlatformTable(key, LootTables.seed(lootSeed, LootTables.platformIdentity(key), x, worldY, z));
+ }
+
+ /** A placement's name for a platform table as the platform's key for it, or null for a name that cannot be one. */
+ static String platformKey(String name) {
+ if (name == null || name.isBlank()) {
+ return null;
+ }
+ return name.indexOf(NAMESPACE_SEPARATOR) < 0 ? VANILLA_NAMESPACE + name : name;
+ }
+
+ private record Candidate(Loot.Source source, int weight) {
+ }
+
+ /** The candidates for one container, in the groups the placement gives them. */
+ private static final class Candidates {
+ private final String containerKey;
+ private final String containerMaterial;
+ private final List exact = new ArrayList<>();
+ private final List basic = new ArrayList<>();
+ private final List global = new ArrayList<>();
+
+ private Candidates(PlatformBlockState container) {
+ this.containerKey = container.key();
+ this.containerMaterial = materialOf(containerKey);
+ }
+
+ void add(IObjectLoot entry, IrisData data, Candidate candidate) {
+ List filter = entry.getFilter(data);
+ if (filter.isEmpty()) {
+ global.add(candidate);
+ return;
+ }
+ for (PlatformBlockState filterState : filter) {
+ if (entry.isExact() && filterState.key().equals(containerKey)) {
+ exact.add(candidate);
+ } else if (!entry.isExact() && materialOf(filterState.key()).equals(containerMaterial)) {
+ basic.add(candidate);
+ }
+ }
+ }
+
+ List pool() {
+ if (!exact.isEmpty()) {
+ return exact;
+ }
+ return basic.isEmpty() ? global : basic;
+ }
+
+ private static String materialOf(String blockKey) {
+ int properties = blockKey.indexOf(PROPERTIES_START);
+ return properties < 0 ? blockKey : blockKey.substring(0, properties);
+ }
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/loot/ResolvedBlockDrop.java b/src/main/java/art/arcane/iris/engine/loot/ResolvedBlockDrop.java
new file mode 100644
index 000000000..d42367c31
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/loot/ResolvedBlockDrop.java
@@ -0,0 +1,72 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.engine.loot;
+
+import art.arcane.iris.builtin.loot.BlockDrop;
+import art.arcane.iris.spi.IrisPlatforms;
+import art.arcane.iris.spi.PlatformBlockState;
+import com.volmit.block.BlockRegistry;
+import com.volmit.block.BlockSpec;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+/** A {@link BlockDrop} with the blocks it names resolved to the platform's: which broken blocks it drops for. */
+final class ResolvedBlockDrop {
+ private static final char PROPERTIES_START = '[';
+
+ private final BlockDrop drop;
+ private final boolean exact;
+ private final Set blocks;
+
+ private ResolvedBlockDrop(BlockDrop drop, Set blocks) {
+ this.drop = drop;
+ this.exact = drop.exactBlocks();
+ this.blocks = blocks;
+ }
+
+ /** @param blocks the pack's blocks, which the drop's block specs resolve against */
+ static ResolvedBlockDrop of(BlockDrop drop, BlockRegistry blocks) {
+ Set keys = new LinkedHashSet<>();
+ for (BlockSpec spec : drop.blocks()) {
+ PlatformBlockState state = IrisPlatforms.get().registries().block(blocks.resolve(spec).key());
+ if (state != null) {
+ keys.add(comparable(state.key(), drop.exactBlocks()));
+ }
+ }
+ return new ResolvedBlockDrop(drop, keys);
+ }
+
+ BlockDrop drop() {
+ return drop;
+ }
+
+ /** Whether the drop applies to {@code brokenKey}, the platform's key for the broken block: its exact state, or just its kind of block. */
+ boolean dropsFor(String brokenKey) {
+ return blocks.contains(comparable(brokenKey, exact));
+ }
+
+ private static String comparable(String key, boolean exact) {
+ if (exact) {
+ return key;
+ }
+ int properties = key.indexOf(PROPERTIES_START);
+ return properties < 0 ? key : key.substring(0, properties);
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/mantle/components/CaveCarving.java b/src/main/java/art/arcane/iris/engine/mantle/components/CaveCarving.java
index 2660dc3f2..7046d1da8 100644
--- a/src/main/java/art/arcane/iris/engine/mantle/components/CaveCarving.java
+++ b/src/main/java/art/arcane/iris/engine/mantle/components/CaveCarving.java
@@ -19,13 +19,18 @@
package art.arcane.iris.engine.mantle.components;
import art.arcane.iris.builtin.carve.CaveProfile;
+import art.arcane.iris.core.modules.IrisValues;
import art.arcane.iris.engine.IrisComplex;
import art.arcane.iris.engine.UpperDimensionContext;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.mantle.MantleWriter;
+import art.arcane.iris.engine.terrain.TerrainPalettes;
+import art.arcane.iris.engine.object.terrain.carving.CaveProfiles;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
-import art.arcane.iris.engine.object.terrain.carving.IrisDimensionCarvingEntry;
-import art.arcane.iris.engine.object.terrain.carving.IrisDimensionCarvingResolver;
+import art.arcane.iris.engine.object.terrain.carving.ResolvedCarvingEntry;
+import art.arcane.iris.engine.modifier.CaveBiomeBands;
+import art.arcane.iris.engine.object.terrain.carving.CarvingBands;
+import art.arcane.iris.engine.object.terrain.carving.CarvingResolver;
import art.arcane.iris.engine.object.world.region.IrisRegion;
import art.arcane.iris.engine.object.value.IrisRange;
import art.arcane.iris.spi.PlatformBlockState;
@@ -89,7 +94,7 @@ public class CaveCarving {
/** Carves the caves of the chunk at chunk coordinates {@code x}, {@code z} into {@code writer}. */
public void carve(MantleWriter writer, int x, int z, ChunkContext context) {
IrisComplex complex = context.getComplex();
- IrisDimensionCarvingResolver.State resolverState = new IrisDimensionCarvingResolver.State();
+ CarvingResolver.State resolverState = new CarvingResolver.State();
BlendScratch blendScratch = BLEND_SCRATCH.get();
int[] chunkSurfaceHeights = prepareChunkSurfaceHeights(x, z, context, blendScratch.chunkSurfaceHeights);
PrecisionStopwatch resolveStopwatch = PrecisionStopwatch.start();
@@ -200,7 +205,7 @@ public class CaveCarving {
}
}
- private List resolveWeightedProfiles(int chunkX, int chunkZ, IrisComplex complex, IrisDimensionCarvingResolver.State resolverState) {
+ private List resolveWeightedProfiles(int chunkX, int chunkZ, IrisComplex complex, CarvingResolver.State resolverState) {
BlendScratch blendScratch = BLEND_SCRATCH.get();
CaveProfile[] profileField = blendScratch.profileField;
Map columnProfileWeights = blendScratch.columnProfileWeights;
@@ -296,40 +301,40 @@ public class CaveCarving {
return resolvedProfiles;
}
- private List resolveDimensionCarvingProfiles(int chunkX, int chunkZ, IrisDimensionCarvingResolver.State resolverState, BlendScratch blendScratch) {
+ private List resolveDimensionCarvingProfiles(int chunkX, int chunkZ, CarvingResolver.State resolverState, BlendScratch blendScratch) {
List weightedProfiles = new ArrayList<>();
- List entries = engine.getDimension().getCarving();
- if (entries == null || entries.isEmpty()) {
+ List entries = CarvingBands.of(engine).entries();
+ if (entries.isEmpty()) {
return weightedProfiles;
}
- Map dimensionColumnPlans = blendScratch.dimensionColumnPlans;
+ Map dimensionColumnPlans = blendScratch.dimensionColumnPlans;
dimensionColumnPlans.clear();
- for (IrisDimensionCarvingEntry entry : entries) {
- if (entry == null || !entry.isEnabled()) {
+ for (ResolvedCarvingEntry entry : entries) {
+ if (!entry.enabled()) {
continue;
}
- IrisBiome rootBiome = IrisDimensionCarvingResolver.resolveEntryBiome(engine, entry, resolverState);
+ IrisBiome rootBiome = CarvingResolver.resolveEntryBiome(engine, entry, resolverState);
if (rootBiome == null) {
continue;
}
- IrisDimensionCarvingEntry[] columnPlan = dimensionColumnPlans.computeIfAbsent(entry, key -> new IrisDimensionCarvingEntry[CHUNK_AREA]);
+ ResolvedCarvingEntry[] columnPlan = dimensionColumnPlans.computeIfAbsent(entry, key -> new ResolvedCarvingEntry[CHUNK_AREA]);
buildDimensionColumnPlan(columnPlan, chunkX, chunkZ, entry, resolverState);
Map rootProfileColumnWeights = new IdentityHashMap<>();
List rootProfileOrder = new ArrayList<>();
- IrisRange worldYRange = entry.getWorldYRange();
+ IrisRange worldYRange = entry.worldYRange() == null ? null : IrisValues.range(entry.worldYRange());
for (int columnIndex = 0; columnIndex < CHUNK_AREA; columnIndex++) {
- IrisDimensionCarvingEntry resolvedEntry = columnPlan[columnIndex];
- IrisBiome resolvedBiome = IrisDimensionCarvingResolver.resolveEntryBiome(engine, resolvedEntry, resolverState);
+ ResolvedCarvingEntry resolvedEntry = columnPlan[columnIndex];
+ IrisBiome resolvedBiome = CarvingResolver.resolveEntryBiome(engine, resolvedEntry, resolverState);
if (resolvedBiome == null) {
continue;
}
- CaveProfile profile = resolvedBiome.getCaveProfile();
+ CaveProfile profile = CaveProfiles.declaredBy(resolvedBiome);
if (!isProfileEnabled(profile)) {
continue;
}
@@ -351,7 +356,7 @@ public class CaveCarving {
return weightedProfiles;
}
- private void buildDimensionColumnPlan(IrisDimensionCarvingEntry[] columnPlan, int chunkX, int chunkZ, IrisDimensionCarvingEntry entry, IrisDimensionCarvingResolver.State resolverState) {
+ private void buildDimensionColumnPlan(ResolvedCarvingEntry[] columnPlan, int chunkX, int chunkZ, ResolvedCarvingEntry entry, CarvingResolver.State resolverState) {
int baseX = PowerOfTwoCoordinates.chunkToBlock(chunkX);
int baseZ = PowerOfTwoCoordinates.chunkToBlock(chunkZ);
for (int localX = 0; localX < CHUNK_SIZE; localX++) {
@@ -359,12 +364,12 @@ public class CaveCarving {
for (int localZ = 0; localZ < CHUNK_SIZE; localZ++) {
int worldZ = baseZ + localZ;
int columnIndex = PowerOfTwoCoordinates.packLocal16(localX, localZ);
- columnPlan[columnIndex] = IrisDimensionCarvingResolver.resolveFromRoot(engine, entry, worldX, worldZ, resolverState);
+ columnPlan[columnIndex] = CarvingResolver.resolveFromRoot(engine, entry, worldX, worldZ, resolverState);
}
}
}
- private void fillProfileField(CaveProfile[] profileField, int chunkX, int chunkZ, IrisComplex complex, IrisDimensionCarvingResolver.State resolverState, BlendScratch blendScratch) {
+ private void fillProfileField(CaveProfile[] profileField, int chunkX, int chunkZ, IrisComplex complex, CarvingResolver.State resolverState, BlendScratch blendScratch) {
int startX = PowerOfTwoCoordinates.chunkToBlock(chunkX) - BLEND_RADIUS;
int startZ = PowerOfTwoCoordinates.chunkToBlock(chunkZ) - BLEND_RADIUS;
prefillProfileFieldSamples(startX, startZ, complex, blendScratch);
@@ -404,23 +409,23 @@ public class CaveCarving {
IrisRegion region,
IrisBiome surfaceBiome,
IrisBiome caveBiome,
- IrisDimensionCarvingResolver.State resolverState
+ CarvingResolver.State resolverState
) {
CaveProfile resolved = null;
- CaveProfile dimensionProfile = engine.getDimension().getCaveProfile();
+ CaveProfile dimensionProfile = CaveProfiles.declaredBy(engine.getDimension());
if (isProfileEnabled(dimensionProfile)) {
resolved = dimensionProfile;
}
if (region != null) {
- CaveProfile regionProfile = region.getCaveProfile();
+ CaveProfile regionProfile = CaveProfiles.declaredBy(region);
if (isProfileEnabled(regionProfile)) {
resolved = regionProfile;
}
}
if (surfaceBiome != null) {
- CaveProfile surfaceProfile = surfaceBiome.getCaveProfile();
+ CaveProfile surfaceProfile = CaveProfiles.declaredBy(surfaceBiome);
if (isProfileEnabled(surfaceProfile)) {
resolved = surfaceProfile;
}
@@ -429,11 +434,11 @@ public class CaveCarving {
int roundedSurfaceY = (int) Math.round(surfaceHeight);
int sampleY = Math.max(1, roundedSurfaceY - 56);
int worldY = sampleY + engine.getWorld().minHeight();
- IrisDimensionCarvingEntry rootCarvingEntry = IrisDimensionCarvingResolver.resolveRootEntry(engine, worldY, resolverState);
+ ResolvedCarvingEntry rootCarvingEntry = CarvingResolver.resolveRootEntry(engine, worldY, resolverState);
IrisBiome resolvedCarvingBiome = null;
if (rootCarvingEntry != null) {
- IrisDimensionCarvingEntry resolvedCarvingEntry = IrisDimensionCarvingResolver.resolveFromRoot(engine, rootCarvingEntry, worldX, worldZ, resolverState);
- resolvedCarvingBiome = IrisDimensionCarvingResolver.resolveEntryBiome(engine, resolvedCarvingEntry, resolverState);
+ ResolvedCarvingEntry resolvedCarvingEntry = CarvingResolver.resolveFromRoot(engine, rootCarvingEntry, worldX, worldZ, resolverState);
+ resolvedCarvingBiome = CarvingResolver.resolveEntryBiome(engine, resolvedCarvingEntry, resolverState);
if (resolvedCarvingBiome != null) {
caveBiome = resolvedCarvingBiome;
}
@@ -447,7 +452,7 @@ public class CaveCarving {
if (depthBelowSurface <= 0) {
effectiveCaveBiome = surfaceBiome;
} else {
- int minDepth = Math.max(0, caveBiome.getCaveMinDepthBelowSurface());
+ int minDepth = Math.max(0, CaveBiomeBands.minDepthBelowSurface(caveBiome));
if (depthBelowSurface < minDepth) {
effectiveCaveBiome = surfaceBiome;
}
@@ -455,7 +460,7 @@ public class CaveCarving {
}
}
- CaveProfile caveProfile = effectiveCaveBiome.getCaveProfile();
+ CaveProfile caveProfile = CaveProfiles.declaredBy(effectiveCaveBiome);
if (isProfileEnabled(caveProfile)) {
resolved = caveProfile;
}
@@ -466,7 +471,7 @@ public class CaveCarving {
private void prefillProfileFieldSamples(int startX, int startZ, IrisComplex complex, BlendScratch blendScratch) {
fillFieldHeights(complex.getHeightStream(), startX, startZ, blendScratch.fieldSurfaceHeights);
- fillFieldFluidPresence(complex.getFluidStream(), startX, startZ, blendScratch.fieldHasFluid);
+ fillFieldFluidPresence(TerrainPalettes.of(engine), startX, startZ, blendScratch.fieldHasFluid);
fillFieldObjects(complex.getRegionStream(), startX, startZ, blendScratch.fieldRegions);
fillFieldObjects(complex.getTrueBiomeStream(), startX, startZ, blendScratch.fieldSurfaceBiomes);
fillFieldObjects(complex.getCaveBiomeStream(), startX, startZ, blendScratch.fieldCaveBiomes);
@@ -490,11 +495,11 @@ public class CaveCarving {
}
}
- private void fillFieldFluidPresence(ProceduralStream stream, int startX, int startZ, boolean[] target) {
+ private void fillFieldFluidPresence(TerrainPalettes palettes, int startX, int startZ, boolean[] target) {
for (int fieldX = 0; fieldX < FIELD_SIZE; fieldX++) {
int worldX = startX + fieldX;
for (int fieldZ = 0; fieldZ < FIELD_SIZE; fieldZ++) {
- target[(fieldX * FIELD_SIZE) + fieldZ] = B.isFluid(stream.get(worldX, startZ + fieldZ));
+ target[(fieldX * FIELD_SIZE) + fieldZ] = B.isFluid(palettes.fluidAt(worldX, startZ + fieldZ));
}
}
}
@@ -680,7 +685,7 @@ public class CaveCarving {
private final CaveProfile[] kernelProfiles = new CaveProfile[KERNEL_SIZE];
private final double[] kernelProfileWeights = new double[KERNEL_SIZE];
private final IdentityHashMap columnProfileWeights = new IdentityHashMap<>();
- private final IdentityHashMap dimensionColumnPlans = new IdentityHashMap<>();
+ private final IdentityHashMap dimensionColumnPlans = new IdentityHashMap<>();
private final IdentityHashMap activeProfiles = new IdentityHashMap<>();
private final List profileOrder = new ArrayList<>();
private final double[] fieldSurfaceHeights = new double[FIELD_SIZE * FIELD_SIZE];
diff --git a/src/main/java/art/arcane/iris/engine/mantle/components/FloatingIslandSampleResolver.java b/src/main/java/art/arcane/iris/engine/mantle/components/FloatingIslandSampleResolver.java
index b80204f93..b45fbe693 100644
--- a/src/main/java/art/arcane/iris/engine/mantle/components/FloatingIslandSampleResolver.java
+++ b/src/main/java/art/arcane/iris/engine/mantle/components/FloatingIslandSampleResolver.java
@@ -23,6 +23,7 @@ import art.arcane.iris.engine.data.cache.Cache;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.mantle.EngineMantle;
import art.arcane.iris.engine.modifier.FloatingIslands;
+import art.arcane.iris.engine.object.terrain.floating.FloatingChildren;
import art.arcane.iris.engine.object.terrain.floating.FloatingIslandBoundarySampler;
import art.arcane.iris.engine.object.terrain.floating.FloatingIslandSample;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
@@ -56,7 +57,7 @@ final class FloatingIslandSampleResolver implements IslandObjectPlacer.SamplePro
return sampleCache.get(key);
}
IrisBiome parent = parent(x, z);
- if (parent == null || parent.getFloatingChildBiomes() == null || parent.getFloatingChildBiomes().isEmpty()) {
+ if (parent == null || FloatingChildren.declaredBy(parent).isEmpty()) {
resolvedSamples.add(key);
return null;
}
diff --git a/src/main/java/art/arcane/iris/engine/mantle/components/FloatingObjectPlacing.java b/src/main/java/art/arcane/iris/engine/mantle/components/FloatingObjectPlacing.java
index 2a74bfb86..6537c02ce 100644
--- a/src/main/java/art/arcane/iris/engine/mantle/components/FloatingObjectPlacing.java
+++ b/src/main/java/art/arcane/iris/engine/mantle/components/FloatingObjectPlacing.java
@@ -543,8 +543,8 @@ public class FloatingObjectPlacing {
try {
IrisData data = engine.getData();
for (IrisBiome biome : engine.getDimension().getReachableBiomes(engine)) {
- List settings = biome.getFloatingChildBiomes();
- if (settings == null || settings.isEmpty()) {
+ List settings = FloatingChildren.declaredBy(biome);
+ if (settings.isEmpty()) {
continue;
}
for (ResolvedFloatingChild entry : FloatingChildren.of(engine).of(settings)) {
diff --git a/src/main/java/art/arcane/iris/engine/mantle/components/ObjectPlacing.java b/src/main/java/art/arcane/iris/engine/mantle/components/ObjectPlacing.java
index 88d18f4b8..80e64d2e1 100644
--- a/src/main/java/art/arcane/iris/engine/mantle/components/ObjectPlacing.java
+++ b/src/main/java/art/arcane/iris/engine/mantle/components/ObjectPlacing.java
@@ -25,6 +25,7 @@ import art.arcane.iris.builtin.carve.CaveAnchorMode;
import art.arcane.iris.builtin.carve.CaveProfile;
import art.arcane.iris.builtin.anchor.ObjectPlaceMode;
import art.arcane.iris.builtin.prepare.AxisRotationClamp;
+import art.arcane.iris.engine.object.terrain.carving.CaveProfiles;
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
import art.arcane.iris.engine.object.placement.IrisObjectVacuum;
import art.arcane.iris.core.IrisSettings;
@@ -78,6 +79,7 @@ import java.util.concurrent.atomic.AtomicLong;
* placement reach of any object the dimension can place.
*/
public class ObjectPlacing {
+ private static final CaveProfile DEFAULT_CAVE_PROFILE = new CaveProfile();
private static final long CAVE_REJECT_LOG_THROTTLE_MS = 5000L;
private static final int BEDROCK_CLEARANCE = 6;
private static final byte LIQUID_FORCED_AIR = 3;
@@ -235,8 +237,8 @@ public class ObjectPlacing {
int rejected = 0;
int nullObjects = 0;
int errors = 0;
- CaveProfile biomeCaveProfile = resolveCaveProfile(caveBiome.getCaveProfile(), region.getCaveProfile());
- CaveProfile regionCaveProfile = resolveCaveProfile(region.getCaveProfile(), caveBiome.getCaveProfile());
+ CaveProfile biomeCaveProfile = resolveCaveProfile(CaveProfiles.declaredBy(caveBiome), CaveProfiles.declaredBy(region));
+ CaveProfile regionCaveProfile = resolveCaveProfile(CaveProfiles.declaredBy(region), CaveProfiles.declaredBy(caveBiome));
CaveAnchorCache caveAnchorCache = new CaveAnchorCache();
for (IrisObjectPlacement i : surfaceBiome.getSurfaceObjects()) {
@@ -384,12 +386,12 @@ public class ObjectPlacing {
@ChunkCoordinates
private void placeProceduralObjects(MantleWriter writer, RNG rng, int x, int z, IrisBiome surfaceBiome, IrisBiome caveBiome, IrisRegion region) {
- CaveProfile surfaceCaveProfile = resolveCaveProfile(surfaceBiome.getCaveProfile(), region.getCaveProfile());
- CaveProfile regionCaveProfile = resolveCaveProfile(region.getCaveProfile(), caveBiome == null ? null : caveBiome.getCaveProfile());
+ CaveProfile surfaceCaveProfile = resolveCaveProfile(CaveProfiles.declaredBy(surfaceBiome), CaveProfiles.declaredBy(region));
+ CaveProfile regionCaveProfile = resolveCaveProfile(CaveProfiles.declaredBy(region), caveBiome == null ? null : CaveProfiles.declaredBy(caveBiome));
placeProceduralFrom(writer, rng, x, z, surfaceBiome.getProceduralObjects(), surfaceBiome.getName(), surfaceCaveProfile, surfaceBiome.getLoadKey());
placeProceduralFrom(writer, rng, x, z, region.getProceduralObjects(), region.getName(), regionCaveProfile, null);
if (caveBiome != null && caveBiome != surfaceBiome) {
- CaveProfile caveProfile = resolveCaveProfile(caveBiome.getCaveProfile(), region.getCaveProfile());
+ CaveProfile caveProfile = resolveCaveProfile(CaveProfiles.declaredBy(caveBiome), CaveProfiles.declaredBy(region));
placeProceduralFrom(writer, rng, x, z, caveBiome.getProceduralObjects(), caveBiome.getName(), caveProfile, caveBiome.getLoadKey());
}
}
@@ -1319,7 +1321,7 @@ public class ObjectPlacing {
}
private CaveProfile resolveCaveProfile(CaveProfile preferred, CaveProfile secondary) {
- CaveProfile dimensionProfile = engine.getDimension().getCaveProfile();
+ CaveProfile dimensionProfile = CaveProfiles.declaredBy(engine.getDimension());
if (preferred != null && preferred.enabled()) {
return preferred;
}
@@ -1332,7 +1334,7 @@ public class ObjectPlacing {
return dimensionProfile;
}
- return new CaveProfile();
+ return DEFAULT_CAVE_PROFILE;
}
private CaveAnchorMode resolveAnchorMode(IrisObjectPlacement objectPlacement, CaveProfile caveProfile) {
diff --git a/src/main/java/art/arcane/iris/engine/modifier/CarveModule.java b/src/main/java/art/arcane/iris/engine/modifier/CarveModule.java
index d69592f3d..4d6a91412 100644
--- a/src/main/java/art/arcane/iris/engine/modifier/CarveModule.java
+++ b/src/main/java/art/arcane/iris/engine/modifier/CarveModule.java
@@ -18,7 +18,10 @@
package art.arcane.iris.engine.modifier;
-import art.arcane.iris.builtin.carve.CaveFieldModule;
+import art.arcane.iris.builtin.carve.CarvingBiomeSettings;
+import art.arcane.iris.builtin.carve.CarvingEnabledSettings;
+import art.arcane.iris.builtin.carve.CarvingSettings;
+import art.arcane.iris.builtin.carve.CaveDepthSettings;
import art.arcane.iris.builtin.carve.CaveProfile;
import com.volmit.FeatureRegistry;
import art.arcane.iris.builtin.IrisStages;
@@ -28,6 +31,7 @@ import art.arcane.iris.engine.mantle.components.CaveCarving;
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
import com.volmit.IrisModule;
import com.volmit.ModuleInfo;
+import com.volmit.service.CaveBiomes;
import com.volmit.stage.ChunkStageContext;
import com.volmit.stage.MantleStageContext;
import com.volmit.stage.StageGraph;
@@ -51,8 +55,12 @@ public final class CarveModule implements IrisModule {
@Override
public void register(FeatureRegistry registry) {
- registry.registerHeldType(CaveProfile.class);
- registry.registerHeldType(CaveFieldModule.class);
+ registry.registerSettings(CaveProfile.class);
+ registry.registerSettings(CarvingSettings.class);
+ registry.registerSettings(CarvingEnabledSettings.class);
+ registry.registerSettings(CarvingBiomeSettings.class);
+ registry.registerSettings(CaveDepthSettings.class);
+ registry.registerService(CaveBiomes.class, new CaveBiomeBands());
}
@Override
@@ -83,6 +91,6 @@ public final class CarveModule implements IrisModule {
* also does: Iris then skips this stage's mantle pass like any disabled component.
*/
private static boolean carves(IrisDimension dimension) {
- return dimension.isCarvingEnabled();
+ return dimension.getModuleSettings().find(CarvingEnabledSettings.class).map(CarvingEnabledSettings::enabled).orElse(true);
}
}
diff --git a/src/main/java/art/arcane/iris/engine/modifier/CaveApplying.java b/src/main/java/art/arcane/iris/engine/modifier/CaveApplying.java
index 15242fee5..c4fa70d32 100644
--- a/src/main/java/art/arcane/iris/engine/modifier/CaveApplying.java
+++ b/src/main/java/art/arcane/iris/engine/modifier/CaveApplying.java
@@ -21,12 +21,13 @@ package art.arcane.iris.engine.modifier;
import art.arcane.iris.engine.UpperDimensionContext;
import art.arcane.iris.builtin.decorant.DecorationPart;
import art.arcane.iris.engine.decorator.BiomeDecorators;
+import art.arcane.iris.engine.terrain.BiomeLayers;
+import art.arcane.iris.engine.terrain.TerrainPalettes;
import art.arcane.iris.engine.decorator.IrisCeilingDecorator;
import art.arcane.iris.engine.decorator.IrisSurfaceDecorator;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.object.world.biome.InferredType;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
-import art.arcane.iris.engine.object.terrain.carving.IrisDimensionCarvingResolver;
import art.arcane.iris.util.project.context.ChunkContext;
import art.arcane.iris.util.common.data.B;
import art.arcane.volmlib.util.documentation.ChunkCoordinates;
@@ -66,6 +67,8 @@ public class CaveApplying {
private final PlatformBlockState AIR = B.getState("CAVE_AIR");
private final PlatformBlockState LAVA = B.getState("LAVA");
private final BiomeDecorators decorators;
+ private final BiomeLayers layers;
+ private final TerrainPalettes palettes;
private final IrisSurfaceDecorator surfaceDecorator;
private final IrisCeilingDecorator ceilingDecorator;
@@ -73,6 +76,8 @@ public class CaveApplying {
this.engine = engine;
rng = new RNG(engine.getSeedManager().getCarve());
decorators = BiomeDecorators.of(engine);
+ layers = BiomeLayers.of(engine);
+ palettes = TerrainPalettes.of(engine);
surfaceDecorator = new IrisSurfaceDecorator(engine);
ceilingDecorator = new IrisCeilingDecorator(engine);
}
@@ -82,7 +87,6 @@ public class CaveApplying {
public void apply(int x, int z, Hunk output, boolean multicore, ChunkContext context) {
PrecisionStopwatch caveStopwatch = PrecisionStopwatch.start();
Mantle mantle = engine.getMantle().getMantle();
- IrisDimensionCarvingResolver.State resolverState = new IrisDimensionCarvingResolver.State();
Long2ObjectOpenHashMap caveBiomeCache = new Long2ObjectOpenHashMap<>(2048);
IrisCarveScratch scratch = SCRATCH.get();
scratch.reset();
@@ -151,7 +155,7 @@ public class CaveApplying {
if (explicitCarveIntent) {
// Only a fluid cavern consumes the fluid sample, and on the maintenance path that
// sample is a full procedural stream evaluation, so never take it per voxel.
- PlatformBlockState fluid = isFluidIntent(cavern) ? context.getFluid().get(rx, rz) : null;
+ PlatformBlockState fluid = isFluidIntent(cavern) ? palettes.fluidAt(chunkBlockX + rx, chunkBlockZ + rz) : null;
output.setRaw(rx, yy, rz, resolveExplicitCarveState(cavern, fluid, LAVA, AIR));
} else if (usesDefaultLava(caveLavaHeight, yy)) {
output.setRaw(rx, yy, rz, LAVA);
@@ -174,11 +178,11 @@ public class CaveApplying {
int worldZ = rz + chunkBlockZ;
String customBiome = cavern.getCustomBiome();
IrisBiome biome = customBiome.isEmpty()
- ? resolveCaveBiome(caveBiomeCache, worldX, yy, worldZ, resolverState)
+ ? resolveCaveBiome(caveBiomeCache, worldX, yy, worldZ)
: resolveCustomBiome(customBiomeCache, customBiome);
if (biome != null) {
- PlatformBlockState data = biome.getWall().get(rng, worldX, yy, worldZ, engine.getData());
+ PlatformBlockState data = layers.wall(biome).get(rng, worldX, yy, worldZ);
int columnIndex = PowerOfTwoCoordinates.packLocal16(rx, rz);
if (data != null && B.isSolid(output.getRaw(rx, yy, rz)) && yy < surfaceHeights[columnIndex]) {
@@ -188,14 +192,14 @@ public class CaveApplying {
});
for (int columnIndex = 0; columnIndex < 256; columnIndex++) {
- processColumnFromMask(output, mantleChunk, mantle, columnMasks[columnIndex], columnIndex, x, z, resolverState, caveBiomeCache, customBiomeCache);
+ processColumnFromMask(output, mantleChunk, mantle, columnMasks[columnIndex], columnIndex, x, z, caveBiomeCache, customBiomeCache);
}
for (int columnIndex = 0; columnIndex < 256; columnIndex++) {
if (boundaryMasks[columnIndex].isEmpty() || !columnMasks[columnIndex].isEmpty()) {
continue;
}
- processBoundaryColumnFromMask(output, boundaryMasks[columnIndex], walls, columnIndex, x, z, resolverState, caveBiomeCache, customBiomeCache);
+ processBoundaryColumnFromMask(output, boundaryMasks[columnIndex], walls, columnIndex, x, z, caveBiomeCache, customBiomeCache);
}
// Surface-break carving must not leave an ore cap suspended across the opening.
@@ -409,7 +413,6 @@ public class CaveApplying {
int columnIndex,
int chunkX,
int chunkZ,
- IrisDimensionCarvingResolver.State resolverState,
Long2ObjectOpenHashMap caveBiomeCache,
Map customBiomeCache
) {
@@ -438,7 +441,7 @@ public class CaveApplying {
zone.ceiling = buf;
} else {
if (zone.isValid(engine)) {
- processZone(output, mc, mantle, zone, rx, rz, worldX, worldZ, resolverState, caveBiomeCache, customBiomeCache);
+ processZone(output, mc, mantle, zone, rx, rz, worldX, worldZ, caveBiomeCache, customBiomeCache);
}
zone = new CaveZone();
zone.setFloor(y);
@@ -450,7 +453,7 @@ public class CaveApplying {
}
if (zone.isValid(engine)) {
- processZone(output, mc, mantle, zone, rx, rz, worldX, worldZ, resolverState, caveBiomeCache, customBiomeCache);
+ processZone(output, mc, mantle, zone, rx, rz, worldX, worldZ, caveBiomeCache, customBiomeCache);
}
}
@@ -461,7 +464,6 @@ public class CaveApplying {
int columnIndex,
int chunkX,
int chunkZ,
- IrisDimensionCarvingResolver.State resolverState,
Long2ObjectOpenHashMap caveBiomeCache,
Map customBiomeCache
) {
@@ -482,14 +484,14 @@ public class CaveApplying {
if (y == zoneCeiling + 1) {
zoneCeiling = y;
} else {
- paintBoundaryZone(output, walls, rx, rz, worldX, worldZ, zoneFloor, zoneCeiling, resolverState, caveBiomeCache, customBiomeCache);
+ paintBoundaryZone(output, walls, rx, rz, worldX, worldZ, zoneFloor, zoneCeiling, caveBiomeCache, customBiomeCache);
zoneFloor = y;
zoneCeiling = y;
}
y = boundaryMask.nextSetBit(y + 1);
}
- paintBoundaryZone(output, walls, rx, rz, worldX, worldZ, zoneFloor, zoneCeiling, resolverState, caveBiomeCache, customBiomeCache);
+ paintBoundaryZone(output, walls, rx, rz, worldX, worldZ, zoneFloor, zoneCeiling, caveBiomeCache, customBiomeCache);
}
private void paintBoundaryZone(
@@ -501,22 +503,21 @@ public class CaveApplying {
int worldZ,
int zoneFloor,
int zoneCeiling,
- IrisDimensionCarvingResolver.State resolverState,
Long2ObjectOpenHashMap caveBiomeCache,
Map customBiomeCache
) {
IrisBiome floorBiome = resolveCaveBoundaryBiome(
walls.get(rx, zoneFloor, rz), worldX, zoneFloor, worldZ,
- resolverState, caveBiomeCache, customBiomeCache);
+ caveBiomeCache, customBiomeCache);
IrisBiome ceilingBiome = resolveCaveBoundaryBiome(
walls.get(rx, zoneCeiling, rz), worldX, zoneCeiling, worldZ,
- resolverState, caveBiomeCache, customBiomeCache);
+ caveBiomeCache, customBiomeCache);
if (floorBiome == null && ceilingBiome == null) {
return;
}
if (floorBiome != null) {
- KList floorLayers = floorBiome.generateLayers(
+ KList floorLayers = layers.generateLayers(floorBiome,
engine.getDimension(), worldX, worldZ, rng, 3, zoneFloor, engine.getData(), engine.getComplex());
for (int i = 0; i < zoneFloor - 1; i++) {
if (!floorLayers.hasIndex(i)) {
@@ -541,7 +542,7 @@ public class CaveApplying {
if (ceilingBiome != null) {
int worldMaxY = engine.getWorld().maxHeight() - engine.getWorld().minHeight();
- KList ceilingLayers = ceilingBiome.generateCeilingLayers(
+ KList ceilingLayers = layers.generateCeilingLayers(ceilingBiome,
engine.getDimension(), worldX, worldZ, rng, 3, zoneCeiling, engine.getData(), engine.getComplex());
for (int i = 0; i < ceilingLayers.size(); i++) {
int ceilingY = zoneCeiling + i + 1;
@@ -574,7 +575,7 @@ public class CaveApplying {
return (h & 15L) == 0L;
}
- private void processZone(Hunk output, MantleChunk mc, Mantle mantle, CaveZone zone, int rx, int rz, int xx, int zz, IrisDimensionCarvingResolver.State resolverState, Long2ObjectOpenHashMap caveBiomeCache, Map customBiomeCache) {
+ private void processZone(Hunk output, MantleChunk mc, Mantle mantle, CaveZone zone, int rx, int rz, int xx, int zz, Long2ObjectOpenHashMap caveBiomeCache, Map customBiomeCache) {
int maxY = output.getHeight();
if (zone.ceiling + 1 < maxY && B.isDecorant(output.getRaw(rx, zone.ceiling + 1, rz))) {
@@ -596,14 +597,14 @@ public class CaveApplying {
mantle.set(xx, zone.floor, zz, MarkerMatter.CAVE_FLOOR);
}
- IrisBiome floorBiome = resolveCaveBoundaryBiome(mc, rx, zone.floor, rz, xx, zz, resolverState, caveBiomeCache, customBiomeCache);
- IrisBiome ceilingBiome = resolveCaveBoundaryBiome(mc, rx, zone.ceiling, rz, xx, zz, resolverState, caveBiomeCache, customBiomeCache);
+ IrisBiome floorBiome = resolveCaveBoundaryBiome(mc, rx, zone.floor, rz, xx, zz, caveBiomeCache, customBiomeCache);
+ IrisBiome ceilingBiome = resolveCaveBoundaryBiome(mc, rx, zone.ceiling, rz, xx, zz, caveBiomeCache, customBiomeCache);
if (floorBiome == null && ceilingBiome == null) {
return;
}
if (floorBiome != null) {
- KList floorBlocks = floorBiome.generateLayers(engine.getDimension(), xx, zz, rng, 3, zone.floor, engine.getData(), engine.getComplex());
+ KList floorBlocks = layers.generateLayers(floorBiome, engine.getDimension(), xx, zz, rng, 3, zone.floor, engine.getData(), engine.getComplex());
for (int i = 0; i < zone.floor - 1; i++) {
if (!floorBlocks.hasIndex(i)) {
break;
@@ -623,7 +624,7 @@ public class CaveApplying {
}
if (ceilingBiome != null) {
- KList ceilingBlocks = ceilingBiome.generateCeilingLayers(engine.getDimension(), xx, zz, rng, 3, zone.ceiling, engine.getData(), engine.getComplex());
+ KList ceilingBlocks = layers.generateCeilingLayers(ceilingBiome, engine.getDimension(), xx, zz, rng, 3, zone.ceiling, engine.getData(), engine.getComplex());
for (int i = 0; i < ceilingBlocks.size(); i++) {
int cy = zone.ceiling + i + 1;
if (cy >= maxY) {
@@ -651,10 +652,10 @@ public class CaveApplying {
}
}
- IrisBiome resolveCaveBoundaryBiome(MantleChunk mantleChunk, int x, int y, int z, int worldX, int worldZ, IrisDimensionCarvingResolver.State resolverState, Long2ObjectOpenHashMap caveBiomeCache, Map customBiomeCache) {
+ IrisBiome resolveCaveBoundaryBiome(MantleChunk mantleChunk, int x, int y, int z, int worldX, int worldZ, Long2ObjectOpenHashMap caveBiomeCache, Map customBiomeCache) {
MatterCavern cavern = dataIfPresent(mantleChunk, x, y, z, MatterCavern.class);
return resolveCaveBoundaryBiome(
- cavern, worldX, y, worldZ, resolverState, caveBiomeCache, customBiomeCache);
+ cavern, worldX, y, worldZ, caveBiomeCache, customBiomeCache);
}
private static T dataIfPresent(MantleChunk mantleChunk, int x, int y, int z, Class type) {
@@ -669,11 +670,11 @@ public class CaveApplying {
return matter.getSlice(type).get(x & 15, y & 15, z & 15);
}
- IrisBiome resolveCaveBoundaryBiome(MatterCavern cavern, int worldX, int y, int worldZ, IrisDimensionCarvingResolver.State resolverState, Long2ObjectOpenHashMap caveBiomeCache, Map customBiomeCache) {
+ IrisBiome resolveCaveBoundaryBiome(MatterCavern cavern, int worldX, int y, int worldZ, Long2ObjectOpenHashMap caveBiomeCache, Map customBiomeCache) {
if (cavern != null && !cavern.getCustomBiome().isEmpty()) {
return resolveCustomBiome(customBiomeCache, cavern.getCustomBiome());
}
- return resolveCaveBiome(caveBiomeCache, worldX, y, worldZ, resolverState);
+ return resolveCaveBiome(caveBiomeCache, worldX, y, worldZ);
}
static boolean canReplaceCaveFloorLayer(Hunk output, int x, int y, int z, PlatformBlockState layer) {
@@ -695,16 +696,16 @@ public class CaveApplying {
return state != null && state.hasGravity();
}
- private IrisBiome resolveCaveBiome(Long2ObjectOpenHashMap caveBiomeCache, int x, int y, int z, IrisDimensionCarvingResolver.State resolverState) {
- IrisBiome center = sampleCaveBiome(caveBiomeCache, x, y, z, resolverState);
+ private IrisBiome resolveCaveBiome(Long2ObjectOpenHashMap