Read settings per column with every level as its own entry, add the mantle pipeline, host types and the one-option shorthand

Settings no longer resolve to one value per type. FeatureSettings.at(type, x, z) returns one entry per
level that declares the type at that column (dimension, region, surface biome, placement), each with
its level, source and value; levels stack and a module decides what several mean. Conditional stage
bodies receive every configured entry. Chunk and mantle runners collect a chunk's settings themselves,
so a stage runs when any column of the chunk configures it.

Work that writes the mantle or reaches beyond its chunk moves to a new MANTLE pipeline (Stage.mantle,
MantleRunner) that the host runs around a chunk before it generates. Chunk stages may no longer declare
a reach or mantle writes and see the mantle read-only.

Built-in settings may hold host types the host describes itself (ModuleHost.describingHostTypesIn,
ValueKind.HostKind); pack modules cannot. FeatureSchema.shorthand() names the only option of settings
packs may write as a bare value.
This commit is contained in:
piexel committed 2026-10-08 11:31:03 +02:00
1 parent 09df1af88e
commit 97ac2a2982
61 files changed
+1316 -184

No files matched your search

@@ -3,12 +3,17 @@ package com.volmit.example.chunk;
import com.volmit.IrisModule;
import com.volmit.ModuleInfo;
import com.volmit.block.BlockState;
import com.volmit.config.FeatureSettings.Entry;
import com.volmit.stage.ChunkStage;
import com.volmit.stage.ChunkStageContext;
import com.volmit.stage.Stage;
import com.volmit.stage.StageGraph;
import java.util.List;
/** Third-party decoration: tops terrain columns using the terrain module's typed output. */
/** Third-party decoration: tops terrain columns using the terrain module's typed output. It runs where any
* column of the chunk has grass and reads the settings per column, so a biome border inside the chunk
* keeps grass on its own side.
*/
public final class GrassModule implements IrisModule {
public static final ChunkStage<Void> TOP = Stage.chunk("example:grass/top");
@@ -25,16 +30,17 @@ public final class GrassModule implements IrisModule {
.run(GrassModule::cover);
}
private static void cover(ChunkStageContext context, GrassSettings grass) {
var top = grass.block();
private static void cover(ChunkStageContext context, List<Entry<GrassSettings>> inChunk) {
var heights = context.output(TerrainModule.SURFACE);
var blocks = context.hunk(BlockState.class);
for (int x = 0; x < blocks.getWidth(); x++) {
for (int z = 0; z < blocks.getDepth(); z++) {
var here = context.settings().at(GrassSettings.class, context.originX() + x, context.originZ() + z);
int height = heights.at(x, z);
if (height > 0) {
blocks.set(x, height - 1, z, top);
if (here.isEmpty() || height <= 0) {
continue;
}
blocks.set(x, height - 1, z, here.getLast().value().block()); // the most specific level wins here
}
}
}