Commit Graph
20 Commits
Author SHA1 Message Date
piexel 7143908d4b Batch 2 of the API review: settings stacks, chunk helpers, pack context
- SettingsStack<F> replaces List<Entry<F>> wherever settings stack:
  entries in level order, values(), dimension(), level(Level) and
  mostSpecific().
- com.volmit.config.Level replaces FeatureAttachment.Target;
  FeatureAttachment folds into FeatureDescriptor.targets().
- FeatureSettings.declaredInChunk answers every entry any column of a
  chunk declares, each once.
- ChunkContext gives chunkX/chunkZ, centreX/centreZ and area().
- registerSettings takes several types at once.
- ModuleLifecycle.packLoaded(PackContext) carries resources, settings
  and the module's log.
- TerrainSampler.surfaceHeight gives the surface in whole blocks.
- Stage contexts drop worldSeed() and resources(); world() always
  answers. The scoped world is kept per world and module.
- Javadoc fixes; README, DESIGN and CONTRACTS updated.
2026-10-23 14:17:19 +02:00
piexel e3e8db3329 Reference.PACK_STRUCTURE: a jigsaw structure of the pack
Lets a settings class name the pack's structures by key without naming the
host's structure class, like PACK_BIOME and PACK_OBJECT.
2026-10-15 13:03:42 +02:00
piexel 58ed81032c Merge branch 'wave3b/4'
# Conflicts:
#	README.md
#	src/main/java/com/volmit/world/TerrainSampler.java
2026-10-15 07:13:58 +02:00
piexel d1a1512a6d TerrainSampler: the surface biome's kind, the world Y of the dimension's bottom, image-map ground blocks and the dimension stacked above; FeatureSettings.declaredBy for biomes that are no column's surface biome 2026-10-10 18:05:50 +02:00
piexel 60d4deb0e9 Reference.LOOT_TABLE: an option that names a loot table of the platform 2026-10-10 18:03:52 +02:00
piexel bc2db7222f Merge branch 'wave3/l'
# Conflicts:
#	CONTRACTS.md
#	README.md
2026-10-10 13:05:02 +02:00
piexel 25f9ea2f37 LinkedBiomes: settings name the pack biomes they bring into the layout; CaveBiomes service: the cave biome a module puts at a position and a biome's minimum cave depth 2026-10-10 08:51:28 +02:00
piexel 284213e9b8 AmbientEffects service: the effects due around a player, decided by the module; Reference.SPECIAL_ENTITY 2026-10-10 08:46:32 +02:00
piexel 6757cbdd0f Reference.TEMPLATE_POOL: JigsawOverrides.startPool names one of the platform's template pools
Studio completes the pool again from the platform's registered template pools, as the Iris class's native jigsaw
pool annotation did. A pack's own jigsaw pools are not valid here: the override replaces the start pool of a vanilla,
datapack or modded jigsaw structure.
2026-10-10 08:05:00 +02:00
piexel b82c292dcb 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.
2026-10-09 23:16:52 +02:00
piexel c90ce5ce47 Vanilla structure hook: starts, adjustments and setup, with the fit value types they carry
VanillaStructureHook gains three default methods: starts(chunkX, chunkZ, context) for the platform
structures a module starts itself, adjustment(structure, underground, context) for what it changes
about the platform's own starts, and setup(context) for structure set frequencies and protecting the
platform's own definitions from installed data packs. Values: VanillaStructureStart,
VanillaStructureStartContext, VanillaStructureFit, VanillaStructureAdjustment, VanillaStructureSetup,
and the settings-shaped StructureTerrain, StructureStilts, YBand and JigsawOverrides with the JSON
Iris already reads. Reference gains STRUCTURE_PREFIX and STRUCTURE_SET.
2026-10-09 20:50:59 +02:00
piexel 0f05676b7a Add @MinItems for list, set and array options and describe it in the pack schema 2026-10-09 20:26:31 +02:00
piexel f6c078aade Remove feature aliases, the one-option shorthand and reserved host fields
A setting has one JSON key, its feature id, and one shape, its settings object.
Aliases were the only reason for reserved host fields (ids contain ':', host
fields never do), so ModuleHost.reservingFields goes too.
2026-10-09 20:19:08 +02:00
piexel 84969c74bd Add value types for settings (BlockSpec, NoiseStyle, StyledRange, Range, BlockPosition, Object as any JSON), host-built noise through PackResources.noise(), and VanillaStructureHook for the platform's own structures 2026-10-09 14:20:10 +02:00
piexel ef4b640867 Let modules declare pack resource kinds and validators: ResourceKind, PackResources.ids, @ResourceRef, the validation API and folders the host reserves 2026-10-08 20:36:10 +02:00
piexel 50f51db8b2 Run each mantle stage as its own pass and let mantle stages work out their reach per pack
MantleRunner.generate(stage, inputs, seed) runs one mantle stage for one chunk. The host runs every
mantle stage as its own pass in resolved order, so a stage sees what earlier stages wrote into the
chunks around it. Activation still follows requires(...): the runner collects the settings of the stage
and of everything it requires, and only those. Because the stages of one chunk now run in different
invocations, mantle stages have no output (Stage.mantle declares Void) and pass data on through
mantle layers.

A mantle stage whose reach depends on the pack declares reach(PackReach). The host works it out once
per pack load from PackSettings, every entry the dimension and its regions and biomes declare, with
ResolvedStage.reachBlocks(settings); a negative result fails naming the stage. Placement and chunk
stages may not declare one, and ResolvedGraph.reach() throws for a mantle pipeline that has one.
VeinModule now sizes its reach from the pack's longest vein.
2026-10-08 12:35:04 +02:00
piexel 97ac2a2982 Read settings per column with every level as its own entry, add the mantle pipeline, host types and the one-option shorthand
Settings no longer resolve to one value per type. FeatureSettings.at(type, x, z) returns one entry per
level that declares the type at that column (dimension, region, surface biome, placement), each with
its level, source and value; levels stack and a module decides what several mean. Conditional stage
bodies receive every configured entry. Chunk and mantle runners collect a chunk's settings themselves,
so a stage runs when any column of the chunk configures it.

Work that writes the mantle or reaches beyond its chunk moves to a new MANTLE pipeline (Stage.mantle,
MantleRunner) that the host runs around a chunk before it generates. Chunk stages may no longer declare
a reach or mantle writes and see the mantle read-only.

Built-in settings may hold host types the host describes itself (ModuleHost.describingHostTypesIn,
ValueKind.HostKind); pack modules cannot. FeatureSchema.shorthand() names the only option of settings
packs may write as a bare value.
2026-10-08 11:31:03 +02:00
piexel a325640d5d Key settings by feature id, order options as declared and declare stage reach
- Packs write settings under the feature id. @Feature(field) becomes an
  optional alias that only built-in modules may set, so existing pack JSON
  keeps loading; a pack module setting one fails the load. Reserved host
  fields now only constrain aliases. FeatureSchema exposes key and alias.
- Pack snippet names live under their module's folder
  (snippet/<namespace>/<path>/...); snippet names are folder paths.
- OptionsMetadata lists options in declaration order, read from the class
  file, a superclass's first.
- @Ref(PACK_BIOME|PACK_REGION|PACK_OBJECT) fits String only.
- Stage definitions declare reach(blocks) and writesMantle(layers);
  ResolvedGraph.reach() collects the pipeline and per-layer maximum, and
  the load fails on an unregistered or mistyped layer.
2026-10-06 13:59:28 +02:00
piexel 93c755ffe4 Add FeatureRegistry.registerSettings and the @Ref annotation for value references
Modules register settings types that no stage names in when(...) explicitly; the
id must be the module's id or below it, and repeating it or also naming the type
in when(...) changes nothing. A type its owner registered may be named by any
module. OptionsMetadata.Option now carries its field and @Ref reference.
2026-10-06 12:06:46 +02:00
piexel 9043d93fbd Baseline IrisApi draft before stage-graph redesign 2026-10-05 17:01:18 +02:00