Batch 1 of the API review: one setup entry point, per-pipeline definitions

- IrisModule.setup(ModuleSetup) replaces install(StageGraph) and
  register(FeatureRegistry); ModuleSetups.run is the host entry point.
- The conditional definition variants are gone: a stage body reads the
  settings it is conditioned on through ctx.configured(Type.class).
- Placement, block, chunk and mantle stages each get their own
  definition interface; chunk definitions offer neither reach nor
  writesMantle. MantleStage is no longer generic.
- softAfter/softBefore take stage constants as well as StageRefs.
- A producer that rejected the attempt may return null.
- PlacementRunner, ChunkRunner and MantleRunner all take StageTimings.
- ConfiguredSettings groups entries by the type that declares @Feature.
- README, DESIGN and CONTRACTS updated, with the edge choice table.
This commit is contained in:
piexel committed 2026-10-23 13:00:07 +02:00
1 parent d3c0e4d6cc
commit 1677f4414b
75 files changed
+1201 -838

No files matched your search

@@ -2,13 +2,11 @@ package com.volmit.example.chunk;
import com.volmit.IrisModule;
import com.volmit.ModuleInfo;
import com.volmit.ModuleSetup;
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. It runs where any
* column of the chunk has grass and reads the settings per column, so a biome border inside the chunk
@@ -23,14 +21,14 @@ public final class GrassModule implements IrisModule {
}
@Override
public void install(StageGraph graph) {
graph.define(TOP)
public void setup(ModuleSetup setup) {
setup.stages().define(TOP)
.when(GrassSettings.class)
.requires(TerrainModule.SURFACE)
.run(GrassModule::cover);
}
private static void cover(ChunkStageContext context, List<Entry<GrassSettings>> inChunk) {
private static void cover(ChunkStageContext context) {
var heights = context.output(TerrainModule.SURFACE);
var blocks = context.hunk(BlockState.class);
for (int x = 0; x < blocks.getWidth(); x++) {