Settings features declare a short JSON key and may declare a root option

@Feature(key) is required: a plain field name, unique per target across all
modules and the host's own JSON fields (ModuleHost.reservingFields, back for
keys). A clash refuses the pack load naming the key, the target and both
claimants. @Feature(root) declares that the JSON under the key is one option's
value, so a settings class has exactly one shape; FeatureSchema carries it.
This commit is contained in:
piexel committed 2026-10-09 23:16:52 +02:00
1 parent 1707bb95f6
commit b82c292dcb
30 files changed
+536 -119

No files matched your search

@@ -48,7 +48,7 @@ class ChunkPipelineTest {
private static final ResourceId PLAINS = ResourceId.parse("pack:biome/plains");
private static final ResourceId SWAMP = ResourceId.parse("pack:biome/swamp");
@Feature(id = "test:levels", name = "Levels", targets = {Target.DIMENSION, Target.BIOME})
@Feature(id = "test:levels", name = "Levels", key = "levels", targets = {Target.DIMENSION, Target.BIOME})
static final class Marker implements IrisFeature {}
private static ChunkRunner runner() {
@@ -135,7 +135,7 @@ class ChunkPipelineTest {
@Test
void mantleStagesWriteBeyondTheirChunkAndChunkStagesReadTheirOwnPart() {
var loaded = LoadedModules.load(List.of(DiscoveredModule.builtIn(new VeinModule())), Set.of(), Set.of());
var loaded = LoadedModules.load(List.of(DiscoveredModule.builtIn(new VeinModule())), Map.of(), Set.of(), Set.of());
var vein = new Entry<>(Target.BIOME, PLAINS, new VeinSettings(12, 4));
int reach = loaded.mantle().stages().getFirst().reachBlocks(new DeclaredSettings(vein));
assertEquals(3, reach, "a 12 block vein from the centre column runs 3 blocks into the next chunk");