A module jar names its IrisModule class in META-INF/services/com.volmit.IrisModule. PackModules scans <pack>/modules/*.jar in file name order, loads all jars of a pack through one URLClassLoader whose parent is the API's loader, and closes it when the pack unloads. Modules now reach LoadedModules as DiscoveredModule (module plus origin), so errors name the offending jar: missing or multiple entry points, broken entry classes, duplicate module ids and foreign stage namespaces.
IrisApi
Java 25 contracts for Iris modules, with a small host-independent reference implementation. Main code depends only on the JDK. No Bukkit, Iris implementation, Gson or Lombok types appear in the public contracts. Nothing here is stable yet.
DESIGN.md explains the model and its rules. CONTRACTS.md lists what the Iris host adapter still has to provide. Existing Iris features are not ported or wired into this project; the test sources contain example ports only.
Modules own their stages
There are no host-defined hooks or phases. A module declares stages as constants and defines
them in install. Other modules order themselves against those constants.
public final class MossModule implements IrisModule {
public static final PlacementStage<Void> SPREAD = Stage.placement("example:moss/spread");
public ModuleInfo info() { return ModuleInfo.of("example:moss", "1.0.0"); }
public void install(StageGraph graph) {
graph.define(SPREAD)
.when(MossSettings.class) // only where a pack configures moss
.requires(AnchorModule.HEIGHT, BlocksModule.COMPLETE)
.softAfter(StageRef.of("iris:snow/finish")) // ordering only, if snow is installed
.run((ctx, moss) -> spread(ctx.output(AnchorModule.HEIGHT), moss));
}
}
Stage.placement,Stage.placementBlockandStage.chunkcreate stages for the placement pipeline (once per attempt), the placement pipeline (once per object block) and the chunk pipeline. Pass an output class to give a stage a typed output.- A stage id uses the namespace of the module that defines it. Defining an id twice fails.
requires(...)takes another module's stage constant. It orders, makes the output readable and deactivates this stage wherever the requirement is inactive.softAfterandsoftBeforetake ids and only order. There is no hard "before".run(...)ends a stage without output,produce(...)a stage with output andaccumulate(initial, collector)a block stage whose accumulator becomes its output.ctx.output(stage)works only for stages the current stage transitively requires.
IrisModule.register(FeatureRegistry) stays for non-stage contributions: geometry generators
and mantle layers.
Host side
var loaded = LoadedModules.load(acceptedModules, reservedHostFields);
System.out.println(loaded.placement().describe());
var placer = new PlacementRunner(loaded.placement());
PlacementOutcome outcome = placer.place(request, edit, inputs, ConfiguredSettings.of(stilt, snow));
new ChunkRunner(loaded.chunk()).generate(generationContext, chunkSettings);
LoadedModules.load installs every module, catalogs the settings types named in when(...)
together with geometry and mantle registrations, and resolves both pipelines. Graph errors
(missing requirement, cycle, foreign namespace, duplicate, cross-pipeline edge) fail here, at
pack load. describe() prints the order, owners, edge kinds, fused block passes and the stage
pairs that have no path between them.
PlacementRunner owns the edit for one attempt. It commits once if no stage rejects or throws
and closes the edit in every case. Stages get buffered PlacementAccess without commit rights.
Values that stay
ResourceIdrequires a namespace.ResourceKey<T>pairs it with a public type.PackResourcesserves one immutable pack snapshot; caches must not survive a reload.BlockStatehas value equality and sorted properties;BlockRegistrychecks it against the platform.BlockPaletteandNoiseSamplerare typed resources.GeneratedObjectis sparse, immutable local geometry.PlacementRequestaligns its anchor with a world position using checked arithmetic.Hunk<T>is a dense local volume;ArrayHunk<T>is the bounds-checked reference.- The
mantlepackage keeps namespaced typed layers, codecs, lifetimes and buffered edits. IrisFeature,@Feature, the config annotations andOptionsMetadatadescribe settings.
Invocation views expire when the invocation ends. Stage bodies are shared by concurrent invocations and must not keep views or mutable state.
Validation
./gradlew check
The tests cover graph resolution and every error path, fusion, activation cascade, outputs,
rejection and rollback, and install-order determinism. The example ports in
src/test/java/com/volmit/example rebuild preparation, anchoring, block writes, stilt and snow
as separate modules, add a third-party moss module, and add a two-module chunk pipeline. There is
no Minecraft integration or production storage in these tests.