Commit Graph
5317 Commits
Author SHA1 Message Date
piexel 769a29ce83 Register the spawn cooldown book as a saved key
SpawnModule registers SpawnCooldownBook.SAVED in setup, as the api now
requires, and the key uses ResourceId and StorageCodec.
2026-11-06 12:54:19 +01:00
piexel 307b89c5fe Register saved keys per module, key mantle and saved ids by ResourceId
SavedKey moves to com.volmit.data and Codec becomes StorageCodec, which
ends the clash with JsonForms.Codec. SavedKey.id and MantleKey.id are
ResourceIds, so the copied id regex is gone. Modules register saved keys
in setup with FeatureRegistry.registerSaved, owned like mantle keys, and
RunningWorld.saved rejects a key that is not the registered one.
2026-11-06 12:50:42 +01:00
piexel 96532f9a22 Make an Iris world's running world and structure host once
running() and the structure host were created lazily without
synchronisation, so two first callers got two instances. Two running
worlds mean two SavedWorldStates and one of them is never saved. Both are
now final fields built with the world. A concurrency test reproduces the
split on the old code.
2026-11-06 12:46:29 +01:00
piexel 4f772e2b48 Remember the cavern slices of a 4 by 4 window of chunks
A chunk and its eight neighbours no longer share a place, so the apply stage reading
across a border does not rebuild a chunk's slices on every block.
2026-11-06 12:29:55 +01:00
piexel 36f5b7e8b8 Pin the carved voids and final blocks of a fixed cave pipeline run
Carves and applies a fixed block of chunks of one seed, every chunk carved
before any is applied, and pins a digest of the planned cavern cells and of the
final blocks. Set IRIS_CARVE_BENCH to time the passes.
2026-11-06 12:23:06 +01:00
piexel a3cbb0e053 Serve Mantle.carved over the cavern slice, delete the MatterMantle offers
CarvedVoids is IrisApi's carved-void layer over the mantle's MatterCavern slice,
which stays the storage form every other reader uses: the liquid byte is the
fill and a custom biome key is a pack biome id. It remembers the slices it
touched last, writes the shared constants and reads an area in order from a flat
grid, so the carver's per-block writes and the apply stage's visit stay cheap.
Placements and edits see it read-only. MatterMantle, OwnChunkMatter and the
loaded-chunk reads behind them are gone.
2026-11-06 12:23:06 +01:00
piexel 62e33edfe3 Plan caves in Mantle.carved, drop MatterMantle
The carver, its fluid-support and orphan passes, CaveApplying and CarvedSpace
read and write IrisApi's carved-void layer instead of VolmLib matter slices.
Cave floors for the spawners are marked by the carve mantle stage through
PlacementTerrain.mark, from the planned voids; cave ceiling markers, which
nothing read, are gone. CaveApplying reads the 16 blocks around its chunk
through the chunk stage's mantle view, not only the neighbours already in
memory. MatterMantle and the module's Cavern are deleted.
2026-11-06 12:22:59 +01:00
piexel 6c8fa31a7b Add Mantle.carved, the host-owned layer of carved voids
CarvedVoid says what fills a carved block (open, fluid, lava or air) and
optionally the biome it shows; the plain fills are shared constants so a carver
allocates nothing per block. A mantle stage writes the layer, a chunk stage
reads it and its writes throw. Placements and edits see it read-only.
2026-11-06 12:19:51 +01:00
piexel a6f1ccd1e7 Drop the LegacyStreams offer and IrisPlacementForm
The module now draws the chunk random, density and heightmap from the API, so
IrisLegacyStreams, the ToolWorld extension and the placement form that cached
Iris's noise for them have no reader left.
2026-11-06 11:39:57 +01:00
piexel 97410afad9 Persist RunningWorld.saved under the world's module-data folder
SavedWorldState reads a value when first asked for and writes it, framed with
the codec version, when the engine saves its data and when the world stops, so a
hotload hands the new world what the old one wrote. A rejected payload is logged
and replaced by the key's initial value. Spawner cooldowns leave IrisEngineData
and the EngineSpawnCooldowns facade; old cooldowns in engine data are not migrated.
2026-11-06 11:39:57 +01:00
piexel 7c90040924 Follow the API's move of MantleCodec to com.volmit.data.Codec 2026-11-06 11:39:54 +01:00
piexel fa7c3a0abf Draw object chunk random, density and heightmap from API types
The chunk random is seeded from a purpose seed and the chunk, the density from
StyledRange over the API noise factory, and VirtualHeightmap builds the virtual
heightmap from NoiseSampler. LegacyStreams and ObjectPlacement.hostForm, which
only served Iris's placement form, are removed. The chunk random and density
noise now differ from the old streams; heightmaps are unchanged.
2026-11-06 11:39:35 +01:00
piexel 1e0a8d2bd6 Keep spawner cooldowns in the module, on RunningWorld.saved
SpawnCooldownBook holds when each spawner last fired in the world and in each
chunk and is saved with the world through a SavedKey. The SpawnCooldowns facade,
which only existed because API state was memory only, is gone.
2026-11-06 11:39:35 +01:00
piexel cf0e49e34d Reject saved ids whose namespace or path could leave the world's storage
The id names the stored file, so a namespace of .. must be rejected as well as a path segment.
2026-11-06 11:29:26 +01:00
piexel a0fcb74365 Add RunningWorld.saved, state a module keeps with the world across restarts
A world's state store is memory only, so Iris offered spawner cooldowns through a
facade to persist them. SavedKey names a value with its codec and initial value;
the host reads it on first ask and writes it when it saves and stops the world.
2026-11-06 11:22:29 +01:00
piexel 7cc3302c32 Move MantleCodec to com.volmit.data.Codec
Saved world state stores values with the same contract, so the codec no longer
belongs to the mantle package or says mantle in its doc.
2026-11-06 11:22:29 +01:00
piexel c61865b9f2 Document the command api of com.volmit.tooling 2026-11-06 10:51:21 +01:00
piexel a905dc24e7 Remove the messages of the structure commands that moved to the module
28 keys lost their last user: the Director and modded texts of structure list, info and
verify. They are gone from the catalog and from en_US and all 17 other locales.
2026-11-06 10:51:16 +01:00
piexel 2a68f41bef Mount the tooling commands on the modded /iris root
A greedy-string tail with a suggestion provider sits next to the literals of the /iris
root and inside the structure literals, so literal commands keep winning. The modded
list, info and verify trees and ModdedLocateCommands.verifyStructures are deleted;
the import and capture notices stay.
2026-11-06 10:51:15 +01:00
piexel 6a3c51e4fe Mount the tooling commands on the Bukkit /iris root
CommandSVC hands a line to the dispatcher when Director does not handle it, merges its
completions, and lets a sender without iris.all run only commands opened to everyone.
The old Director list, info and verify of CommandStructure are deleted; import and
capture stay.
2026-11-06 10:51:13 +01:00
piexel a5d0229417 Register structure list, info and verify through the tooling api
StructureModelModule mounts /iris structure list|info|verify as a module Command:
list writes the structure index through ToolPack.edit, info takes the structure as a
pack resource, and verify reads the world the sender stands in and reports in plain
text. The tests run list, info and verify through the dispatcher and pin that no other
module can take the structure root name or its aliases.
2026-11-06 10:51:12 +01:00
piexel bcec8e474d Add the tooling command dispatcher and the ToolPack over Iris's pack data
ToolingCommands resolves the pack of a line (pack=<name>, the sender's world, the
sender's open studio), walks the registering module's Command tree, parses the typed
arguments and runs the action on a worker thread. It also completes, and gates
commands to operators unless they are open to everyone. IrisToolPack holds the
pack's IrisData for each edit, so no hotload or second edit runs inside it, then
reloads the resources once; outputFolder is the workspace exports folder of the pack
and IrisObjectCodec reads and writes .iob.
2026-11-06 10:51:10 +01:00
piexel fc81e54b0c Add the platform-neutral command api for module tooling
A module registers a root Command through ToolingRegistry.registerCommand: typed
Arguments (word, text, integer, decimal, flag, choice, resource, registered),
sub-commands, and a CommandAction that runs against a CommandContext with a
ToolPack, a Sender and the platform's registries. ToolPack.edit is the one way to
change pack files; ObjectCodec reads and writes the host's object format.
The host catalogues the root commands and fails a pack load when two modules
claim one root name or alias, naming both.
2026-11-06 10:17:59 +01:00
piexel f7d2ce86a7 Pin that the export writes the structure graph's references 2026-11-06 10:08:10 +01:00
piexel 5979e3d49d Export structures and objects through the generic resource closure
The packager no longer runs StructurePackageClosure: ModuleResourceClosure
already follows the structure, pool, piece and loot references the model
annotates, and now also collects the object keys everything it follows names.
Pack validation runs first and reports broken structure graphs.

ExportClosureComparisonTest is the gate. On the overworld pack, following every
structure gives the same 210 pools, 1169 pieces and 1169 objects as before. The
export now also carries 10 objects that floating child biome object overrides
place, which the old export left out.

PackExportClosure had no callers and is removed.
2026-11-06 10:07:32 +01:00
piexel 4e7a46fb2d Drop the legacy structure index cleanup
structures/structure-index.json is no longer removed or skipped by validation.
Nothing is released, so an old pack that still has the file sees it reported as
a structure without a start pool.
2026-11-06 10:07:32 +01:00
piexel ab32568550 Check structure placements and references as typed settings
The 800-line JSON placement validator is gone. StructurePlacementValidation
checks what the placement types cannot state (one backend, separation below
spacing, the height band, the ring radius, placement ids and anonymous grids,
editable structures that exist and avoid VACUUM/ENCASE, registered native
sources and start pools). StructureReferenceValidation checks the structure,
pool, piece and object references of every file, placed or not. Shapes, enum
names and bounds are the decoder's.

Validators read the platform's registries through ValidationContext.platform(),
empty in a build and at datapack bootstrap.

The live jigsaw metadata, start-element span and terrain-envelope checks are
cut (design call 3.7).

Object and matter loaders no longer read the runtime settings outside a runtime
pack, so a pack validates without a platform. A number option written as text
now names its path: "structures[0].terrain.lobeStrength must be a number".
2026-11-06 10:07:19 +01:00
piexel 480e5485ac Document tooling parts, the class check partition and ModuleJarCheck --platform 2026-11-06 08:14:45 +01:00
piexel e999af0082 ModuleJarCheck checks the parts of the platform named by --platform
--platform=<name>:<platform api jar> checks that platform's tooling parts against
the jar and what a part may see. Without it parts are skipped and the output lists them.
2026-11-06 08:13:39 +01:00
piexel 66c4f01b21 Check tooling parts apart from generation code and load them in their own loader
Classes in a part's packages are not checked as generation code. Generation
code that uses a part class fails the pack load. Parts of the platform the host
runs on (ModuleHost.runningOn) are checked against what a part may see; parts of
other platforms are skipped unread. ToolingPartLoader is a child of the pack's
loader that defines the part itself and hands platform packages to the platform's
loader. ToolingPlatform describes a platform; BUKKIT is Paper's.
2026-11-06 08:11:35 +01:00
piexel 2e4fd306e8 Hide the platform packages of the tooling api from packs
com.volmit.tooling.<platform> is carved out of the exposed packages the way
com.volmit.host is; the neutral com.volmit.tooling stays visible.
2026-11-06 08:06:08 +01:00
piexel b943a43442 Read tooling parts from the module jar's manifest
Iris-Tooling-Parts lists <platform>=<entry class> entries. A part is the entry
class's package and subpackages. A malformed entry, an entry class the jar does
not hold, or parts that would share a class fail the load naming the jar and the entry.
2026-11-06 08:05:39 +01:00
piexel 806792ebae Validators can read the platform's registries
ValidationContext.platform() hands a validator the ids the running
server registers, keyed by the same Reference a @Ref option names, so
a module checks that a structure, structure set or template pool exists
without reaching into the host. Empty when the host validates without a
platform.
2026-11-06 07:59:37 +01:00
piexel 1bcd846fb5 Enforce declared bounds and make importedStructures a typed check
The settings decoder now enforces @MinNumber/@MaxNumber on every option
a pack writes, nested ones included, naming the full path. Module
resource files get the same check. Pack validation reports every
dimension, region and biome whose settings fail to decode as a blocking
error; before, the failure only logged and the pack passed.

With that in place, batch 9 S15 replaces 120 lines of hand-written JSON
checks of importedStructures with a typed check beside StructureValidator
for what types cannot say: blank keys and a structure set without a
namespace. @MinItems stays unenforced for now (OPEN_QUESTIONS 57).
2026-11-06 07:53:57 +01:00
piexel d1a9c2c68b Cut structure place commands, importvanilla structures and transform nags
Batch 9 stage 1 cuts S9, S10, S11 and S14:
- /iris structure place (Bukkit and modded) is gone; placing an Iris
  structure in-world is studio tooling that moves with the module.
- /iris studio importvanilla no longer takes structures; the structure
  import commands are the one entry point.
- The rotation/translate/scale nag on structure placements is gone. A
  parse-only pass keeps reporting dimension, region and biome files that
  are not JSON.
- Their message keys leave the catalog and every locale.
2026-11-06 07:41:37 +01:00
piexel 949157fd26 Drop Iris's compatibility seeds, reserved stage flags and noise fallbacks
- Iris answers every purpose seed by the API's rule; IrisWorldSeeds and
  its legacy map are gone.
- Every mantle stage gets an assigned flag; disabledComponents names
  stages by id, and a name that matches no stage fails the world.
- An unknown noise style or a missing expression throws.
2026-11-06 07:31:11 +01:00
piexel 672f781132 Document the stage-id disabledComponents and rule-based seeds 2026-11-06 07:31:09 +01:00
piexel e8fca6d8c6 Purpose seeds follow one rule; unknown noise styles fail
PackWorld.seed(purpose) is a default method, WorldRandom.purposeSeed of
the world seed, for every host and purpose: the exception that let a
host answer its own built-ins with older seeds is gone. An unknown style
name or a missing expression now fails like a missing image map, instead
of sampling flat or falling back to the base style.
2026-11-06 07:31:08 +01:00
piexel 6e1a206013 Follow @ResourceRef in the export closure and schema 2026-11-06 07:16:27 +01:00
piexel 6e2d94a4c8 Name pack resources with @ResourceRef 2026-11-06 07:16:26 +01:00
piexel 264f754297 Split @Ref into @Ref(Reference) and @ResourceRef(Kind.class)
@Ref had two attributes of which exactly one had to be given, checked
only at pack load. One annotation per concept makes a wrong
combination a compile error; giving both still fails the load.
2026-11-06 07:16:25 +01:00
piexel 4acc1ee2b9 Test how PlacerTerrain keeps each marker kind
Replaces MantleMarkerTypesTest, which only kept two id copies equal.
2026-11-06 06:42:25 +01:00
piexel 7bc9f21f50 Write typed markers with an exhaustive switch; drop MantleMarkerTypes
The marker ids no longer need a copy in core or a test keeping it equal
to the module's.
2026-11-06 06:37:34 +01:00
piexel 6c4bbb1df5 Place typed markers; drop ObjectMarkers 2026-11-06 06:37:33 +01:00
piexel c577b68c00 PlacedMarker is a sealed type of the markers the host keeps
The open (type, attributes) shape promised markers the host refused at
runtime. PackMarker, TreeMaterial and BuriedTreasure make an unkept
marker a compile error and remove the shared id strings.
2026-11-06 06:37:32 +01:00
piexel 0c2aefef20 BiomeModule and CustomModule own their stage constants
Core modules no longer take their stage ids from the built-ins jar's
IrisStages.
2026-11-06 06:30:50 +01:00
piexel f466979679 Register settings one type per call; drop core stages from IrisStages
iris:biome and iris:custom are core modules, so their stage constants
now live in BiomeModule and CustomModule instead of the built-ins jar.
2026-11-06 06:30:49 +01:00
piexel 32a07bd005 registerSettings takes one settings type
The varargs over a generic Class made every caller compile with an
unchecked generic array warning. One type per call matches
registerResourceKind and registerValidator.
2026-11-06 06:30:47 +01:00
piexel b961a5d3b2 Follow the API's renamed highest, get and withPropertyIfAccepted 2026-11-06 06:18:37 +01:00
piexel 956c33e8db Follow the API's renamed highest, get and withPropertyIfAccepted 2026-11-06 06:18:37 +01:00