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/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/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/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..ee0b330a4
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/actuator/ResolvedOre.java
@@ -0,0 +1,125 @@
+/*
+ * 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;
+ }
+ NoiseSampler sampler = chance.aquire(() -> noise.sampler(settings.chanceStyle(), terrainSeed));
+ if (sampler.sample(x, y, z) > settings.threshold()) {
+ return null;
+ }
+ return pick(x, y, z);
+ }
+
+ 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..3ebec481d 100644
--- a/src/main/java/art/arcane/iris/engine/actuator/TerrainModule.java
+++ b/src/main/java/art/arcane/iris/engine/actuator/TerrainModule.java
@@ -19,14 +19,15 @@
package art.arcane.iris.engine.actuator;
import art.arcane.iris.builtin.IrisStages;
+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;
@@ -63,6 +64,8 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
@Override
public void register(FeatureRegistry registry) {
+ registry.registerSettings(OreSettings.class);
+ registry.registerSettings(HideOresSettings.class);
registry.registerLifecycle(this);
}
@@ -86,10 +89,16 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
private static final PlatformBlockState BEDROCK = B.getState("BEDROCK");
private final Engine engine;
+ private final TerrainOres ores;
private final RNG rng;
TerrainShaper(Engine engine) {
+ this(engine, TerrainOres.of(engine));
+ }
+
+ TerrainShaper(Engine engine, TerrainOres ores) {
this.engine = engine;
+ this.ores = ores;
this.rng = new RNG(engine.getSeedManager().getTerrain());
}
@@ -115,7 +124,7 @@ 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();
@@ -123,11 +132,10 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
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;
@@ -143,16 +151,14 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
PlatformBlockState fluid = fluidCache.get(xf, zf);
PlatformBlockState rock = rockCache.get(xf, zf);
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 +170,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) {
@@ -209,14 +215,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);
}
}
@@ -264,22 +270,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..8dc6a9b0e
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/actuator/TerrainOres.java
@@ -0,0 +1,53 @@
+/*
+ * 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. */
+ ResolvedOres of(IrisRegistrant owner) {
+ OreSettings settings = owner.getModuleSettings().find(OreSettings.class).orElse(null);
+ if (settings == null) {
+ return ResolvedOres.NONE;
+ }
+ return resolved.computeIfAbsent(settings, declared -> ResolvedOres.of(declared, engine));
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/modifier/DepositModule.java b/src/main/java/art/arcane/iris/engine/modifier/DepositModule.java
index f2889714b..668755e37 100644
--- a/src/main/java/art/arcane/iris/engine/modifier/DepositModule.java
+++ b/src/main/java/art/arcane/iris/engine/modifier/DepositModule.java
@@ -21,7 +21,11 @@ package art.arcane.iris.engine.modifier;
import art.arcane.iris.builtin.IrisStages;
import art.arcane.iris.builtin.deposit.DepositGenerator;
import art.arcane.iris.builtin.deposit.DepositSettings;
+import art.arcane.iris.builtin.deposit.DepositVariantSettings;
+import art.arcane.iris.builtin.deposit.OreFrequencySettings;
+import art.arcane.iris.builtin.deposit.OreSizeSettings;
import art.arcane.iris.core.modules.IrisChunk;
+import com.volmit.FeatureRegistry;
import com.volmit.IrisModule;
import com.volmit.ModuleInfo;
import com.volmit.config.FeatureSettings;
@@ -48,6 +52,13 @@ public final class DepositModule implements IrisModule {
return ModuleInfo.of("iris:deposit", "Deposits", VERSION);
}
+ @Override
+ public void register(FeatureRegistry registry) {
+ registry.registerSettings(DepositVariantSettings.class);
+ registry.registerSettings(OreFrequencySettings.class);
+ registry.registerSettings(OreSizeSettings.class);
+ }
+
@Override
public void install(StageGraph graph) {
graph.define(IrisStages.Deposit.ORES)
diff --git a/src/main/java/art/arcane/iris/engine/modifier/DepositPlacer.java b/src/main/java/art/arcane/iris/engine/modifier/DepositPlacer.java
index ff3844442..2a8906b69 100644
--- a/src/main/java/art/arcane/iris/engine/modifier/DepositPlacer.java
+++ b/src/main/java/art/arcane/iris/engine/modifier/DepositPlacer.java
@@ -21,10 +21,14 @@ package art.arcane.iris.engine.modifier;
import art.arcane.iris.builtin.deposit.DepositGenerator;
import art.arcane.iris.builtin.deposit.DepositHeightDistribution;
import art.arcane.iris.builtin.deposit.DepositPlacementScope;
+import art.arcane.iris.builtin.deposit.DepositVariant;
+import art.arcane.iris.builtin.deposit.DepositVariantSettings;
+import art.arcane.iris.builtin.deposit.OreFrequencySettings;
+import art.arcane.iris.builtin.deposit.OreSizeSettings;
+import art.arcane.iris.core.loader.IrisRegistrant;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.framework.EngineAssignedComponent;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
-import art.arcane.iris.engine.object.terrain.deposit.IrisDepositVariant;
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
import art.arcane.iris.engine.object.terrain.carving.IrisDimensionCarvingResolver;
import art.arcane.iris.engine.object.prefab.IrisObject;
@@ -52,7 +56,10 @@ import java.util.concurrent.ConcurrentHashMap;
*/
public class DepositPlacer extends EngineAssignedComponent {
private final RNG rng;
+ private static final double UNCHANGED_ORE_MULTIPLIER = 1D;
+
private final Map resolved = new ConcurrentHashMap<>();
+ private final Map variants = new ConcurrentHashMap<>();
public DepositPlacer(Engine engine) {
super(engine, "Deposit");
@@ -150,13 +157,13 @@ public class DepositPlacer extends EngineAssignedComponent {
if (oreDeposit) {
if (depositBiome != null) {
- double frequencyMultiplier = depositBiome.getOreDepositFrequencyMultiplier();
+ double frequencyMultiplier = oreFrequencyMultiplier(depositBiome);
if (frequencyMultiplier < 1D
&& !passesOreFrequency(frequencyMultiplier, rng.d())) {
continue;
}
- double sizeMultiplier = depositBiome.getOreDepositSizeMultiplier();
+ double sizeMultiplier = oreSizeMultiplier(depositBiome);
if (sizeMultiplier != 1D) {
IrisObject scaledClump = deposit.clump(rng, sizeMultiplier);
int scaledDimension = scaledClump.getW();
@@ -317,7 +324,7 @@ public class DepositPlacer extends EngineAssignedComponent {
IrisBiome biome = getEngine().getCaveBiome(worldX, localY, worldZ, carvingState);
if (biome != null) {
- PlatformBlockState match = matchDepositVariant(biome.getDepositVariants(), ore, worldY);
+ PlatformBlockState match = matchDepositVariant(biome, ore, worldY);
if (match != null) {
return match;
}
@@ -325,14 +332,14 @@ public class DepositPlacer extends EngineAssignedComponent {
IrisRegion region = context.getRegion().get(nx, nz);
if (region != null) {
- PlatformBlockState match = matchDepositVariant(region.getDepositVariants(), ore, worldY);
+ PlatformBlockState match = matchDepositVariant(region, ore, worldY);
if (match != null) {
return match;
}
}
if (dimension != null) {
- PlatformBlockState match = matchDepositVariant(dimension.getDepositVariants(), ore, worldY);
+ PlatformBlockState match = matchDepositVariant(dimension, ore, worldY);
if (match != null) {
return match;
}
@@ -341,17 +348,14 @@ public class DepositPlacer extends EngineAssignedComponent {
return null;
}
- private PlatformBlockState matchDepositVariant(java.util.List variants, PlatformBlockState ore, int y) {
- if (variants == null || variants.isEmpty()) {
- return null;
- }
-
- for (IrisDepositVariant variant : variants) {
- if (y < variant.getMinHeight() || y > variant.getMaxHeight()) {
+ private PlatformBlockState matchDepositVariant(IrisRegistrant owner, PlatformBlockState ore, int y) {
+ for (DepositVariant declared : variantsOf(owner)) {
+ ResolvedDepositVariant variant = variants.computeIfAbsent(declared, ResolvedDepositVariant::new);
+ if (!variant.appliesAt(y)) {
continue;
}
- PlatformBlockState swapped = variant.remapOrNull(ore, getData());
+ PlatformBlockState swapped = variant.remapOrNull(ore);
if (swapped != null) {
return swapped;
}
@@ -359,4 +363,16 @@ public class DepositPlacer extends EngineAssignedComponent {
return null;
}
+
+ private static List variantsOf(IrisRegistrant owner) {
+ return owner.getModuleSettings().find(DepositVariantSettings.class).map(DepositVariantSettings::variants).orElse(List.of());
+ }
+
+ private static double oreFrequencyMultiplier(IrisBiome biome) {
+ return biome.getModuleSettings().find(OreFrequencySettings.class).map(OreFrequencySettings::multiplier).orElse(UNCHANGED_ORE_MULTIPLIER);
+ }
+
+ private static double oreSizeMultiplier(IrisBiome biome) {
+ return biome.getModuleSettings().find(OreSizeSettings.class).map(OreSizeSettings::multiplier).orElse(UNCHANGED_ORE_MULTIPLIER);
+ }
}
diff --git a/src/main/java/art/arcane/iris/engine/modifier/PerfectionModule.java b/src/main/java/art/arcane/iris/engine/modifier/PerfectionModule.java
index 6e45f193f..cc98dc82c 100644
--- a/src/main/java/art/arcane/iris/engine/modifier/PerfectionModule.java
+++ b/src/main/java/art/arcane/iris/engine/modifier/PerfectionModule.java
@@ -20,6 +20,7 @@ package art.arcane.iris.engine.modifier;
import art.arcane.iris.builtin.IrisStages;
import art.arcane.iris.core.modules.IrisChunk;
+import art.arcane.iris.engine.actuator.HiddenOres;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.object.procedural.IrisProceduralBlocks;
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
@@ -68,7 +69,7 @@ public final class PerfectionModule implements IrisModule {
IrisDimension dimension = engine.getDimension();
PrecisionStopwatch stopwatch = PrecisionStopwatch.start();
Hunk blocks = chunk.blocks();
- if (dimension.isHideOresForHiddenOre()) {
+ if (HiddenOres.in(dimension)) {
hideOres(blocks);
}
boolean removed;
diff --git a/src/main/java/art/arcane/iris/engine/modifier/ResolvedDepositVariant.java b/src/main/java/art/arcane/iris/engine/modifier/ResolvedDepositVariant.java
new file mode 100644
index 000000000..b1a6dce34
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/modifier/ResolvedDepositVariant.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.engine.modifier;
+
+import art.arcane.iris.builtin.deposit.DepositVariant;
+import art.arcane.iris.engine.data.cache.AtomicCache;
+import art.arcane.iris.engine.object.procedural.IrisProceduralBlocks;
+import art.arcane.iris.spi.PlatformBlockState;
+import art.arcane.iris.util.common.data.B;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * One {@link DepositVariant} made ready: its source and replacement block ids resolved to the platform's blocks, built once on
+ * first use. A rule whose source or replacement the platform does not know remaps nothing.
+ */
+final class ResolvedDepositVariant {
+ private final DepositVariant settings;
+ private final AtomicCache