Commit Graph
67 Commits
Author SHA1 Message Date
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 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
piexel 3a307b5b8e Batch 3 of the API review: extension point, resources by kind
- PackWorld, InvocationContext and PackSettings get extension(type),
  an Optional empty by default: the one door a host's own modules use
  to reach its facades. The runners forward the inputs' extensions;
  the world a module sees (ModuleWorld, built by the host) forwards
  the world's. PackWorld.withLog is gone.
- A chunk stage writes registered mantle layers inside its own chunk
  and reads the rest (ChunkMantle); ReadOnlyMantle and its host() are
  gone.
- PackResources.find(kind, id), require(kind, id), ids(kind) and the
  host kinds BIOMES, REGIONS, OBJECTS replace ResourceKey and
  ResourceKind.key. Services and LinkedBiomes name pack resources by
  ResourceId. @Ref(PACK_*) and @ResourceRef fit ResourceId fields.
- BlockAccess extends BlockView.
- Absent values in ItemDrop, EntitySpec and AmbientEffects.Effect are
  Optionals; StructureFit.Start.key() returns a StartKey.
- Mantle.caverns() becomes isCarved(x, y, z).
- OptionsMetadata and DeclaredFieldOrder move to com.volmit.host.
- README, DESIGN and CONTRACTS updated; ExtensionsTest added.
2026-10-24 00:17:10 +02:00
piexel 7143908d4b Batch 2 of the API review: settings stacks, chunk helpers, pack context
- SettingsStack<F> replaces List<Entry<F>> wherever settings stack:
  entries in level order, values(), dimension(), level(Level) and
  mostSpecific().
- com.volmit.config.Level replaces FeatureAttachment.Target;
  FeatureAttachment folds into FeatureDescriptor.targets().
- FeatureSettings.declaredInChunk answers every entry any column of a
  chunk declares, each once.
- ChunkContext gives chunkX/chunkZ, centreX/centreZ and area().
- registerSettings takes several types at once.
- ModuleLifecycle.packLoaded(PackContext) carries resources, settings
  and the module's log.
- TerrainSampler.surfaceHeight gives the surface in whole blocks.
- Stage contexts drop worldSeed() and resources(); world() always
  answers. The scoped world is kept per world and module.
- Javadoc fixes; README, DESIGN and CONTRACTS updated.
2026-10-23 14:17:19 +02:00
piexel 1677f4414b Batch 1 of the API review: one setup entry point, per-pipeline definitions
- IrisModule.setup(ModuleSetup) replaces install(StageGraph) and
  register(FeatureRegistry); ModuleSetups.run is the host entry point.
- The conditional definition variants are gone: a stage body reads the
  settings it is conditioned on through ctx.configured(Type.class).
- Placement, block, chunk and mantle stages each get their own
  definition interface; chunk definitions offer neither reach nor
  writesMantle. MantleStage is no longer generic.
- softAfter/softBefore take stage constants as well as StageRefs.
- A producer that rejected the attempt may return null.
- PlacementRunner, ChunkRunner and MantleRunner all take StageTimings.
- ConfiguredSettings groups entries by the type that declares @Feature.
- README, DESIGN and CONTRACTS updated, with the edge choice table.
2026-10-23 13:00:07 +02:00
piexel 58ed81032c Merge branch 'wave3b/4'
# Conflicts:
#	README.md
#	src/main/java/com/volmit/world/TerrainSampler.java
2026-10-15 07:13:58 +02:00
piexel dc28e0ecda Docs: the terrain sampler's biome, kind, ground block, bottom Y and upper dimension, the caverns layer, declaredBy, oreFor, the chunk mantle's reach 2026-10-15 07:07:12 +02:00
piexel b047a2675d Merge branch 'wave3b/5' 2026-10-15 07:06:59 +02:00
piexel 3ab8b88e56 Merge branch 'wave3b/3'
# Conflicts:
#	CONTRACTS.md
2026-10-15 07:06:59 +02:00
piexel e8443324d4 README, CONTRACTS: signed, scaled, minHeight, idOf and caveBiome 2026-10-12 02:41:19 +02:00
piexel 750e0691a6 Structure services answer what Iris core still asked its locator directly: placed keys and the starts a module makes of platform structures
StructureLocator.placed(world) (default: locatable): every key under which locate finds what the module places, its own
structures and the platform structures it starts or stands in for; the host routes locate by it.
VanillaStructures.startedStructures(world), locatableStarts(world) and locateStart(world, structure, fromX, fromZ,
maxRings, ChunkFilter): the platform structures a module starts itself, the ones it can find, and the nearest start of
one, ring by ring through the module's grids, trying only the chunks the host's filter accepts (the platform's /locate
checks each start in the world and asks again without a refused chunk). README, DESIGN, CONTRACTS; test.
2026-10-10 18:18:01 +02:00
piexel 40cb759271 Mantle stages see the terrain at least 16 blocks around their chunk, as chunk stages do 2026-10-10 18:13:46 +02:00
piexel 24eeeab615 NoiseSampler.signed: the sample mapped to -1..1, which a host may answer from a per-thread coordinate memo 2026-10-10 18:06:46 +02:00
piexel 8676ebc328 VanillaFeatures service: whether the platform's own placed features run over a world and which steps and features they skip
@Service(ALL): generates(world) (off unless a module turns it on), generatesStep(world, Optional<DecorationStep>)
(empty for a step the API does not name) and generatesFeature(world, feature); any provider may refuse a step or a
feature. Answers depend on the world only; the host asks once per world, step and feature. README services table,
DESIGN services and feature map, CONTRACTS types and host duty; a test that a silent provider leaves the pass off.
2026-10-10 18:04:44 +02:00
piexel cf8b2bb0f6 StructureStep becomes DecorationStep: the platform's decoration steps also order its placed features, which the next service names
Pure rename (and its javadoc); every use in StructureFit, the test and CONTRACTS follows.
2026-10-10 18:04:40 +02:00
piexel d17a017418 PackResources.idOf: the id a pack gives the resource its files name by a key (ResourceId.ofPackKey) 2026-10-10 18:02:08 +02:00
piexel 1a319d842b Merge branch 'wave3b/p' 2026-10-10 15:07:18 +02:00
piexel 949dd90f10 TerrainSampler.surfaceY: a column's height alone, which a host answers without working out the slope 2026-10-10 14:46:16 +02:00
piexel e0ffe04a0d ModuleLog: each module's own log, labelled with its id, reached as context.log(), PackWorld.log() and FeatureRegistry.log() 2026-10-10 14:00:38 +02:00
piexel d7de5939d7 Merge branch 'master' into wave3/s 2026-10-10 13:21:43 +02:00
piexel e92de3b38a Docs: how a module reaches the host, shared libraries a host exposes, planned blocks, the chunk sampler's reach, fluid height and upper dimension, VINE and canPlaceOn, stage timings, the missing-key message 2026-10-10 13:16:27 +02:00
piexel bc2db7222f Merge branch 'wave3/l'
# Conflicts:
#	CONTRACTS.md
#	README.md
2026-10-10 13:05:02 +02:00
piexel a2bee86c1f Docs: AmbientEffects, Reference.SPECIAL_ENTITY 2026-10-10 13:01:15 +02:00
piexel 25f9ea2f37 LinkedBiomes: settings name the pack biomes they bring into the layout; CaveBiomes service: the cave biome a module puts at a position and a biome's minimum cave depth 2026-10-10 08:51:28 +02:00
piexel 6f52a20b25 Docs: VanillaStructures replaces the vanilla structure hook; the API carries no fit values
README shows a provider, every method and the memo; DESIGN records why the hook became a service, why shift and reach
replace the adjustment value, what a chunk's StructureFit gives and why memos replace a persisted fit; CONTRACTS
lists the new types and what the host must do for them.
2026-10-10 03:55:56 +02:00
piexel b82c292dcb Settings features declare a short JSON key and may declare a root option
@Feature(key) is required: a plain field name, unique per target across all
modules and the host's own JSON fields (ModuleHost.reservingFields, back for
keys). A clash refuses the pack load naming the key, the target and both
claimants. @Feature(root) declares that the JSON under the key is one option's
value, so a settings class has exactly one shape; FeatureSchema carries it.
2026-10-09 23:16:52 +02:00
piexel 1707bb95f6 Merge branch 'wave2/e2' 2026-10-09 22:33:28 +02:00
piexel de35bbedb6 Merge branch 'wave2/d' 2026-10-09 22:33:28 +02:00
piexel 3633c105b4 Document the loot, drop, entity and sapling services and the item and entity values 2026-10-09 22:26:05 +02:00
piexel 94be126d25 Document the vanilla structure hook's starts, adjustments and setup
README (the three methods, an example start, the fit value types, the new Reference kinds), DESIGN (why starts are
a hook method, why the platform's own starts get a second per-structure method, fit values as value types, setup
before a world exists), CONTRACTS (types, adapter requirements; the planner item leaves Open).
2026-10-09 22:07:29 +02:00
piexel 668d46bd91 Let built-in modules describe the classes Iris's own classes hold (registerHeldType) 2026-10-09 20:46:24 +02:00
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 20d504bd28 Say that a missing image map fails noise building, as Iris's image noise does, instead of falling back 2026-10-09 14:42: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