Commit Graph
5251 Commits
Author SHA1 Message Date
piexel f78600be70 Count pregen chunks from the bounds instead of walking them
Totalling by iterating every chunk delays the start of a large pregen. The bounds already give the count in constant time.

Upstream: 73d640943
2026-11-10 01:30:07 +01:00
piexel 19129c2eb8 Report silent pregen failures instead of swallowing them
Empty catch (Throwable ignored) blocks in pregen hid failed capability probes, a stranded plugin chunk ticket and failed mantle cleanup. Probes now log their name and cause at debug through PregenDiagnostics, and real losses go through IrisLogging.reportError. The chunk load failure trace is emitted before the metrics snapshot so a failing snapshot cannot silence it.

Upstream: e030ac3be
2026-11-10 01:29:00 +01:00
piexel ae60b14402 Pump native chunk tasks while server stop waits for pregen
On Paper only the server thread advances chunk tasks, so a stop that blocks on a running pregen can wait forever. Stop now polls the native chunk queue while joining the pregen worker, and pregen skips eviction and flush scheduling once the server is stopping.

Upstream: 083e68986
2026-11-10 01:27:07 +01:00
piexel e87e6d9fae Fail a running pregen when chunk generation throws
A throw inside chunk generation left the server's chunk futures unsettled, so the async pregen waited on requests that never completed. Generation failures now reach the running job for the same world, which fails every outstanding request with the failing chunk as cause, and close gives up on stragglers after a 60 second drain deadline.

Upstream: 6c7796f12
2026-11-10 01:24:18 +01:00
piexel 128e90ea9b Release the plugin instance and runtime statics on disable
A disabled Iris stayed reachable through statics and a re-enable in the same JVM answered from the previous boot's caches. Disable now releases the instance, services, capability singletons and host bindings, and reaching Iris afterwards fails with "Iris is disabled" instead of a NullPointerException.

Upstream: 6c6dba023
2026-11-10 01:21:22 +01:00
piexel c77a9fb012 Use a primitive long set for MantleWriter hollowing and mask lookups
Hollowing allocated six IrisPosition probes per voxel and mask expansion one per candidate voxel. Both now look membership up in an origin-relative long key set, falling back to position equality for sets too wide to pack.

Upstream: 79af11c43
2026-11-10 01:18:10 +01:00
piexel 8748d85e37 Reuse VolmLib's hunk, interpolation and face types and drop the dead util wrappers
Iris carried copies of VolmLib's storage hunks, interpolation statics and HunkFace, plus wrappers nothing used. The storage hunks and IrisInterpolation now extend VolmLib's, Hunk uses VolmLib's HunkFace, and the Iris rangeScale stays so interpolation output does not change. The newly shipped VolmLib classes leave the Bukkit jar's left-out list.

Upstream: 355d7f413 355161408 114cc68a0
2026-11-10 01:16:52 +01:00
piexel fd936f4dd8 Skip floating object work for packs with no floating objects
The floating object stage widened the mantle window by at least 16 blocks and sampled every column of each chunk even when no floating biome places an object. Reach is now 0 unless a placement list has entries, with 16 as the fallback when the scan fails, and placing returns early when the reach is 0.

Upstream: 875735517
2026-11-10 01:12:11 +01:00
piexel 887daac844 Stop taking the plugin manager monitor in the scheduler enabled check
A pregen worker dispatching a saving event could hold the plugin manager monitor while plugin disable waited to join it. The scheduler now reads the hosted plugin's own enabled state instead.

Upstream: be621c007
2026-11-10 01:05:44 +01:00
piexel de1c6e887f Contain failed placements and let engine failures end the chunk
Placement code caught Throwable and logged it, so a closed session, a stopping executor or an OOM inside a placement left a half-built chunk that was then persisted. A classifier in the api separates those failures from content failures: the first are rethrown, the second are skipped with one rate-limited warning per kind, subject and failure type.

Upstream: 54f3595ba ebe4aa1e4 7b38f7584 f4f7e92a4 8cf9e01d9
2026-11-10 01:04:37 +01:00
piexel fc5c6ce0ab Refuse chunk generation while world maintenance forbids mantle stages
Folia maintenance used to generate chunks with the mantle stages skipped and then persist them without objects, caves or deposits. The engine now refuses the chunk with an expected-teardown session exception and warns at most every 5 seconds, so the chunk stays ungenerated. The REAL flag is set unconditionally.

Upstream: ea516b4a5
2026-11-10 00:58:51 +01:00
piexel a81a3abb9f Add a license per folder
api is MIT; module and studio are GPLv3 (module carries Iris code).
2026-11-06 16:54:29 +01:00
piexel b3b0c64b55 Point the build at the api, module and studio folders
The Iris and module builds used to find IrisApi and IrisModule as siblings; they now use the folders in this repo.
2026-11-06 16:54:29 +01:00
piexel 4e226b93f4 Merge IrisStudio into studio/ with its history
git-subtree-dir: studio
git-subtree-mainline: 68ae3c8d3a
git-subtree-split: 1c50eaf776
2026-11-06 16:52:58 +01:00
piexel 68ae3c8d3a Merge IrisModule into module/ with its history
git-subtree-dir: module
git-subtree-mainline: 925c942764
git-subtree-split: 27b0036450
2026-11-06 16:52:56 +01:00
piexel 925c942764 Merge IrisApi into api/ with its history
git-subtree-dir: api
git-subtree-mainline: cff15f93c5
git-subtree-split: dac8baa3ab
2026-11-06 16:52:54 +01:00
piexel cff15f93c5 Expect no minItems on the options that default to an empty list
The schema tests pinned minItems on options whose @MinItems is gone. Only the
decorator palette is asserted to keep it.
2026-11-06 14:39:55 +01:00
piexel 7bef5dbfd4 Remove the dead cave_ceiling marker references
The carve stage writes only cave_floor markers. The marker skips in the block
drop router, the marker spawn scanner and the modded block break and spawn
handlers, and the modded /iris what markers suggestion, no longer name
cave_ceiling.

/iris what markers' parameter help says "Marker name such as cave_floor". The
key is renamed to match, in the catalog and all 18 message files.
StructureAnchorMode.CAVE_CEILING is a different thing and stays.
2026-11-06 14:34:31 +01:00
piexel 67d5128942 Enforce @MinItems on the options a pack writes
DeclaredBounds checks it with @MinNumber and @MaxNumber, so pack load,
validation and every resource decode refuse an option written with fewer items
than it declares, naming the option: decorators[1].palette has 0 items; it must
have at least 1. An option the pack does not write is the module's default and
is not checked.
2026-11-06 14:34:31 +01:00
piexel 27b0036450 Stop skipping the cave_ceiling marker in entity spawning
No stage writes that marker any more; only cave_floor is left.
2026-11-06 14:34:26 +01:00
piexel 6d18d51076 Drop @MinItems from the options whose empty list means none
70 options carried @MinItems(1) but default to an empty list, and packs write
[] for them, such as the cave profile's modules or a decorator's blacklist.
Only the three palettes that default to a block keep it: PaletteSpec.palette,
PaletteLayer.palette and Decorator.palette. The loader enforces @MinItems now.
2026-11-06 14:34:26 +01:00
piexel ce7f782561 Say where a missing snippet reference is read from
A reference is snippet/<name>, a file below snippet/<snippet folder>/. A
pack still written as snippet/decorator/bush, in the layout from before the
folder was iris/decorant/decorator, was reported as having no file
snippet/iris/decorant/decorator/decorator/bush.json, which reads like a
doubled path in the lookup. The lookup is right; the message now names the
folder the name is relative to.
2026-11-06 14:30:27 +01:00
piexel 28d9c34dd2 Make the modded help list only what the tree has
- /iris help structure no longer lists the cut place, nor list, info and
  verify, which live under /iris module now. The group text names import and
  capture.
- /iris help lists the module command.
- Rendering the goto and find sections threw "Unknown message key" because
  the unregistered entry's text was never in the catalog. It is now.
- A test checks every documented word of every section against the
  Brigadier tree, and that every section renders.
- 4 localisation keys lost their last user and were removed from the
  catalog and all 18 files.
2026-11-06 14:29:10 +01:00
piexel f7aaed79a6 Move module commands under /iris module <root> <command...>
Module commands get their own branch, with the alias /iris m. <root> is the
root a module registers through ToolingRegistry.registerCommand, so
/iris module structure list|info|verify replaces /iris structure list.

- Bukkit: the branch word is taken before the Director runs; the Director
  first, then dispatcher fallback and the merged completions are gone. The
  first word completes "module".
- Modded: the greedy-string tails at the /iris root and inside the
  structure literal are gone. The module and m literals take one greedy
  string, because the roots belong to the modules of the pack the sender
  resolves to when the line runs, so they cannot be Brigadier nodes when the
  tree is built.
- /iris module alone lists the mounted roots and their commands; an unknown
  root is an error that points to that list.
- Permissions are unchanged: iris.all, and commands opened to everyone.
- /iris structure import and capture stay Director commands.
2026-11-06 14:29:05 +01:00
piexel d4704817a5 Point the structure key list at /iris module structure list 2026-11-06 14:28:49 +01:00
piexel dac8baa3ab Name the module branch in the command docs
Module commands mount under /iris module <root> <command...>, so the
registerCommand docs and the README example name that path.
2026-11-06 14:28:48 +01:00
piexel 88fe8c8bcd Register the spawn module in the spawner tests
The spawner tests ask the running world for saved state, which now needs
the key to be registered, so their pack serves SpawnModule.
2026-11-06 13:10:58 +01:00
piexel 616e50e605 Move the host side of the README to HOST.md, fix the stale host example
README is for module authors; the 190 lines about loading packs and
running stages are in HOST.md, linked from README. The host example uses
the packages Iris exposes today and no longer shows the deprecated
describingHostTypesIn. DESIGN records that Sender.extension is a
deliberate platform-tooling door that stays.
2026-11-06 13:03:08 +01:00
piexel 0b5b0190f5 Make smartBored return a bored copy instead of changing the pack's object
Boring an object mutated the shared IrisObject, so what a placement saw
depended on which placement bored it first. IrisObject now keeps one bored
copy, made on the first ask and dropped when its blocks change, so later
asks cost a field read. The bore runs under the read lock without
changing the original.
2026-11-06 12:59:35 +01:00
piexel 131f1575ae Document that only the host makes PlaceableObjects
PlaceableObject was described as immutable and implementable. The host
rejects foreign implementations, and smartBored now returns a copy
instead of changing the shared object. The javadoc and README say so.
2026-11-06 12:59:35 +01:00
piexel 699ad3f6fe Drop Mantle.isCarved and MantleCaverns
The module mantles no longer answer isCarved, so MantleCaverns, which
only served it, goes. Tests read the carved layer.
2026-11-06 12:56:05 +01:00
piexel cd03fb0c0a Ask the carved layer instead of Mantle.isCarved
DepositPlacer tests carved().get(x, y, z) for null, as the api no longer
has Mantle.isCarved.
2026-11-06 12:55:46 +01:00
piexel 0691753d21 Remove Mantle.isCarved, carved().get(x, y, z) != null asks the same
The mantle had two ways to ask whether a position holds a carved void.
The layer is the one way now.
2026-11-06 12:55:41 +01:00
piexel db4972b42a Serve saved state only for keys the pack's modules registered
The running world's saved state checks each key against the pack
catalog's registered saved keys and refuses an unregistered key or
another key with a registered id. Mantle and saved keys follow the api's
ResourceId ids and StorageCodec.
2026-11-06 12:54:22 +01:00
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