From f3d1ff8d13433e40c383fe1b0aee33ca54f03446 Mon Sep 17 00:00:00 2001 From: piexel Date: Sat, 10 Oct 2026 18:05:50 +0200 Subject: [PATCH 1/7] Mantle.caverns(): where the mantle carved voids for a chunk to take over, read-only like the planned blocks --- .../java/com/volmit/host/PlacementViews.java | 6 ++++ .../java/com/volmit/host/ReadOnlyMantle.java | 5 ++++ src/main/java/com/volmit/mantle/Mantle.java | 7 +++++ .../com/volmit/example/ChunkPipelineTest.java | 28 +++++++++++++++++++ .../java/com/volmit/support/MemoryMantle.java | 9 ++++++ 5 files changed, 55 insertions(+) diff --git a/src/main/java/com/volmit/host/PlacementViews.java b/src/main/java/com/volmit/host/PlacementViews.java index ff05e219e..212a820d5 100644 --- a/src/main/java/com/volmit/host/PlacementViews.java +++ b/src/main/java/com/volmit/host/PlacementViews.java @@ -111,6 +111,12 @@ final class PlacementViews { bounds(); return new RestrictedMantleLayer<>(this, parent.blocks()); } + + @Override + public MantleLayer caverns() { + bounds(); + return new RestrictedMantleLayer<>(this, parent.caverns()); + } } private static final class RestrictedMantleLayer implements MantleLayer { diff --git a/src/main/java/com/volmit/host/ReadOnlyMantle.java b/src/main/java/com/volmit/host/ReadOnlyMantle.java index 577e41c60..15cbeede6 100644 --- a/src/main/java/com/volmit/host/ReadOnlyMantle.java +++ b/src/main/java/com/volmit/host/ReadOnlyMantle.java @@ -36,6 +36,11 @@ final class ReadOnlyMantle implements Mantle { return new ReadOnlyLayer<>(mantle.blocks()); } + @Override + public MantleLayer caverns() { + return new ReadOnlyLayer<>(mantle.caverns()); + } + @Override public MantleEdit edit() { throw new UnsupportedOperationException(READ_ONLY); diff --git a/src/main/java/com/volmit/mantle/Mantle.java b/src/main/java/com/volmit/mantle/Mantle.java index 06fd93357..f424bbe2a 100644 --- a/src/main/java/com/volmit/mantle/Mantle.java +++ b/src/main/java/com/volmit/mantle/Mantle.java @@ -32,6 +32,13 @@ public interface Mantle { */ MantleLayer blocks(); + /** Where the mantle holds a carved void for the chunk to take over: a cave's air or fluid, planned before the chunks + * were generated. Present ({@code true}) at carved positions, absent elsewhere, also where the chunk's own blocks + * show no void, such as under a dimension stacked above. The host owns this layer, so it needs no registration. + * Stages read it only, and writes throw UnsupportedOperationException. A dimension that keeps no mantle holds none. + */ + MantleLayer caverns(); + /** Only one edit may be active per view. Parent reads remain allowed, but parent * mutations are prohibited until the edit ends (IllegalStateException). */ diff --git a/src/test/java/com/volmit/example/ChunkPipelineTest.java b/src/test/java/com/volmit/example/ChunkPipelineTest.java index a64959768..22401bdef 100644 --- a/src/test/java/com/volmit/example/ChunkPipelineTest.java +++ b/src/test/java/com/volmit/example/ChunkPipelineTest.java @@ -185,6 +185,34 @@ class ChunkPipelineTest { assertThrows(UnsupportedOperationException.class, () -> mantle.within(chunkArea).blocks().set(0, 0, 0, stone)); } + @Test + void chunkStagesReadWhereTheMantleCarvedVoidsButCannotCarveAny() { + var mantle = new MemoryMantle(); + mantle.carve(6, 9, 2); + var chunkArea = new BlockBox(0, BOTTOM, 0, CHUNK, TOP, CHUNK); + var carved = new ArrayList(); + var probe = Stage.chunk("test:caves/probe"); + IrisModule module = new IrisModule() { + public ModuleInfo info() { return ModuleInfo.of("test:caves", "Caves", "1"); } + public void install(StageGraph graph) { + graph.define(probe).run(context -> { + var caverns = context.mantle().caverns(); + carved.add(String.valueOf(caverns.get(6, 9, 2))); + carved.add(String.valueOf(caverns.get(6, 10, 2))); + }); + } + }; + var builder = new StageGraphBuilder(); + builder.install(DiscoveredModule.builtIn(module)); + var blocks = new ArrayHunk<>(BlockState.class, CHUNK, HEIGHT, CHUNK, AIR); + + new ChunkRunner(builder.resolve(Pipeline.CHUNK)).generate( + TestContexts.generation(Map.of(BlockState.class, blocks), ColumnSettings.NONE, mantle.within(chunkArea)), TestContexts.SEED); + + assertEquals(List.of("true", "null"), carved); + assertThrows(UnsupportedOperationException.class, () -> mantle.within(chunkArea).caverns().set(0, 0, 0, true)); + } + @Test void theRunnerReportsHowLongEachStageThatRanTook() { var timed = new ArrayList(); diff --git a/src/test/java/com/volmit/support/MemoryMantle.java b/src/test/java/com/volmit/support/MemoryMantle.java index 88c77b8a0..da9dc3136 100644 --- a/src/test/java/com/volmit/support/MemoryMantle.java +++ b/src/test/java/com/volmit/support/MemoryMantle.java @@ -21,6 +21,9 @@ public final class MemoryMantle { /** Where the planned blocks are kept; the host owns them, so no module registers this layer. */ private static final MantleKey PLANNED_BLOCKS = new MantleKey<>("host:planned-blocks", BlockState.class); + /** Where the carved voids are kept; the host owns them, so no module registers this layer. */ + private static final MantleKey CAVERNS = new MantleKey<>("host:caverns", Boolean.class); + private final Map> layers = new HashMap<>(); /** A view that accepts reads and writes inside {@code bounds} only. */ @@ -29,6 +32,7 @@ public final class MemoryMantle { public BlockBox bounds() { return bounds; } public MantleLayer layer(MantleKey key) { return new Layer<>(key, bounds, true); } public MantleLayer blocks() { return new Layer<>(PLANNED_BLOCKS, bounds, false); } + public MantleLayer caverns() { return new Layer<>(CAVERNS, bounds, false); } public MantleEdit edit() { throw new UnsupportedOperationException("Edits are not used in these tests"); } }; } @@ -38,6 +42,11 @@ public final class MemoryMantle { values(PLANNED_BLOCKS).put(new BlockPosition(x, y, z), block); } + /** Carves a void into the mantle, as the cave planner would; stages only read them. */ + public void carve(int x, int y, int z) { + values(CAVERNS).put(new BlockPosition(x, y, z), Boolean.TRUE); + } + public T get(MantleKey key, int x, int y, int z) { return key.type().cast(values(key).get(new BlockPosition(x, y, z))); } From 6eac1a87ca96d7f1ab2dd5a48696c0eff8304db1 Mon Sep 17 00:00:00 2001 From: piexel Date: Sat, 10 Oct 2026 18:05:50 +0200 Subject: [PATCH 2/7] PackBiome.vanillaBiome: the biome vanilla's own rules see a pack biome as --- src/main/java/com/volmit/world/PackBiome.java | 14 +++++++++++--- src/test/java/com/volmit/ApiValuesTest.java | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/volmit/world/PackBiome.java b/src/main/java/com/volmit/world/PackBiome.java index d9fbe59ed..4299cf8dd 100644 --- a/src/main/java/com/volmit/world/PackBiome.java +++ b/src/main/java/com/volmit/world/PackBiome.java @@ -5,15 +5,23 @@ import java.util.List; import java.util.Objects; /** A biome of the loaded pack, found through {@code PackResources} by the ids a {@link BiomeSample} gives. - * platformBiome is the platform biome the host writes for it. children are the pack biomes that can - * generate inside it. Rarity is relative to the biome's siblings: higher is rarer. + * platformBiome is the platform biome the host writes for it. vanillaBiome is the biome vanilla's own rules see it as, + * such as which structures may start in it: the platform biome unless the pack says otherwise. children are the pack + * biomes that can generate inside it. Rarity is relative to the biome's siblings: higher is rarer. */ -public record PackBiome(ResourceId id, String name, ResourceId platformBiome, int rarity, List children) { +public record PackBiome(ResourceId id, String name, ResourceId platformBiome, ResourceId vanillaBiome, int rarity, + List children) { public PackBiome { Objects.requireNonNull(id, "id"); Objects.requireNonNull(name, "name"); Objects.requireNonNull(platformBiome, "platformBiome"); + Objects.requireNonNull(vanillaBiome, "vanillaBiome"); if (rarity < 1) throw new IllegalArgumentException("Biome rarity must be at least 1: " + rarity); children = List.copyOf(children); } + + /** A biome that vanilla's rules see as its platform biome. */ + public PackBiome(ResourceId id, String name, ResourceId platformBiome, int rarity, List children) { + this(id, name, platformBiome, platformBiome, rarity, children); + } } diff --git a/src/test/java/com/volmit/ApiValuesTest.java b/src/test/java/com/volmit/ApiValuesTest.java index b9f0cab4b..41668d765 100644 --- a/src/test/java/com/volmit/ApiValuesTest.java +++ b/src/test/java/com/volmit/ApiValuesTest.java @@ -163,6 +163,10 @@ class ApiValuesTest { assertThrows(UnsupportedOperationException.class, () -> desert.children().clear()); assertThrows(IllegalArgumentException.class, () -> new PackBiome(desert.id(), "Desert", desert.platformBiome(), 0, List.of())); + assertEquals(desert.platformBiome(), desert.vanillaBiome(), "vanilla sees the platform biome unless a pack says otherwise"); + var mesa = new PackBiome(ResourceId.parse("pack:mesa"), "Mesa", ResourceId.parse("minecraft:desert"), + ResourceId.parse("minecraft:badlands"), 1, List.of()); + assertEquals(ResourceId.parse("minecraft:badlands"), mesa.vanillaBiome()); var land = List.of(desert.id()); var arid = new PackRegion(ResourceId.parse("pack:arid"), "Arid", 1, land, List.of(), List.of(), List.of()); From d1a1512a6d2372459def3c28ff06cf751bdc65a9 Mon Sep 17 00:00:00 2001 From: piexel Date: Sat, 10 Oct 2026 18:05:50 +0200 Subject: [PATCH 3/7] TerrainSampler: the surface biome's kind, the world Y of the dimension's bottom, image-map ground blocks and the dimension stacked above; FeatureSettings.declaredBy for biomes that are no column's surface biome --- .../com/volmit/config/FeatureSettings.java | 10 +++++++ src/main/java/com/volmit/world/BiomeKind.java | 7 +++++ .../java/com/volmit/world/TerrainSampler.java | 24 ++++++++++++++++ .../java/com/volmit/world/UpperDimension.java | 28 +++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 src/main/java/com/volmit/world/BiomeKind.java create mode 100644 src/main/java/com/volmit/world/UpperDimension.java diff --git a/src/main/java/com/volmit/config/FeatureSettings.java b/src/main/java/com/volmit/config/FeatureSettings.java index a6a31d475..4803a8aeb 100644 --- a/src/main/java/com/volmit/config/FeatureSettings.java +++ b/src/main/java/com/volmit/config/FeatureSettings.java @@ -5,6 +5,7 @@ import com.volmit.IrisFeature; import com.volmit.resource.ResourceId; import java.util.List; import java.util.Objects; +import java.util.Optional; /** Invocation-scoped lookup of the settings that apply at one world column. * @@ -22,6 +23,15 @@ import java.util.Objects; public interface FeatureSettings { List> at(Class featureType, int worldX, int worldZ); + /** The settings {@code biome} declares itself, whichever column it is found at: for a biome that is not a column's + * surface biome, such as the cave biome of {@link com.volmit.world.BiomeSample#caveBiome()}, which is no level of + * {@link #at}. {@code biome} is an id as a {@code BiomeSample} gives it. Empty when the biome declares none, or the + * host knows no such biome. + */ + default Optional declaredBy(ResourceId biome, Class featureType) { + return Optional.empty(); + } + /** One level's declaration of the settings. * * @param level where the settings are declared: the dimension, a region, a biome or the placement diff --git a/src/main/java/com/volmit/world/BiomeKind.java b/src/main/java/com/volmit/world/BiomeKind.java new file mode 100644 index 000000000..6fd9994fa --- /dev/null +++ b/src/main/java/com/volmit/world/BiomeKind.java @@ -0,0 +1,7 @@ +package com.volmit.world; + +/** What a biome is generated as, which decides what grows and spawns in it: the host picks the surface biome of a column + * from the lists of its region (land, sea or shore biomes), and a biome picked for a cave is a {@link #CAVE} biome. + * A child biome is the kind of the biome it was found in. + */ +public enum BiomeKind { LAND, SEA, SHORE, CAVE } diff --git a/src/main/java/com/volmit/world/TerrainSampler.java b/src/main/java/com/volmit/world/TerrainSampler.java index 65d129fcd..f3cb3217b 100644 --- a/src/main/java/com/volmit/world/TerrainSampler.java +++ b/src/main/java/com/volmit/world/TerrainSampler.java @@ -1,6 +1,8 @@ package com.volmit.world; +import com.volmit.block.BlockState; import com.volmit.mantle.BlockBox; +import java.util.Optional; import java.util.OptionalInt; /** Read-only host sampling for the same pack snapshot as the invocation. @@ -30,4 +32,26 @@ public interface TerrainSampler { * Empty when nothing sits above. Outside the bounds it throws like {@link #column}. */ OptionalInt upperDimensionY(int worldX, int worldZ); + + /** What the surface biome of the column was generated as. A cave biome ({@link BiomeSample#caveBiome()}) is always + * {@link BiomeKind#CAVE}, so the answer is about the surface biome only. Outside the bounds it throws like {@link #column}. + */ + BiomeKind surfaceKind(int worldX, int worldZ); + + /** The block an image map of the dimension gives the column's ground, replacing what its biome would put there; empty + * where no map does. Outside the bounds it throws like {@link #column}. + */ + default Optional surfaceBlock(int worldX, int worldZ) { + return Optional.empty(); + } + + /** The Y in the world of the dimension's bottom block, such as {@code -64}: what to add to a height above the bottom + * to get the Y a pack's settings name when they speak of world heights. + */ + int minWorldY(); + + /** The dimension stacked above this one, whose ground starts at {@link #upperDimensionY}; empty when nothing sits above. */ + default Optional upperDimension() { + return Optional.empty(); + } } diff --git a/src/main/java/com/volmit/world/UpperDimension.java b/src/main/java/com/volmit/world/UpperDimension.java new file mode 100644 index 000000000..5174e139a --- /dev/null +++ b/src/main/java/com/volmit/world/UpperDimension.java @@ -0,0 +1,28 @@ +package com.volmit.world; + +import com.volmit.block.BlockState; +import com.volmit.config.FeatureSettings; +import com.volmit.resource.PackResources; +import java.util.Optional; + +/** The dimension stacked above the one being generated, whose ground hangs from the top of this one's volume. It may be + * the dimension itself ({@link #isThisDimension()}). Its own biomes and settings decide what its ground is made of, which + * is why a module that fills it in reads them here and not from the sampler and settings of the dimension it generates. + * Valid for the invocation, like the sampler it comes from. + */ +public interface UpperDimension { + /** Whether the dimension above is this very dimension, stacked on itself. */ + boolean isThisDimension(); + + /** The key the pack knows the dimension by, such as {@code overworld}: what its noise seeds derive from. */ + String key(); + + /** The settings of the upper dimension: its dimension, and the region and surface biome it has at the column. */ + FeatureSettings settings(); + + /** The resources the upper dimension reads: its blocks and its noise. */ + PackResources resources(); + + /** The block an image map of the upper dimension gives its ground at the column; empty where it gives none. */ + Optional surfaceBlock(int worldX, int worldZ); +} From 4a0d82ea3ba6be948cfece77214e0062143e3d9f Mon Sep 17 00:00:00 2001 From: piexel Date: Sat, 10 Oct 2026 18:23:25 +0200 Subject: [PATCH 4/7] BlockRegistry.oreFor: the ore variant that suits the rock it is placed in, which the platform decides --- src/main/java/com/volmit/block/BlockRegistry.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/volmit/block/BlockRegistry.java b/src/main/java/com/volmit/block/BlockRegistry.java index 1bdd429c6..26e5aedc4 100644 --- a/src/main/java/com/volmit/block/BlockRegistry.java +++ b/src/main/java/com/volmit/block/BlockRegistry.java @@ -34,6 +34,14 @@ public interface BlockRegistry { */ PaletteSampler palette(PaletteSpec spec, long seed); + /** The ore that suits the {@code rock} it is placed in, which the platform decides: an ore placed in deepslate is its + * deepslate variant, one placed in other rock its ordinary one. {@code ore} itself when it has no variant, and by + * default for a registry that knows none. + */ + default BlockState oreFor(BlockState rock, BlockState ore) { + return ore; + } + boolean hasTrait(BlockState state, BlockTrait trait); boolean inTag(BlockState state, ResourceId tag); /** Whether state can attach to the specified face of support, ignoring other neighbors. */ From dfdda39667d14283d1db2486dd348465c0ca90bf Mon Sep 17 00:00:00 2001 From: piexel Date: Mon, 12 Oct 2026 02:03:13 +0200 Subject: [PATCH 5/7] GenerationContext.mantle covers the chunk and the 16 blocks around it, like terrain() --- src/main/java/com/volmit/generation/GenerationContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/volmit/generation/GenerationContext.java b/src/main/java/com/volmit/generation/GenerationContext.java index ad27af927..ec92d6bbe 100644 --- a/src/main/java/com/volmit/generation/GenerationContext.java +++ b/src/main/java/com/volmit/generation/GenerationContext.java @@ -20,7 +20,9 @@ public interface GenerationContext extends InvocationContext { FeatureSettings settings(); /** Non-null mantle access scoped to this invocation; the host owns its lifetime. Chunk stages read it - * only: the mantle pipeline has finished around the chunk, and writes throw. + * only: the mantle pipeline has finished around the chunk, and writes throw. Like {@link #terrain()} it covers the + * chunk and the 16 blocks around it, so a stage that places something against a neighbor can see what the mantle + * holds there. */ Mantle mantle(); From 6e53d7b723845b05598daca8a130e6041046c02f Mon Sep 17 00:00:00 2001 From: piexel Date: Mon, 12 Oct 2026 02:19:48 +0200 Subject: [PATCH 6/7] TerrainSampler.surfaceBiome: the id of a column's surface biome alone --- src/main/java/com/volmit/world/TerrainSampler.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/volmit/world/TerrainSampler.java b/src/main/java/com/volmit/world/TerrainSampler.java index f3cb3217b..474b7fa74 100644 --- a/src/main/java/com/volmit/world/TerrainSampler.java +++ b/src/main/java/com/volmit/world/TerrainSampler.java @@ -1,6 +1,7 @@ package com.volmit.world; import com.volmit.block.BlockState; +import com.volmit.resource.ResourceId; import com.volmit.mantle.BlockBox; import java.util.Optional; import java.util.OptionalInt; @@ -33,6 +34,13 @@ public interface TerrainSampler { */ OptionalInt upperDimensionY(int worldX, int worldZ); + /** The id of the column's surface biome, as {@link BiomeSample#surfaceBiome()} gives it, for a module that asks about every + * column of a chunk and has no use for the rest of the sample. The host may answer it without working out the cave biome. + */ + default ResourceId surfaceBiome(int worldX, int worldZ) { + return biome(worldX, bounds().minY(), worldZ).surfaceBiome(); + } + /** What the surface biome of the column was generated as. A cave biome ({@link BiomeSample#caveBiome()}) is always * {@link BiomeKind#CAVE}, so the answer is about the surface biome only. Outside the bounds it throws like {@link #column}. */ From dc28e0ecda2ed3f8794799d6afb3741e8107443e Mon Sep 17 00:00:00 2001 From: piexel Date: Thu, 15 Oct 2026 07:07:12 +0200 Subject: [PATCH 7/7] Docs: the terrain sampler's biome, kind, ground block, bottom Y and upper dimension, the caverns layer, declaredBy, oreFor, the chunk mantle's reach --- CONTRACTS.md | 5 +++++ DESIGN.md | 10 ++++++++++ README.md | 10 ++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CONTRACTS.md b/CONTRACTS.md index d86722509..8e245188b 100644 --- a/CONTRACTS.md +++ b/CONTRACTS.md @@ -131,6 +131,11 @@ running Iris is the pack publisher's responsibility. - Serve `Mantle.blocks()` in every invocation: the blocks placements wrote into the mantle, read-only, none where the dimension keeps no mantle or the chunk generates without it. A block a stage reads and writes back unchanged keeps the host's own identity of it (a custom block of a content plugin stays one). +- Serve `Mantle.caverns()` in every invocation (read-only, none where the dimension keeps no mantle) and cover the chunk and the 16 blocks + around it in a chunk stage's mantle, as the sampler does. +- Answer `TerrainSampler.surfaceBiome(x, z)` (the id `biome(x, y, z).surfaceBiome()` gives), `surfaceKind`, `minWorldY()`, `surfaceBlock` (empty + where no image map gives one) and `upperDimension()` (empty when nothing sits above); `FeatureSettings.declaredBy(biome, type)` answers the + settings the biome declares itself (empty when it declares none or is unknown); `BlockRegistry.oreFor` answers from the platform. - Answer `TerrainSampler.fluidHeight()` (the height the host fills with fluid below) and `upperDimensionY(x, z)` (where a dimension stacked above begins; empty when none does). `surfaceY(x, z)` equals `column(x, z).surfaceY()`; a host overrides it when the height costs less than the whole column. diff --git a/DESIGN.md b/DESIGN.md index b4478d4bd..31cf9b6e2 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -505,6 +505,16 @@ need no registration, and stages only read them; placements keep writing blocks `ChunkRunner.generate(inputs, seed, timings)` reports how long each stage that ran took, so the host times modules instead of modules timing themselves. +The ground a chunk stage fills in needs more of the host than heights. `surfaceBiome(x, z)` answers the biome id of a column without working out the +cave biome; `surfaceKind` says what that biome was generated as (land, sea or shore; a cave biome is always `CAVE`), `surfaceBlock` the block an image +map gives the ground, `minWorldY` the world Y of the dimension's bottom (settings that name world heights, such as a deposit variant's band, are in it), and +`upperDimension()` the dimension stacked above, whose own settings (`UpperDimension.settings()`), resources and image-map blocks decide what its ground is +made of. A biome that is no column's surface biome, such as the cave biome of a `BiomeSample`, has its settings through `FeatureSettings.declaredBy`. +The chunk stage's mantle covers the chunk and the 16 blocks around it like the sampler, so a decoration that attaches to a neighbor sees the blocks +placements planned there; `Mantle.caverns()` is the host's read-only layer of carved voids, as `blocks()` is of planned blocks: a void the planner +marked need not show in the chunk (under a dimension above, the cave stage leaves it solid), and a stage that places something solid asks it. +`BlockRegistry.oreFor(rock, ore)` is the platform's answer to which variant of an ore belongs in a rock. + ## Mantle invocations Some work writes beyond its chunk: a carver whose tunnels cross chunk borders, a vein running on into diff --git a/README.md b/README.md index 7e5022ef8..09caaec5f 100644 --- a/README.md +++ b/README.md @@ -123,8 +123,14 @@ graph.define(APPLY).run(CaveModule::apply); // reads its own chunk's CAVES and A chunk stage writes only its own chunk but may look around it: `ctx.terrain()` covers the chunk and the 16 blocks around it, gives the dimension's `fluidHeight()` and, per column, `upperDimensionY(x, z)` where a dimension stacked above begins (write nothing there). `surfaceY(x, z)` is a column's height alone, cheaper than `column(x, z)` when a stage needs -no slope. `ctx.mantle().blocks()` holds the blocks placements wrote into the mantle for the chunks to -take over, such as objects and structures; a chunk stage copies them in (Iris's `iris:matter`). Stages only read them. +no slope. `surfaceBiome(x, z)` is the id of a column's surface biome alone and `surfaceKind(x, z)` what it was generated as (`BiomeKind`: land, sea, +shore); `surfaceBlock(x, z)` is the block an image map gives the ground there, `minWorldY()` the world Y of the dimension's bottom, and +`upperDimension()` the dimension stacked above (`UpperDimension`: its own settings, resources and image-map blocks), for a stage that fills in its ground. +`ctx.settings().declaredBy(biomeId, Type.class)` reads what a biome declares itself, such as a cave biome of a `BiomeSample`, which is no level of +`at(...)`. `ctx.mantle()` covers the same area as the terrain. `ctx.mantle().blocks()` holds the blocks placements wrote into the mantle for the chunks to +take over, such as objects and structures; a chunk stage copies them in (Iris's `iris:matter`). `ctx.mantle().caverns()` holds `true` where the cave planner +carved a void, whatever the chunk's blocks show there. Stages only read both. `blocks().oreFor(rock, ore)` gives the ore variant that suits the rock +(deepslate ores in deepslate), which the platform decides, and `PackBiome.vanillaBiome()` the biome vanilla's rules see a pack biome as. ```java graph.define(INSERT).run(ctx -> {