diff --git a/CONTRACTS.md b/CONTRACTS.md index 52d71e780..fbcffa3d1 100644 --- a/CONTRACTS.md +++ b/CONTRACTS.md @@ -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). diff --git a/DESIGN.md b/DESIGN.md index 3bebefb60..b588cb3a3 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -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. diff --git a/README.md b/README.md index 3e5c88a68..ce1817f64 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/main/java/com/volmit/generation/MantleGenerationContext.java b/src/main/java/com/volmit/generation/MantleGenerationContext.java index fc27bd6d3..9024981b1 100644 --- a/src/main/java/com/volmit/generation/MantleGenerationContext.java +++ b/src/main/java/com/volmit/generation/MantleGenerationContext.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();