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.
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.
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.
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.
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.
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.
- 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.
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.
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.
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.
java.util.Random fixes only some of its methods; the ranged RandomGenerator
defaults module authors reach for are left to the JDK, so an update could
change existing worlds. WorldRandom does not implement RandomGenerator and
exposes a curated set (ints, longs, ranges, booleans, floats, doubles,
gaussian, chance) with Lemire bounds and the polar gaussian on StrictMath.
StageContext, ObjectGenerationContext and BlockPalette now use it.
StageRandom becomes StageStreams; the seed derivation is unchanged. Every
method is pinned to values from an independent Python reference in
src/test/reference.
Object feature ids and mantle keys a module registers must now equal its
module id or start with it and '/', the rule stage ids already follow,
instead of only sharing its namespace. A settings type named in when(...)
needs a feature id that at least one module naming it owns in the same
sense, so another module may still condition on it, as moss can on
iris:snow. ModuleInfo.ownsId states the rule; stageIdPrefix becomes
idPrefix since it now prefixes more than stages. Errors name the module
and its origin and suggest an owned id.
reservingFields replaced the reserved fields, unlike exposing and
reservingNamespaces, which add. It now merges the given names per
attachment target with those reserved before, so every ModuleHost method
accumulates. Blank field names now fail when the host configuration is
built, like invalid packages and namespaces, instead of at the first
pack load.
PackModules copies the pack's jars into a fresh iris-pack-modules-*
directory and reads, checks and defines classes from the copies only, so
a load sees one consistent snapshot and the pack class loader never holds
the originals open (on Windows that locked them against rebuilding).
Copies are deleted when the pack closes (after its loader) and on any
load failure. Messages and origins keep naming modules/<jar>, including
an entry class found in another jar of the pack.
Each copy directory holds an owner file with the creating process id. A
later load removes directories whose owner process has exited and that
hold only that file and jars; everything else is left alone.
ModuleHost holds what the host passes to every pack load: built-in
modules (info read once), exposed host packages, reserved JSON fields and
reserved namespaces, validated when built. LoadedPack.load(packRoot, host)
loads the pack's jars, installs them with the built-ins and resolves both
pipelines; on any failure it closes the pack before rethrowing, and
close() releases the pack's class loader. PackModules and LoadedModules
stay available as the lower-level pieces.
Stages no longer share one RandomGenerator. StageContext.random() is the
running stage's own stream: java.util.Random seeded with
mix(mix(invocationSeed) ^ fnv1a64(utf8(stageId))), mix being the
SplitMix64 finalizer. Adding, removing or reordering modules, or how much
other stages draw, no longer changes a stage's draws. A block stage keeps
one stream across the blocks of its pass.
The host passes a long invocation seed to PlacementRunner.place and
ChunkRunner.generate instead of a RandomGenerator on the inputs;
InvocationContext loses random(), so stages cannot reach a shared stream.
ObjectGenerationContext keeps its own random() for geometry generators.
StageRandom documents the derivation, and a test pins it to values
computed from the specification.
- LoadedModules.load takes the host's reserved namespaces (such as iris);
a pack module whose id uses one fails, naming its jar and the namespace.
- A module defines only stages whose ids start with its own id and '/'.
Module ids may no longer contain '/', so ids cannot nest and every
stage id has exactly one possible owner.
- Object feature ids and mantle keys must use the registering module's
namespace; ModuleRegistry.register(DiscoveredModule) scopes registration.
- A settings type named in when(...) needs a feature id in the namespace
of some module naming it, so modules can still condition on another
module's settings.
DiscoveredModule is now a final class holding the module, the ModuleInfo
read when the module was found (pack jar or builtIn) and its origin.
Graph install, load errors, the pack summary and optional-package
filtering use only that stored value.
A class such as jdk.internal.misc.Unsafe passed the reference check,
because the platform loader finds it, but java.base does not export
jdk.internal.misc to unnamed modules, so the module failed with an
IllegalAccessError once the code ran. It is now a load error with its
own group:
Module jar modules/user.jar uses classes of JDK packages that are not exported to modules:
pack.user.User -> jdk.internal.misc.Unsafe (package jdk.internal.misc of java.base is not exported)
Use the supported alternative where there is one, such as sun.misc.Unsafe from jdk.unsupported
instead of jdk.internal.misc.Unsafe. Otherwise the server must be started with
--add-exports <module>/<package>=ALL-UNNAMED.
NonExportedJdkPackages asks the boot layer's platform and boot loader
modules whether they export each package to an unnamed module that no
export names, so qualified exports do not count and a server started
with --add-exports <module>/<package>=ALL-UNNAMED passes, as it would at
run time. Nothing is loaded. sun.misc (jdk.unsupported) and java.lang
stay usable. The check runs first among classes outside the pack: the
module decides access whichever loader finds the class.
The --add-exports case runs in its own JVM, the addExportsTest task
(tag jdk-add-exports), which check depends on; the other tests run
without the flag. TestModuleJar can pass --add-exports to javac.
A reference to a class of a JDK module outside the platform class
loader, such as jdk.compiler's com.sun.source.tree.Tree, was reported as
"exists in Iris but is hidden", because the host loader (the application
loader in tests) has it. It now has its own category, listed with the
module:
Module jar modules/user.jar uses classes of JDK modules that are not available to modules:
pack.user.User -> com.sun.source.tree.Tree (JDK module jdk.compiler)
Modules can use only the JDK modules of the platform class loader, ...
UnavailableJdkModules maps the packages of every system module that the
boot layer does not define to the boot or platform loader, from module
descriptors only, so nothing is loaded. Classes the platform loader
provides (java.sql, java.compiler) still resolve.
A module whose bundled library references optional integrations got a
WARNING on every pack load, with no way to say the classes are expected
to be absent. ModuleInfo now carries optionalPackages, set with
withOptionalPackages("org.slf4j", ...); ModuleInfo.of(id, name, version)
still declares none. Each package covers its subpackages.
Missing classes of a jar inside its own module's optional packages are
dropped from the warning and from PackModules.missingClasses(); other
jars are unaffected. The declaration comes from info(), so it is applied
after the entry classes exist. Load errors (hidden Iris classes, classes
missing from exposed packages) are decided before that and never depend
on it.
Package-name validation and whole-package matching move from
ExposedPackages to a new API value, PackageName, used by both.
A single API_PACKAGE_PREFIX made built-in modules in Iris packages
(art.arcane.iris...) invisible, so pack jars could not require their
stages. ExposedPackages now holds the packages packs may use: always
the API (IrisModule's package), plus what the host passes to the new
PackModules.load(packRoot, exposedHostPackages). Names must be package
names (trailing dot accepted) and match whole packages only.
ApiAndJdkClassLoader becomes ExposedHostClassLoader and routes classes
and resources of every exposed package to the host loader. A jar that
ships a class of any exposed package fails; the compileOnly API hint
stays for the API, other packages get their own message. That check
moves from ModuleJar to PackClassCheck. A reference missing from any
exposed package is the "different build" error.
Tests use a built-in module in example.builtin, outside com.volmit.,
which a pack jar can require only when that package is exposed.
The class check was stricter than the JVM: a bundled library that
references optional integrations failed the whole pack, although that
code only runs when the classes exist. Each missing reference is now
classified:
- the host has the class but hides it (Iris internals, Iris's copy of
a library): load error, saying modules cannot use Iris's classes;
- missing from the API: load error, as before (different Iris build);
- nobody has it: the pack loads. PackModules.missingClasses() lists
the classes per jar and the load logs one capped WARNING per pack,
formatted by MissingClassesWarning.
Reference resolution moves from PackClassCheck to PackReferenceCheck.
The pack class loader's parent is now ApiAndJdkClassLoader: com.volmit.
classes and resources come from the API's loader, everything else from
the platform loader, so modules no longer see Iris internals or the
libraries Iris bundles.
Before any class is defined, a pack load now fails when a jar holds a
com.volmit. class, and when a class references a class that is not in
the API, the JDK or a jar of the pack (read with java.lang.classfile).
Linkage errors while installing name the module's jar. ModuleInfo names
and versions reject line breaks and other control characters.
ModuleInfo gains a required, non-blank display name next to id and
version: ModuleInfo.of(id, name, version).
PackModules now fails when a class is in two jars of one pack, naming
the class and both jars. ModuleJar indexes class names while it reads
the entry point, so the check runs before the pack class loader exists
and nothing is half-loaded. Jars are read with the runtime's
multi-release version, like the loader reads them: a versioned class
counts once under its base name; module-info.class and anything under
META-INF/ are ignored.
A successful load logs one INFO summary through System.Logger with the
display name, id, version and jar of each module, or a line saying the
pack has no module jars. PackModulesSummary builds the text and is
tested without a logging backend.
A module jar names its IrisModule class in
META-INF/services/com.volmit.IrisModule. PackModules scans
<pack>/modules/*.jar in file name order, loads all jars of a pack
through one URLClassLoader whose parent is the API's loader, and
closes it when the pack unloads.
Modules now reach LoadedModules as DiscoveredModule (module plus
origin), so errors name the offending jar: missing or multiple entry
points, broken entry classes, duplicate module ids and foreign stage
namespaces.
Prepare/transforms, anchor height, block writes, stilt and snow are rebuilt as
independent iris:* modules, plus a third-party moss module that integrates via
requires, softAfter and a typed output. A two-module chunk example proves the
generic machinery outside placement.
Modules now define every stage themselves through IrisModule.install(StageGraph):
typed stage constants, hard requires(...) on other modules' constants, soft
ordering by id, when(...) activation and typed outputs. Placement and chunk
generation resolve on the same machinery; adjacent per-block stages fuse into
one block pass.
The host-defined PlacementModifier hooks, string Dependencies, GenerationPlan,
PlacementPipeline, DependencyOrder and OccurrenceOrder are removed.