From 13aa3ccc68987764da1256870888f860415ce368 Mon Sep 17 00:00:00 2001 From: piexel Date: Fri, 9 Oct 2026 23:27:19 +0200 Subject: [PATCH] Built-in settings declare their JSON keys: deposits, decorators, importedStructures DepositSettings and DecorantSettings hold their one option's list as the value of the key (root), StructureSettings is the object under importedStructures. The feature ids stay the modules' identity. README names the keys. --- README.md | 9 +++++++-- .../arcane/iris/builtin/decorant/DecorantSettings.java | 4 ++-- .../java/art/arcane/iris/builtin/decorant/Decorator.java | 2 +- .../arcane/iris/builtin/deposit/DepositGenerator.java | 2 +- .../art/arcane/iris/builtin/deposit/DepositSettings.java | 4 ++-- .../arcane/iris/builtin/structure/StructureSettings.java | 6 +++--- .../engine/framework/structure/StructureVanillaHook.java | 2 +- .../iris/engine/mantle/components/StructureModule.java | 2 +- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c489819ad..e7dd7aae7 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ built-ins still reach the same store through `IrisChunk.state(...)` / `engine.ge Settings move off Iris's classes one feature at a time. `iris:deposit` is the first whose settings are IrisApi types only: `DepositSettings` holds `DepositGenerator`s (blocks as `BlockSpec`, its enums beside it in -`art.arcane.iris.builtin.deposit`), and packs write `"iris:deposit": {"generators": [...]}` (the old `"deposits": [...]` is converted by the pack migration script). What needs Iris (resolving the +`art.arcane.iris.builtin.deposit`), and packs write `"deposits": [...]`, as they always have (`@Feature(key = "deposits", root = "generators")`: the key holds the one option's list). What needs Iris (resolving the palette, ore checks, clump shapes per world seed) lives in the module's own code, `ResolvedDeposit`. Settings that live inside a class of Iris's own, such as an object placement's clamp, stilt, vacuum and edit settings, its slope condition, @@ -50,13 +50,18 @@ that needs Iris (noise built from the styles, blocks resolved through the pack, worker (`ResolvedReplace`, `ResolvedCaveProfile`, `ResolvedFloatingChild`, `ResolvedProceduralPlacement`). `iris:decorant` is the second: `DecorantSettings` (biome level) holds `Decorator`s in `art.arcane.iris.builtin.decorant`, -written `"iris:decorant": {"decorators": [...]}` (the old `"decorators": [...]` is converted by the migration script). +written `"decorators": [...]` as always (`@Feature(key = "decorators", root = "decorators")`). `ResolvedDecorator` resolves one decorator's blocks and noise for a world; `BiomeDecorators`, the world's state, keeps them per biome and place. Other modules that decorate (`iris:cave`'s ceilings, floating islands) ask it. A decorator's noise seed is the world's decorator seed, its biome's key and its place in the biome's list. The module's `warmUp` builds them ahead of generation; `iris:terrain` and `iris:objects` warm their ore generators, placements and procedural objects the same way. +Packs write each settings feature under the short key it declares: `deposits` (dimension, region, biome; a list), `decorators` +(biome; a list) and `importedStructures` (dimension; an object of `disabled`, `adjustments` and the rest). The feature ids +(`iris:deposit`, `iris:decorant`, `iris:structure`) stay the modules' identity in the stage graph and logs. A key is unique +per target across all modules and Iris's own fields, so a new built-in or pack module picks a key no field of the target uses. + Every built-in stage is a full port: the module owns its logic and per-engine state, and the mantle stages work out their reach from the pack when it loads. A dimension's `disabledComponents` turns a mantle stage off by its flag (`CARVED`, `OBJECT`, `FLOATING_OBJECT`, `JIGSAW`) or by its stage id. diff --git a/src/main/java/art/arcane/iris/builtin/decorant/DecorantSettings.java b/src/main/java/art/arcane/iris/builtin/decorant/DecorantSettings.java index 775ac54c3..3e00e8ed3 100644 --- a/src/main/java/art/arcane/iris/builtin/decorant/DecorantSettings.java +++ b/src/main/java/art/arcane/iris/builtin/decorant/DecorantSettings.java @@ -28,11 +28,11 @@ import java.util.Collections; import java.util.List; /** - * The decorators one biome declares, written as {@code "iris:decorant": {"decorators": [...]}}. IrisApi types only, like + * The decorators one biome declares, written as {@code "decorators": [...]}, the list of decorators. IrisApi types only, like * {@link Decorator}. */ @Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)") -@Feature(id = "iris:decorant", name = "Decorators", targets = Target.BIOME) +@Feature(id = "iris:decorant", name = "Decorators", key = "decorators", root = "decorators", targets = Target.BIOME) public final class DecorantSettings implements IrisFeature { @MinItems(1) @Desc("Decorators are used for things like tall grass, bisected flowers, and even kelp or cactus (random heights)") diff --git a/src/main/java/art/arcane/iris/builtin/decorant/Decorator.java b/src/main/java/art/arcane/iris/builtin/decorant/Decorator.java index 9ef5e0eff..891a7778b 100644 --- a/src/main/java/art/arcane/iris/builtin/decorant/Decorator.java +++ b/src/main/java/art/arcane/iris/builtin/decorant/Decorator.java @@ -32,7 +32,7 @@ import java.util.List; import java.util.Optional; /** - * One decorator of a biome, as packs write it in the {@code decorators} of {@code "iris:decorant"} or under + * One decorator of a biome, as packs write it in the {@code "decorators"} list or under * {@code snippet/decorator/}: which blocks it places, where, how often and how tall. A value of IrisApi types only; the * decorant module resolves the blocks and builds the noise. */ diff --git a/src/main/java/art/arcane/iris/builtin/deposit/DepositGenerator.java b/src/main/java/art/arcane/iris/builtin/deposit/DepositGenerator.java index 843f5757b..4b6f4e317 100644 --- a/src/main/java/art/arcane/iris/builtin/deposit/DepositGenerator.java +++ b/src/main/java/art/arcane/iris/builtin/deposit/DepositGenerator.java @@ -30,7 +30,7 @@ import java.util.Collections; import java.util.List; /** - * One kind of deposit a dimension, region or biome generates, as packs write it in the {@code generators} of {@code "iris:deposit"} or under + * One kind of deposit a dimension, region or biome generates, as packs write it in the {@code "deposits"} list or under * {@code snippet/deposit/}: how many clumps of which blocks, how large, at which heights and in which biomes. A value * of IrisApi types only; the deposit module builds the clumps and resolves the blocks. */ diff --git a/src/main/java/art/arcane/iris/builtin/deposit/DepositSettings.java b/src/main/java/art/arcane/iris/builtin/deposit/DepositSettings.java index 8da34c2ce..6fd8c5987 100644 --- a/src/main/java/art/arcane/iris/builtin/deposit/DepositSettings.java +++ b/src/main/java/art/arcane/iris/builtin/deposit/DepositSettings.java @@ -26,12 +26,12 @@ import com.volmit.config.Feature; import java.util.List; /** - * The deposits one dimension, region or biome declares, written as {@code "iris:deposit": {"generators": [...]}}. Levels stack: + * The deposits one dimension, region or biome declares, written as {@code "deposits": [...]}, the list of generators. Levels stack: * a chunk gets the deposits of its dimension, its centre column's region and that column's biome. IrisApi types only, * like {@link DepositGenerator}. */ @Desc("Ores and other deposits generated in every chunk where this applies") -@Feature(id = "iris:deposit", name = "Deposits", targets = {Target.DIMENSION, Target.REGION, Target.BIOME}) +@Feature(id = "iris:deposit", name = "Deposits", key = "deposits", root = "generators", targets = {Target.DIMENSION, Target.REGION, Target.BIOME}) public final class DepositSettings implements IrisFeature { @Desc("Define deposit generators that this applies to chunks") private List generators = List.of(); diff --git a/src/main/java/art/arcane/iris/builtin/structure/StructureSettings.java b/src/main/java/art/arcane/iris/builtin/structure/StructureSettings.java index 4ab5886cc..29c7a432a 100644 --- a/src/main/java/art/arcane/iris/builtin/structure/StructureSettings.java +++ b/src/main/java/art/arcane/iris/builtin/structure/StructureSettings.java @@ -33,12 +33,12 @@ import java.util.List; /** * How a dimension treats the platform's own structures (vanilla, data pack and mod structures), written as - * {@code "iris:structure": {"disabled": [...], "adjustments": [...]}}: which ones it disables, how the ones that still + * {@code "importedStructures": {"disabled": [...], "adjustments": [...]}}: which ones it disables, how the ones that still * generate are moved and fitted, how often structure sets start, and whether installed data packs may replace the - * platform's own definitions. The JSON packs wrote as {@code importedStructures}. IrisApi types only. + * platform's own definitions. IrisApi types only. */ @Desc("Controls native vanilla, mod, and ingested datapack structure generation for this dimension. Every registered structure generates through its native placement unless its key matches 'disabled', equals a key in 'disabledExact', or a viable dimension-level Iris placement explicitly replaces its source. Family matching uses namespace, slash, or underscore boundaries, while exact matching compares normalized complete keys only. Run '/iris structure list ' to dump every valid key. Only affects newly generated chunks and is separate from Iris structure placements.") -@Feature(id = "iris:structure", name = "Structures", targets = Target.DIMENSION) +@Feature(id = "iris:structure", name = "Structures", key = "importedStructures", targets = Target.DIMENSION) public final class StructureSettings implements IrisFeature { @MinItems(1) @Ref(Reference.STRUCTURE_PREFIX) diff --git a/src/main/java/art/arcane/iris/engine/framework/structure/StructureVanillaHook.java b/src/main/java/art/arcane/iris/engine/framework/structure/StructureVanillaHook.java index eb6475991..005a14c9c 100644 --- a/src/main/java/art/arcane/iris/engine/framework/structure/StructureVanillaHook.java +++ b/src/main/java/art/arcane/iris/engine/framework/structure/StructureVanillaHook.java @@ -42,7 +42,7 @@ import com.volmit.vanilla.VanillaStructureStartContext; import java.util.List; /** - * What {@code iris:structure} says about the platform's own structures. The dimension's {@code iris:structure} + * What {@code iris:structure} says about the platform's own structures. The dimension's {@code importedStructures} * settings ({@link ImportedStructures}) disable, adjust and set them up; the pack's structure placements replace * them ({@code vanillaSource} with native suppression), place them alongside ({@link IrisStructureLocator#isPlaced}) * and start them where their {@code nativeStructures} grids say ({@link NativeStartPlanner}). diff --git a/src/main/java/art/arcane/iris/engine/mantle/components/StructureModule.java b/src/main/java/art/arcane/iris/engine/mantle/components/StructureModule.java index 4f7952044..54efeb970 100644 --- a/src/main/java/art/arcane/iris/engine/mantle/components/StructureModule.java +++ b/src/main/java/art/arcane/iris/engine/mantle/components/StructureModule.java @@ -51,7 +51,7 @@ import com.volmit.world.PackWorld; * the pack's structure files. *

* It decides over the platform's own structures through its vanilla structure hook ({@link StructureVanillaHook}): the - * dimension's {@code iris:structure} settings disable, adjust and set them up, and the pack's structure placements + * dimension's {@code importedStructures} settings disable, adjust and set them up, and the pack's structure placements * replace them, place them alongside, and start them where their {@code nativeStructures} grids say. */ public final class StructureModule implements IrisModule, ModuleLifecycle {