Register settings one type per call; drop core stages from IrisStages

iris:biome and iris:custom are core modules, so their stage constants
now live in BiomeModule and CustomModule instead of the built-ins jar.
This commit is contained in:
piexel committed 2026-11-06 06:30:49 +01:00
1 parent 956c33e8db
commit f466979679
11 files changed
+29 -31

No files matched your search

@@ -73,15 +73,6 @@ public final class IrisStages {
} }
} }
/** Module {@code iris:biome}: the biomes a chunk reports to the server. */
public static final class Biome {
/** Writes every column's biome, sky biome or custom biome, into the chunk. */
public static final ChunkStage<Void> WRITE = Stage.chunk("iris:biome/write");
private Biome() {
}
}
/** Module {@code iris:terrain}: the solid ground, fluids and biome layers of a chunk. */ /** Module {@code iris:terrain}: the solid ground, fluids and biome layers of a chunk. */
public static final class Terrain { public static final class Terrain {
/** Fills each column from bedrock up to its height and the fluid height, with its biome's layers. */ /** Fills each column from bedrock up to its height and the fluid height, with its biome's layers. */
@@ -138,13 +129,4 @@ public final class IrisStages {
private Perfection() { private Perfection() {
} }
} }
/** Module {@code iris:custom}: blocks of content plugins, which the server places after generation. */
public static final class Custom {
/** Records the chunk's custom blocks so the server can place them once the chunk exists. */
public static final ChunkStage<Void> BLOCKS = Stage.chunk("iris:custom/blocks");
private Custom() {
}
}
} }
@@ -58,7 +58,8 @@ public final class DecorantModule implements IrisModule, ModuleLifecycle {
// Ordering only: iris:matter ships in the built-ins jar, which a pack may not have. // Ordering only: iris:matter ships in the built-ins jar, which a pack may not have.
setup.stages().define(IrisStages.Decorant.DECORATE).softAfter(IrisStages.Matter.INSERT).run(DecorantModule::decorate); setup.stages().define(IrisStages.Decorant.DECORATE).softAfter(IrisStages.Matter.INSERT).run(DecorantModule::decorate);
var registry = setup.registry(); var registry = setup.registry();
registry.registerSettings(DecorantSettings.class, DecorateSettings.class); registry.registerSettings(DecorantSettings.class);
registry.registerSettings(DecorateSettings.class);
registry.registerLifecycle(this); registry.registerLifecycle(this);
} }
@@ -43,6 +43,8 @@ import com.volmit.world.PackWorld;
import art.arcane.iris.modules.terrain.TerrainPalettes; import art.arcane.iris.modules.terrain.TerrainPalettes;
import java.util.List;
/** /**
* Module {@code iris:terrain}: the chunk's ground, fluids and biome layers. Each column is filled from bedrock up * Module {@code iris:terrain}: the chunk's ground, fluids and biome layers. Each column is filled from bedrock up
* to its height and the fluid height with its biome's layers, with ore generators of the dimension, region and * to its height and the fluid height with its biome's layers, with ore generators of the dimension, region and
@@ -61,10 +63,10 @@ public final class TerrainModule implements IrisModule, ModuleLifecycle {
public void setup(ModuleSetup setup) { public void setup(ModuleSetup setup) {
setup.stages().define(IrisStages.Terrain.SHAPE).run(TerrainModule::shape); setup.stages().define(IrisStages.Terrain.SHAPE).run(TerrainModule::shape);
var registry = setup.registry(); var registry = setup.registry();
registry.registerSettings(LayersSettings.class, SeaLayersSettings.class, CaveCeilingLayersSettings.class, SlabSettings.class, List.of(LayersSettings.class, SeaLayersSettings.class, CaveCeilingLayersSettings.class, SlabSettings.class,
WallSettings.class, LockLayersSettings.class, LockLayersMaxSettings.class, RockPaletteSettings.class, FluidPaletteSettings.class, WallSettings.class, LockLayersSettings.class, LockLayersMaxSettings.class, RockPaletteSettings.class, FluidPaletteSettings.class,
OreSettings.class, HideOresSettings.class, BedrockSettings.class, ExplodeBiomePalettesSettings.class, OreSettings.class, HideOresSettings.class, BedrockSettings.class, ExplodeBiomePalettesSettings.class,
ExplodeBiomePaletteSizeSettings.class); ExplodeBiomePaletteSizeSettings.class).forEach(registry::registerSettings);
registry.registerService(ProtectedFloor.class, TerrainModule::protectsFloor); registry.registerService(ProtectedFloor.class, TerrainModule::protectsFloor);
registry.registerLifecycle(this); registry.registerLifecycle(this);
setup.tooling().registerView(new BiomePalettes()); setup.tooling().registerView(new BiomePalettes());
@@ -43,7 +43,8 @@ public final class LootModule implements IrisModule {
@Override @Override
public void setup(ModuleSetup setup) { public void setup(ModuleSetup setup) {
var registry = setup.registry(); var registry = setup.registry();
registry.registerSettings(LootSettings.class, BlockDropSettings.class); registry.registerSettings(LootSettings.class);
registry.registerSettings(BlockDropSettings.class);
LootResources.kinds().forEach(registry::registerResourceKind); LootResources.kinds().forEach(registry::registerResourceKind);
registry.registerValidator(new LootValidator()); registry.registerValidator(new LootValidator());
registry.registerService(Loot.class, new LootGiving()); registry.registerService(Loot.class, new LootGiving());
@@ -40,6 +40,8 @@ import com.volmit.service.SaplingGrowth;
import com.volmit.stage.MantleStageContext; import com.volmit.stage.MantleStageContext;
import com.volmit.world.PackWorld; import com.volmit.world.PackWorld;
import java.util.List;
/** /**
* Module {@code iris:objects}: the objects the dimension's regions and biomes place, written into the mantle * Module {@code iris:objects}: the objects the dimension's regions and biomes place, written into the mantle
* once the caves they may anchor in are planned. A port of what was Iris's object mantle component, its work * once the caves they may anchor in are planned. A port of what was Iris's object mantle component, its work
@@ -67,8 +69,9 @@ public final class ObjectModule implements IrisModule, ModuleLifecycle {
var registry = setup.registry(); var registry = setup.registry();
registry.registerService(ObjectsAt.class, new ObjectLocating()); registry.registerService(ObjectsAt.class, new ObjectLocating());
registry.registerService(SaplingGrowth.class, new TreeGrowing()); registry.registerService(SaplingGrowth.class, new TreeGrowing());
registry.registerSettings(ObjectSettings.class, TreeGrowthSettings.class, RequireSurfaceSupportSettings.class, List.of(ObjectSettings.class, TreeGrowthSettings.class, RequireSurfaceSupportSettings.class,
SurfaceSupportBufferSettings.class, UpperObjectsSettings.class, UpperObjectsForceSettings.class); SurfaceSupportBufferSettings.class, UpperObjectsSettings.class, UpperObjectsForceSettings.class)
.forEach(registry::registerSettings);
registry.registerResourceKind(ProceduralObjectCatalog.DEFINITIONS); registry.registerResourceKind(ProceduralObjectCatalog.DEFINITIONS);
registry.registerPlacementType(ObjectPlacement.class, ObjectPlacement.jsonFields()); registry.registerPlacementType(ObjectPlacement.class, ObjectPlacement.jsonFields());
registry.registerLifecycle(this); registry.registerLifecycle(this);
@@ -52,7 +52,8 @@ public final class StructureModule implements IrisModule {
.reach(StructureModule::reach).run(StructureModule::place); .reach(StructureModule::reach).run(StructureModule::place);
var registry = setup.registry(); var registry = setup.registry();
StructureResources.kinds().forEach(registry::registerResourceKind); StructureResources.kinds().forEach(registry::registerResourceKind);
registry.registerSettings(StructureSettings.class, StructurePlacementSettings.class); registry.registerSettings(StructureSettings.class);
registry.registerSettings(StructurePlacementSettings.class);
} }
private static void place(MantleStageContext context) { private static void place(MantleStageContext context) {
@@ -46,6 +46,7 @@ import com.volmit.stage.MantleStageContext;
import com.volmit.world.PackWorld; import com.volmit.world.PackWorld;
import com.volmit.world.TerrainSampler; import com.volmit.world.TerrainSampler;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.function.Function; import java.util.function.Function;
@@ -68,8 +69,9 @@ public final class CarveModule implements IrisModule {
@Override @Override
public void setup(ModuleSetup setup) { public void setup(ModuleSetup setup) {
var registry = setup.registry(); var registry = setup.registry();
registry.registerSettings(CaveProfile.class, CarvingSettings.class, CarvingEnabledSettings.class, CarvingBiomeSettings.class, List.of(CaveProfile.class, CarvingSettings.class, CarvingEnabledSettings.class, CarvingBiomeSettings.class,
CaveDepthSettings.class, CaveLavaHeightSettings.class, UpperDimensionCarvingSettings.class); CaveDepthSettings.class, CaveLavaHeightSettings.class, UpperDimensionCarvingSettings.class)
.forEach(registry::registerSettings);
registry.registerService(CaveBiomes.class, new CaveBiomeBands()); registry.registerService(CaveBiomes.class, new CaveBiomeBands());
var graph = setup.stages(); var graph = setup.stages();
@@ -50,7 +50,9 @@ public final class DepositModule implements IrisModule {
@Override @Override
public void setup(ModuleSetup setup) { public void setup(ModuleSetup setup) {
var registry = setup.registry(); var registry = setup.registry();
registry.registerSettings(DepositVariantSettings.class, OreFrequencySettings.class, OreSizeSettings.class); registry.registerSettings(DepositVariantSettings.class);
registry.registerSettings(OreFrequencySettings.class);
registry.registerSettings(OreSizeSettings.class);
setup.stages().define(IrisStages.Deposit.ORES) setup.stages().define(IrisStages.Deposit.ORES)
.when(DepositSettings.class) .when(DepositSettings.class)
@@ -50,7 +50,8 @@ public final class FloatingModule implements IrisModule {
public void setup(ModuleSetup setup) { public void setup(ModuleSetup setup) {
log = setup.log(); log = setup.log();
var registry = setup.registry(); var registry = setup.registry();
registry.registerSettings(FloatingChildSettings.class, MergeFloatingChildrenSettings.class); registry.registerSettings(FloatingChildSettings.class);
registry.registerSettings(MergeFloatingChildrenSettings.class);
var graph = setup.stages(); var graph = setup.stages();
graph.define(IrisStages.Floating.OBJECTS).softAfter(IrisStages.Objects.PLACE).reach(this::objectReach) graph.define(IrisStages.Floating.OBJECTS).softAfter(IrisStages.Objects.PLACE).reach(this::objectReach)
@@ -38,7 +38,9 @@ public final class PostModule implements IrisModule {
@Override @Override
public void setup(ModuleSetup setup) { public void setup(ModuleSetup setup) {
var registry = setup.registry(); var registry = setup.registry();
registry.registerSettings(PostProcessingSettings.class, PostProcessingSlabsSettings.class, PostProcessingWallsSettings.class); registry.registerSettings(PostProcessingSettings.class);
registry.registerSettings(PostProcessingSlabsSettings.class);
registry.registerSettings(PostProcessingWallsSettings.class);
// Ordering only: iris:carve ships in the built-ins jar, which a pack may not have. // Ordering only: iris:carve ships in the built-ins jar, which a pack may not have.
setup.stages().define(IrisStages.Post.SMOOTH).softAfter(IrisStages.Carve.APPLY).run(SurfaceSmoothing::smooth); setup.stages().define(IrisStages.Post.SMOOTH).softAfter(IrisStages.Carve.APPLY).run(SurfaceSmoothing::smooth);
} }
@@ -44,7 +44,8 @@ public final class SpawnModule implements IrisModule {
@Override @Override
public void setup(ModuleSetup setup) { public void setup(ModuleSetup setup) {
var registry = setup.registry(); var registry = setup.registry();
registry.registerSettings(SpawnerSettings.class, EffectSettings.class); registry.registerSettings(SpawnerSettings.class);
registry.registerSettings(EffectSettings.class);
SpawnResources.kinds().forEach(registry::registerResourceKind); SpawnResources.kinds().forEach(registry::registerResourceKind);
registry.registerService(EntitySpawns.class, new EntitySpawning()); registry.registerService(EntitySpawns.class, new EntitySpawning());
registry.registerService(AmbientEffects.class, new AmbientEffecting()); registry.registerService(AmbientEffects.class, new AmbientEffecting());