Commit Graph
27 Commits
Author SHA1 Message Date
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 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 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 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 b12e7a8c49 Document how modules describe settings for studio and what the host renders 2026-10-06 12:17:04 +02:00
piexel 8b7accd19d Add WorldRandom.pick and shuffle so stages need no JDK random APIs
pick(items) is items.get(nextInt(items.size())) and throws on an empty
list. shuffle(items) is Fisher-Yates from the last index down, swapping
i with nextInt(i + 1). RandomAccess lists swap through List.set; other
lists are shuffled in an array copy and written back through their
ListIterator, with the same result. Both are pinned to the Python
reference, including draw counts.
2026-10-06 11:48:44 +02:00
piexel 525c372fc5 Document WorldRandom, id ownership for feature ids and mantle keys, and accumulating ModuleHost
DESIGN describes WorldRandom's algorithms per method, why it does not
implement RandomGenerator, why StrictMath suffices for the gaussian and how
the pinned values are produced. README and CONTRACTS name it as the
generator stages and object generators see. The namespace rule now reads
that feature ids and mantle keys are the module id or below it, with the
new error text, and ModuleHost's methods are documented to accumulate.
2026-10-06 11:37:24 +02:00
piexel 1df8bb3808 Document per-stage random streams, namespace ownership, LoadedPack and jar copies
README, DESIGN and CONTRACTS now describe: the per-stage random stream
contract and why java.util.Random; module-prefixed stage ids, module ids
without '/', reserved namespaces and settings/registration namespaces;
info() read once; LoadedPack and ModuleHost as the host entry point; and
loading from temporary jar copies with stale-copy cleanup.
2026-10-05 21:40:37 +02:00
piexel f5cf4b3ab6 Document the non-exported JDK package error and sun.misc.Unsafe
DESIGN gains the export row at the top of the class check table, why it
comes first, how --add-exports ...=ALL-UNNAMED is honoured and that
qualified exports do not count. CONTRACTS and README name sun.misc.Unsafe
from jdk.unsupported as the supported route, README shows the new error
group and the addExportsTest task.
2026-10-05 21:11:44 +02:00
piexel e34acf2fbb Document optional packages and the unavailable-JDK-module error
README, DESIGN and CONTRACTS describe how a module declares optional
packages in info() (with an example), that they cover only its own jar
and never excuse a load error, why missingClasses() drops excused
classes, and the new error for classes of JDK modules outside the
platform class loader, including the check order and that one error
groups every kind of unusable class.
2026-10-05 21:01:34 +02:00
piexel 3873894a22 Document exposed host packages and optional pack dependencies
README, DESIGN and CONTRACTS now say that modules may use any library
they ship in the pack but never Iris's copy, that classes nobody has
only warn, how each missing reference is classified, and that the host
chooses which packages besides the always-exposed API pack modules can
see, meant for built-in modules' stage constants.
2026-10-05 20:32:14 +02:00
piexel b7b3993a8d Document what pack modules can see and the class checks
Modules compile against the API compileOnly, never ship it, and can use
only the API, the JDK and their own pack's jars. Describe the pack
loader's parent, the resource rule, the reserved com.volmit. prefix, the
load-time class reference check and its limits, and the new errors.
2026-10-05 18:26:27 +02:00
piexel 862f4d19be Document module names, duplicate classes and the load summary
Drop version gating as an open question: packs ship their module jars
and nothing is downloaded, so compatibility is the pack publisher's
responsibility. Describe the duplicate-class rule including
multi-release jars, the per-pack log summary, and the adapter's job of
routing System.Logger output.
2026-10-05 18:02:31 +02:00
piexel 4fa6ddcd7a Document module jars, entry points and pack loading 2026-10-05 17:49:48 +02:00
piexel e918cd44a8 Rewrite docs for the module-owned stage graph
README, DESIGN and CONTRACTS now describe stages, ordering, fusion, activation,
outputs and diagnostics, and drop the removed modifier and planner types.
2026-10-05 17:24:51 +02:00
piexel 9043d93fbd Baseline IrisApi draft before stage-graph redesign 2026-10-05 17:01:18 +02:00