Commit Graph
34 Commits
Author SHA1 Message Date
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 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 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 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 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 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 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 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 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 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 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 84bd65fdc4 Give one concept one name
The highest block of a column is highest(x, z, ignoreFluid) wherever it is
asked, and a sapling's surroundings read a block with get like every other
block view. The registry's property change is withPropertyIfAccepted, as it
checks the block and keeps a content plugin's block, unlike
BlockState.withProperty. BlockView no longer links the removed
PlacementContext.blocks().
2026-11-06 06:18:37 +01:00
piexel cdd138d9f4 Tighten the tooling package and document it
JsonText only reads now; splicing text is the host's, as the studio makes
every write. JsonPath steps are a sealed Key or Index. Absent values are
empty instead of -1 or blank: GraphNode.part, BlockPattern.pickAt and the
entries' group. GraphNode's child list, movability and additions are one
Edits record.

README and DESIGN describe the tooling package, CONTRACTS maps it, and the
docs no longer name the types the last batch removed.
2026-11-06 06:09:12 +01:00
piexel 2b6f96e5c2 Remove API surface no module or host uses
The object generator registration (registerObject, ObjectGenerator,
ObjectGeneratorFactory, ObjectGenerationContext, FeatureRole): the host
catalogued generators but never called one. PlacementContext.objects()
with ObjectTransformer and ObjectTransform, PlacementContext.blocks()
(placementTerrain() answers the same), BlockPalette,
EntitySpec.extensions and Reference.BIOME go too.
2026-11-06 05:55:48 +01:00
piexel d0b57a4886 Add JsonText, JsonPath and EditableSceneView for the studio node editor
JsonText parses a pack file and splices it while keeping its formatting
(v3e's JsonSource). EditableSceneView tells the studio which file an
entry is written in and reads that file as a NodeGraph: nodes at JSON
paths with their part id, roles, settings types and what can be added.
2026-11-06 05:06:21 +01:00
piexel 2befcb9487 Add pattern views to the studio tooling
A StudioView is now either a SceneView (block scenes) or a PatternView:
entries a module lays out from above, one block per column, at a depth
below the top, over a PatternArea. BlockPattern holds the picks and the
blocks they index. Both kinds register through ToolingRegistry.registerView
and share one id space in the host.
2026-11-06 02:39:40 +01:00
piexel a658cd2446 Let modules show block scenes in the studio
ModuleSetup.tooling() gives a ToolingRegistry, where a module registers
SceneViews: a catalogue of entries, each with variants the studio draws
in 3D, built from the pack for a world. View ids follow the module's id
and are unique; the frozen catalogue lists them by id.
2026-11-06 01:18:45 +01:00
piexel f57c2ce92c Define withProperty for a value the block does not accept
BlockRegistry.withProperty returns the state unchanged when the block has no such property or does
not accept the value, such as facing=up for a block that only faces sideways. Platforms threw.
2026-11-05 23:00:05 +01:00
piexel 321ab5b486 Let a settings value read its own JSON forms
@JsonForms(Codec) marks a value packs write in more than one shape, such as a number, a [min, max]
range or a curve object. The host hands its JSON to the codec as plain values and writes it back
through it; it never creates the class or reads its fields, and the schema describes it as any
JSON value. It is the one exception to the decoding contract, so module jars no longer need Gson
(which the plugin relocates) for such values.
2026-11-05 23:00:05 +01:00
piexel 5e85e1e3b8 Report tree objects as one set of ids
TreeObjects no longer has a separate procedural list: a module reports the ids of every object it
places as a tree, procedural variants included, and the host only matches those ids.
2026-11-05 23:00:05 +01:00
piexel 2914ed168c Give noise styles an optional seed of their own
A style with a seed is rolled from that number and the world seed and
ignores the seed it is asked for, so every reader of the same seeded
style gets one shared noise. Readers that scale coordinates before
sampling read it flat in blocks. NoiseStyle.seed(), isSeeded(),
withSeed(); the NoiseFactory contract says what a seeded style does.

Ported from v3e a1bd24186.
2026-11-05 21:02:06 +01:00
piexel 3ba62e0c47 Say in the Loot javadoc that the container is shuffled with the module's seed 2026-10-28 04:16:48 +01:00
piexel 56bd2badab Type the loot source's table as an id and leave jigsaw overrides out explicitly
ItemDrop.Source names its pack table by ResourceId. JigsawOverrides drops the
SOURCE constants of Heightmap and Liquids and the blank-text defaults: an option
the pack left out is null inside and empty in its getter.
2026-10-28 04:13:22 +01:00
piexel a9e3cbaa93 Close the object-placement couplings of the tooling audit
PlacementRun carries the placement's display name and its JSON, from which the
host reads the settings other modules declare at the placement level.
FeatureRegistry.registerPlacementType lets the module that owns placements
declare the type and its JSON names for the placement level. RunningWorld and
PlacementTerrain keep a typed PlacementRecord (object id, placement id,
optional structure id) instead of a text. Loot gives the seed a container is
shuffled with, the ProtectedFloor service says whether the lowest layer belongs
to the terrain module, and EntitySpec holds the spawn reason, rising out of the
ground, panda genes and applying to a provided mob.
2026-10-28 04:02:32 +01:00
piexel 95582abb6e Batch 7 stage 4a: biome height, sky biome and platform biome writes
TerrainSampler.biomeHeight and skyBiome answer for a pack biome at any
column; Mantle.setPlatformBiome makes a block show a platform biome, inside
a chunk stage's own chunk. These replace the module's FloatingHost facade.
README, DESIGN (ledger drops FloatingHost) and CONTRACTS updated.
2026-10-28 01:58:46 +01:00
piexel f1eb619344 Batch 7 stage 3: objects and placement through the api
The api describes a pack's objects and lets a module place one through the
pack's placement graph: PlaceableObject, PackObjects (PackResources.objects()),
ScaleMethod, and Placements.place(PlacementRun) on PackWorld with
PlacementTerrain, StructureVolumes and PlacementOutcome, which moves here from
the host. Stages read PlacementContext.placementTerrain() and input(type);
mantle stages get MantleGenerationContext.placementTerrain().

BlockRegistry gains rotate (BlockTurn), merge, withProperty and matches;
BlockTrait gains STORAGE; ModuleLog gains debugging(); PackSettings gains
resources(); RunningWorld gains placementAt. README, DESIGN and CONTRACTS
describe them, and the extension ledger drops ObjectHost and ObjectPlacement.
2026-10-28 01:25:41 +01:00
piexel 398f3879ae Remove registerHeldType
Built-in module types are no longer held by Iris's own classes: object
placements are iris:objects settings, so every type they hold is reached
from a registered feature. FeatureRegistry.registerHeldType,
HeldTypeRegistration, FeatureCatalog.heldTypes and SchemaSource.heldType
go, with the held example module and its schema tests.
2026-10-27 01:43:50 +01:00
piexel 364d735a95 Batch 6 part 4a: purpose seeds and the running world
Finding 40, first step. PackWorld.seed(purpose) gives each purpose id an
independent world seed, specified as WorldRandom.purposeSeed and pinned
against the reference script; a host may answer its own built-ins' ids
with the seeds existing worlds depend on. PackWorld.running() is the
world as services and hooks see it (layout over every column, settings,
highest block, cave floors, sky, platform loot tables, debug), reusing
TerrainSampler and FeatureSettings instead of a facade vocabulary.
2026-10-24 10:08:47 +02:00
piexel 1bc91df048 Batch 6 part 3: structure locating, decoding contract, minor cuts
Finding 45: StructureLocator is the one locating service (startedStructures,
locatableStarts, locateStart, ChunkFilter moved from VanillaStructures).
StartMemo is one opaque non-empty text. VanillaStructureStart.identity is
deleted; the host only stored it. useExpansionHack and legacyAir stay: both
mirror platform structure behaviour any structure module needs.

Finding 46: DESIGN.md documents one decoding contract (fields read by name,
absent or null members keep the initialiser, unknown enum names are errors,
the host never writes null). Value type getters stop null-guarding.
NoiseStyle.cacheSize is deleted. @Desc texts rewritten. multiplier stays on
NoiseStyle: it is also an object placement's warp strength.

Finding 47: LinkedBiomes moves to world and takes the dimension's settings
as PackSettings. Optional packages move from ModuleInfo to the jar manifest
(Iris-Optional-Packages); PackageName moves into the host.
PlacementRequest.id is dropped (nothing read it).
2026-10-24 09:24:12 +02:00
piexel 6b24e6f150 Type platform keys and fold pack references into @Ref(kind)
Batch 6, findings 41 and 42.

- Platform keys travel as ResourceId: enchantments, attributes, sounds,
  particles, potions, loot tables, sapling species, marker tags, upper
  dimension ids and jigsaw start pools. ResourceId.ofPlatformKey normalises
  a key a pack wrote.
- Item and entity types are a ContentKey (Registered id, or Provided
  provider and name) instead of strings and a special-type flag.
- ItemDrop groups into Look, Wear and PlatformExtras; colours are an RGB
  int and DyeColor, attribute operations an enum.
- EntitySpec groups into Appearance, Behaviour, Company, Drops and Arrival,
  and carries host extensions instead of Iris-only fields.
- @Ref(kind = Type.class) replaces @ResourceRef and the PACK_* references;
  expressions and image maps become the host kinds EXPRESSIONS and
  IMAGE_MAPS.
2026-10-24 06:06:44 +02:00
piexel 05f621d82d Batch 6 part 1: one bottom-Y name, no silently-wrong defaults, geometry package, blocks
Finding 43: PackWorld.minHeight(), PlatformStart.bottomY() and StructureFit.bottomY()
become minWorldY(), the name TerrainSampler already used, and none of them has a default.
FeatureSettings.declaredBy, TerrainSampler.surfaceBlock/upperDimension and
BlockRegistry.oreFor lose defaults that answered wrong for a host that forgot them.
BlockBox, BlockPosition and BlockFace move to com.volmit.geometry.

Finding 44: BlockRegistry keeps resolve(BlockSpec) and adds find(key), which is
empty for a block the platform lacks; resolve(String) and resolve(BlockState) go.
BlockTrait drops INVENTORY, BLOCK_ENTITY and NEEDS_UPDATE, which nothing asked;
BlockAccess.is answers every trait. GenerationContext.hunk(Class) becomes blocks().
2026-10-24 05:19:06 +02:00
piexel b6c2992752 Batch 4 of the API review: api and host artifacts, ModuleLoadException
- Split into Gradle subprojects api (com.volmit:iris-api) and host
  (com.volmit:iris-host). ExposedPackages never exposes com.volmit.host.
- One unchecked ModuleLoadException(moduleId, origin, message, cause)
  for every load error; messages unchanged.
- PlacementAccess.set(x, y, z, state) next to set(PlacedBlock).
- BlockState: precompiled patterns, withProperty copies once.
- Mantle and layer views are made once per invocation.
- Hunk getters are width(), height(), depth().
- Held types and host types are deprecated for removal at the cut-over.
- Docs: artifacts, one-or-more modules per jar, no option shorthand.
2026-10-24 04:19:39 +02:00