Mantle stages see the terrain at least 16 blocks around their chunk, as chunk stages do

This commit is contained in:
piexel committed 2026-10-10 18:13:46 +02:00
1 parent ceac26bd18
commit 40cb759271
4 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -127,7 +127,7 @@ running Iris is the pack publisher's responsibility.
every chunk within that stage's reach plus the reach of every later stage of a chunk, each chunk once,
before the next stage and before that chunk generates, with the mantle widened by the stage's reach.
Give chunk stages that chunk's mantle; `ChunkRunner` makes it read-only. Give chunk stages a `TerrainSampler` over the
chunk and the 16 blocks around it.
chunk and the 16 blocks around it, and mantle stages one over the chunk and the larger of their reach and 16 blocks.
- 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).
+2
View File
@@ -502,6 +502,8 @@ that `column` works out). The sampler also gives the dimension's
above it. The mantle's `blocks()` are the blocks placements wrote into the mantle for chunks to take over (objects,
structures): a chunk stage copies them into its chunk, as Iris's `iris:matter` does. They are the host's layer, so they
need no registration, and stages only read them; placements keep writing blocks through `PlacementAccess.set`.
A mantle stage's `TerrainSampler` covers the same margin (at least 16 blocks, more when its reach is larger): a carver blends
the profiles of the columns around its chunk, so it reads their heights and biomes though it writes only the mantle.
`ChunkRunner.generate(inputs, seed, timings)` reports how long each stage that ran took, so the host times modules
instead of modules timing themselves.
+1 -1
View File
@@ -125,7 +125,7 @@ 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
no slope. A mantle stage's `ctx.terrain()` covers the chunk and the larger of its reach and 16 blocks around it. `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.
```java
@@ -12,6 +12,10 @@ public interface MantleGenerationContext extends InvocationContext {
/** The chunk's first block along Z, in world coordinates. */
int originZ();
/** The terrain of the chunk and of the larger of the stage's reach and 16 blocks around it on every side, at full
* height: a mantle stage writes only the mantle, but may look at the terrain around its chunk, such as the heights
* a cave blends over its borders.
*/
TerrainSampler terrain();
FeatureSettings settings();