Commit Graph
72 Commits
Author SHA1 Message Date
piexel 8921042fdb registerHeldType: a pack module may describe a class the host loads (an exposed package), not one of its own jar 2026-10-10 18:15:44 +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 d17a017418 PackResources.idOf: the id a pack gives the resource its files name by a key (ResourceId.ofPackKey) 2026-10-10 18:02:08 +02:00
piexel d2d746734f ModuleJarCheck rejects a module that references a class the host's jar leaves out of an exposed library 2026-10-10 15:19:42 +02:00
piexel 1a319d842b Merge branch 'wave3b/p' 2026-10-10 15:07:18 +02:00
piexel 949dd90f10 TerrainSampler.surfaceY: a column's height alone, which a host answers without working out the slope 2026-10-10 14:46:16 +02:00
piexel f99dbc6344 CaveBiomes: a biome's minimum cave depth depends on the world and the biome only, so the host asks once per biome and keeps it 2026-10-10 14:46:16 +02:00
piexel b39c750e26 Service lookups answer from an index the catalog builds once per type instead of filtering every registration per call; a type's @Service annotation is read once 2026-10-10 14:46:07 +02:00
piexel a707b237cf StructureFit.log(): a vanilla structure fit knows the log of the module it was handed to; each provider gets its own fit 2026-10-10 14:25:14 +02:00
piexel e0ffe04a0d ModuleLog: each module's own log, labelled with its id, reached as context.log(), PackWorld.log() and FeatureRegistry.log() 2026-10-10 14:00:38 +02:00
piexel d7de5939d7 Merge branch 'master' into wave3/s 2026-10-10 13:21:43 +02:00
piexel bc2db7222f Merge branch 'wave3/l'
# Conflicts:
#	CONTRACTS.md
#	README.md
2026-10-10 13:05:02 +02:00
piexel 07cb9a57eb Test the AmbientEffects values 2026-10-10 13:01:33 +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 6c0c072afe Surface for ported built-ins: VINE trait, canPlaceOn, the sampler's fluid height and upper dimension, the mantle's planned blocks, a chunk sampler that covers the neighbors, stage timings from the chunk runner 2026-10-10 08:35:10 +02:00
piexel f8d85dcd5e A settings class whose @Feature has no key fails the load naming the module, the class and the key to add 2026-10-10 08:35:10 +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 4755e24407 PlatformStart gives the dimension's bottom; the catalog lists every provider of a service with its module
A shift rule written in world heights (a band of world Y) needs the bottom to convert the start's bounds, and the host
asks each VanillaStructures provider in module order, naming the module when one fails. BlockAccess documents that a
structure fit's access answers only the traits the platform's world can answer natively.
2026-10-10 03:46:12 +02:00
piexel ee7bb11790 VanillaStructures service replaces the vanilla structure hook; fit values leave the API
The hook's rule, starts and setup move to a @Service(ALL) VanillaStructures with default methods. adjustment and the
fit value types (VanillaStructureAdjustment, VanillaStructureFit, StructureTerrain, StructureStilts, YBand) are gone:
modules keep their fit vocabulary as settings. New neutral questions: shift (vertical move of a platform start),
reach (how far around its pieces a module changes terrain for a start), beforePieces/afterPieces around the platform
placing a chunk's starts. StructureFit hands a module the chunk's starts (pieces, junctions, processed template cells,
template columns, legacy template air, platform terrain adaptation and step, the start's memo), the chunk's live
blocks as a BlockAccess, the surface heights and the platform's natural block. VanillaStructureStart carries a
StartMemo instead of a fit; the host keeps it with the start's ownership record.
2026-10-10 02:53:51 +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 1707bb95f6 Merge branch 'wave2/e2' 2026-10-09 22:33:28 +02:00
piexel de35bbedb6 Merge branch 'wave2/d' 2026-10-09 22:33:28 +02:00
piexel 3633c105b4 Document the loot, drop, entity and sapling services and the item and entity values 2026-10-09 22:26:05 +02:00
piexel 93f1768174 Add the EntitySpawns service and EntitySpec 2026-10-09 22:16:35 +02:00
piexel 27ffdb08bd Add the SaplingGrowth service 2026-10-09 22:05:41 +02:00
piexel ad581be494 Add ItemDrop, ItemRegistry and the Loot and BlockDrops services 2026-10-09 22:02:47 +02:00
piexel ba96e0cbc2 ObjectsAt.placedBy: the biomes and regions whose settings place an object 2026-10-09 20:51:05 +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 668d46bd91 Let built-in modules describe the classes Iris's own classes hold (registerHeldType) 2026-10-09 20:46:24 +02:00
piexel 46676fd99b Fix the ModuleHost javadoc after the removal of reserved fields 2026-10-09 20:34:29 +02:00
piexel 435d3798fd Add PaletteSpec, PaletteSampler and BlockRegistry.palette 2026-10-09 20:28:54 +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 3c05cfea0a Add the warmUp lifecycle hook and LifecycleRunner.warmUp 2026-10-09 20:22:29 +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 99a914633d Merge wave1/a2 2026-10-09 14:44:29 +02:00
piexel adb848bf9f Merge wave1/a1 2026-10-09 14:43:33 +02:00
piexel 20d504bd28 Say that a missing image map fails noise building, as Iris's image noise does, instead of falling back 2026-10-09 14:42:33 +02:00
piexel b20a3cf719 Give modules per-world state, lifecycle hooks and services: PackWorld with its state store, InvocationContext.world(), ModuleLifecycle, @Service with Providers ALL, FIRST and ONE, ObjectsAt and StructureLocator, and the host's WorldStates, LifecycleRunner and catalog lookups 2026-10-09 14:32:54 +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 42d31a9ce4 Stop reserving namespaces, let a jar list several modules and add ModuleJarCheck for builds that write module jars
ReservedNamespaces and ModuleHost.reservingNamespaces are gone: a pack module may use any
namespace, iris included. A module id is still loaded once, and the duplicate error now names
the origin and class of both modules, so two modules of one jar can be told apart.

A jar lists one module class per line in META-INF/services/com.volmit.IrisModule and loads all
of them in that order; each class must still be defined in the jar. A jar with several modules
is excused by the optional packages of all of them.

ModuleJarCheck runs the load's class checks on one jar without loading it.
2026-10-09 14:08:33 +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 09afee8ae3 Make Y the height above the dimension's bottom everywhere in the API: document it, and drop GenerationContext.originY, which is always 0 now 2026-10-08 14:50:04 +02:00
piexel 33fc9adca9 Add PackBiome and PackRegion so modules can look up pack biomes and regions through PackResources 2026-10-08 13:34:26 +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 09df1af88e Add BlockState.parse, the inverse of key(), for hosts that read block states from JSON 2026-10-06 14:07:32 +02:00
piexel c5a54558fa Let the host choose the jar copy directory and the logger of pack loads
ModuleHost.copyingJarsTo(directory) and loggingTo(logger) replace the fixed
java.io.tmpdir and System.getLogger. A System.LoggerFinder would not work
for a plugin, whose classes are not on the system class loader.
2026-10-06 14:04:11 +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 3465f8d390 Describe module settings for studio as LoadedPack.schema()
PackSchema (com.volmit.host.schema) is a JSON-free description of every catalogued
settings type: features with their module, JSON field and targets, every reachable
class once by name (cycles end at the name), options with value kind, description,
required, bounds, defaults read from a no-argument instance and @Ref references,
plus object generator settings and snippets. Everything is in a fixed order.

The pack load fails, naming class, field and module, on unsupported field types,
@Ref on fields that are not text, classes without a working no-argument constructor
and snippet names that are not folder names or are used twice. GrassSettings.block
becomes a BlockState, a block reference without @Ref.
2026-10-06 12:14:34 +02:00