mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 08:14:45 +00:00
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:
1 parent
09df1af88e
commit
97ac2a2982
61 files changed
+1316
-184
No files matched your search
@@ -38,6 +38,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/** The ported slice of Iris's place() lifecycle, composed only from module-owned stages. */
|
||||
class PlacementLifecyclePortTest {
|
||||
private static final ResourceId PLACEMENT = ResourceId.parse("pack:object/tree");
|
||||
private static final BlockState PLANKS = new BlockState("minecraft:oak_planks");
|
||||
private static final int ANCHOR_GROUND = 10;
|
||||
private static final int SURROUNDING_GROUND = 7;
|
||||
@@ -149,7 +150,7 @@ class PlacementLifecyclePortTest {
|
||||
@Test
|
||||
void placesObjectThenStiltSnowAndMossFromTypedOutputs() {
|
||||
var edit = place(resolve(PlacementModules.all()),
|
||||
ConfiguredSettings.of(new StiltSettings(), new SnowSettings(2), new MossSettings()));
|
||||
ConfiguredSettings.placement(PLACEMENT, new StiltSettings(), new SnowSettings(2), new MossSettings()));
|
||||
|
||||
var bottom = placed(0, 0, 0);
|
||||
var corner = placed(1, 0, 0);
|
||||
@@ -191,17 +192,17 @@ class PlacementLifecyclePortTest {
|
||||
modules.add(capModule);
|
||||
var graph = resolve(modules);
|
||||
|
||||
var withoutStilt = place(graph, ConfiguredSettings.of(new SnowSettings(), new MossSettings()));
|
||||
var withoutStilt = place(graph, ConfiguredSettings.placement(PLACEMENT, new SnowSettings(), new MossSettings()));
|
||||
assertEquals(TestTerrain.AIR, withoutStilt.publishedAt(5, 20, 5));
|
||||
assertEquals(MossModule.MOSS, withoutStilt.publishedAt(0, ANCHOR_GROUND - 1, 0));
|
||||
|
||||
var withStilt = place(graph, ConfiguredSettings.of(new StiltSettings()));
|
||||
var withStilt = place(graph, ConfiguredSettings.placement(PLACEMENT, new StiltSettings()));
|
||||
assertEquals(PLANKS, withStilt.publishedAt(5, 20, 5));
|
||||
}
|
||||
|
||||
@Test
|
||||
void loadingThePortCatalogsEveryConditioningSettingsType() {
|
||||
var loaded = LoadedModules.load(PlacementModules.builtIns(), Map.of(), Set.of());
|
||||
var loaded = LoadedModules.load(PlacementModules.builtIns(), Map.of(), Set.of(), Set.of());
|
||||
|
||||
assertEquals(List.of("example:moss", "iris:snow", "iris:stilt"),
|
||||
loaded.catalog().settings().stream().map(settings -> settings.id().toString()).toList());
|
||||
|
||||
Reference in new issue
Block a user