Read settings per column with every level as its own entry, add the mantle pipeline, host types and the one-option shorthand

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.
This commit is contained in:
piexel committed 2026-10-08 11:31:03 +02:00
1 parent 09df1af88e
commit 97ac2a2982
61 files changed
+1316 -184

No files matched your search

@@ -4,23 +4,35 @@ import com.volmit.FeatureAttachment;
import com.volmit.IrisFeature;
import com.volmit.resource.ResourceId;
import java.util.List;
import java.util.Objects;
/** Invocation-scoped lookup of applicable settings by attachment and world position.
* Results are immutable lists in pack declaration order, after the host applies inheritance
* rules. Targets remain separate: this interface never silently merges dimension/region/biome
* values. OBJECT_PLACEMENT is read from the current placement, or returns an empty list.
* Values must be treated as read-only. Bounds and lifetime match the invocation's sampler.
/** Invocation-scoped lookup of the settings that apply at one world column.
*
* <p>Every level that declares the settings contributes its own entry: the dimension, the region and
* the biome of the column, and in a placement the placement itself. Levels stack: nothing is merged or
* overridden, and a module decides what several entries mean, such as running a deposit once per
* entry. Entries are immutable lists in level order ({@link FeatureAttachment.Target} order). The
* biome is the column's surface biome; cave biomes are not a level. Values must be treated as
* read-only. Bounds and lifetime match the invocation's sampler.
*
* <p>Something that spans several columns, such as a chunk-wide pass or a placed object, reads the
* settings at one column it treats as its origin; per-chunk behaviour reads the chunk's centre column
* (local 7, 7).
*/
public interface FeatureSettings {
<F extends IrisFeature> List<Entry<F>> at(Class<F> featureType, FeatureAttachment.Target target,
int worldX, int worldY, int worldZ);
<F extends IrisFeature> List<Entry<F>> at(Class<F> featureType, int worldX, int worldZ);
/** source identifies the configuration owner; occurrence is unique within the pack snapshot. */
record Entry<F extends IrisFeature>(ResourceId source, ResourceId occurrence, F value) {
/** One level's declaration of the settings.
*
* @param level where the settings are declared: the dimension, a region, a biome or the placement
* @param source the resource that declares them, such as {@code overworld:biome/desert/dunes}
* @param value the decoded settings
*/
record Entry<F extends IrisFeature>(FeatureAttachment.Target level, ResourceId source, F value) {
public Entry {
java.util.Objects.requireNonNull(source, "source");
java.util.Objects.requireNonNull(occurrence, "occurrence");
java.util.Objects.requireNonNull(value, "value");
Objects.requireNonNull(level, "level");
Objects.requireNonNull(source, "source");
Objects.requireNonNull(value, "value");
}
}
}