TerrainSampler.surfaceY: a column's height alone, which a host answers without working out the slope

This commit is contained in:
piexel committed 2026-10-10 14:46:16 +02:00
1 parent f99dbc6344
commit 949dd90f10
4 files changed
+13 -3

No files matched your search

+2 -1
View File
@@ -128,7 +128,8 @@ running Iris is the pack publisher's responsibility.
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).
- 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).
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.
- Make placement edits atomic across blocks, block entities, markers and mantle in generation
storage. Abort chunk publication when any stage fails.
- Preserve unknown persisted mantle layers or fail explicitly.
+2 -1
View File
@@ -496,7 +496,8 @@ whose writes throw. The runner does no neighbor scheduling or rollback. A failed
the host from publishing the chunk.
A chunk stage writes only its chunk but may look around it: its `TerrainSampler` covers the chunk and the 16 blocks
around it, so a stage that smooths a surface reads its neighbors' heights. The sampler also gives the dimension's
around it, so a stage that smooths a surface reads its neighbors' heights (`surfaceY`, which spares the host the slope
that `column` works out). The sampler also gives the dimension's
`fluidHeight()` and, per column, `upperDimensionY` where a dimension stacked above begins; a stage writes nothing at or
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
+2 -1
View File
@@ -122,7 +122,8 @@ 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). `ctx.mantle().blocks()` holds the blocks placements wrote into the mantle for the chunks to
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.
```java
@@ -11,6 +11,13 @@ import java.util.OptionalInt;
public interface TerrainSampler {
BlockBox bounds();
TerrainSample column(int worldX, int worldZ);
/** The column's {@link TerrainSample#surfaceY()} alone, for a module that needs neither slope nor fluid: the host
* may answer it without working out the rest of {@link #column}. Outside the bounds it throws like {@link #column}.
*/
default double surfaceY(int worldX, int worldZ) {
return column(worldX, worldZ).surfaceY();
}
BiomeSample biome(int worldX, int y, int worldZ);
/** The height up to which the host fills the world with fluid wherever the terrain lies lower, the sea level of the