From dc28e0ecda2ed3f8794799d6afb3741e8107443e Mon Sep 17 00:00:00 2001 From: piexel Date: Thu, 15 Oct 2026 07:07:12 +0200 Subject: [PATCH] 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 -> {