engine, int revision, ScopeIndex index) {
- }
-
private record ScopeIndex(boolean biome, boolean caveBiome, boolean region, boolean dimension) {
}
}
diff --git a/src/main/java/art/arcane/iris/engine/framework/StructureReachability.java b/src/main/java/art/arcane/iris/engine/framework/StructureReachability.java
deleted file mode 100644
index 15910aa36..000000000
--- a/src/main/java/art/arcane/iris/engine/framework/StructureReachability.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package art.arcane.iris.engine.framework;
-
-import art.arcane.iris.engine.object.world.IrisWorld;
-import art.arcane.iris.spi.IrisPlatforms;
-import art.arcane.volmlib.util.collection.KList;
-import com.github.benmanes.caffeine.cache.Cache;
-import com.github.benmanes.caffeine.cache.Caffeine;
-
-import java.util.Collections;
-import java.util.LinkedHashSet;
-import java.util.Locale;
-import java.util.Objects;
-import java.util.Set;
-
-/**
- * Determines which vanilla/datapack structures can ever generate in a world, using the same biome
- * gate vanilla applies: a structure is reachable when its biome filter intersects the set of vanilla
- * biomes the pack actually produces (its {@code possibleBiomes}). Structures whose required biomes are
- * never produced cannot generate and must not be scanned for by {@code /locate} or {@code /iris find}
- * (an unbounded scan for an absent biome is what stalls the server).
- *
- * The reachable set is fixed per live engine/world and is rebuilt after hotload.
- */
-public final class StructureReachability {
- private static final Cache> REACHABLE_CACHE = Caffeine.newBuilder().weakKeys().build();
-
- private StructureReachability() {
- }
-
- public static Set reachableKeys(Engine engine) {
- Engine activeEngine = Objects.requireNonNull(engine, "Structure reachability requires an engine");
- if (activeEngine.getData() == null) {
- throw new IllegalStateException("Structure reachability requires a bound pack data loader");
- }
- return REACHABLE_CACHE.get(activeEngine, ignored -> build(activeEngine));
- }
-
- public static boolean isReachable(Engine engine, String structureKey) {
- String normalizedStructureKey = normalizeStructureKey(structureKey);
- return reachableKeys(engine).contains(normalizedStructureKey);
- }
-
- public static void invalidate(Engine engine) {
- if (engine == null) {
- return;
- }
- REACHABLE_CACHE.invalidate(engine);
- }
-
- private static Set build(Engine engine) {
- IrisWorld world = engine.getWorld();
- if (world == null) {
- throw new IllegalStateException("Structure reachability requires a bound Iris world");
- }
- if (world.platformWorld() == null) {
- throw new IllegalStateException("Structure reachability requires a bound platform world");
- }
- Set reachable = new LinkedHashSet<>();
- for (String key : IrisPlatforms.get().structureHooks().reachableStructureKeys(world.platformWorld())) {
- if (key == null || key.isBlank()) {
- throw new IllegalStateException("Platform structure reachability returned a blank registry key");
- }
- reachable.add(key.toLowerCase(Locale.ROOT));
- }
- return Collections.unmodifiableSet(reachable);
- }
-
- /**
- * The vanilla biome keys (e.g. {@code minecraft:taiga}) from a structure's filter that the pack
- * does not produce. An empty list means the structure is reachable. Used by the structure verify
- * diagnostic to explain why a structure cannot generate.
- */
- public static KList missingBiomeKeys(Engine engine, String structureKey) {
- KList missing = new KList<>();
- Engine activeEngine = Objects.requireNonNull(engine, "Structure biome diagnostics require an engine");
- String normalizedStructureKey = normalizeStructureKey(structureKey);
- IrisWorld world = activeEngine.getWorld();
- if (world == null) {
- throw new IllegalStateException("Structure biome diagnostics require a bound Iris world");
- }
- if (world.platformWorld() == null) {
- throw new IllegalStateException("Structure biome diagnostics require a bound platform world");
- }
- Set possible = new LinkedHashSet<>();
- for (String key : IrisPlatforms.get().structureHooks().possibleBiomeKeys(world.platformWorld())) {
- if (key == null || key.isBlank()) {
- throw new IllegalStateException("Platform structure biome query returned a blank possible-biome key");
- }
- possible.add(key.toLowerCase(Locale.ROOT));
- }
- for (String biomeKey : IrisPlatforms.get().structureHooks().structureBiomeKeys(normalizedStructureKey)) {
- if (biomeKey == null || biomeKey.isBlank()) {
- throw new IllegalStateException("Platform structure biome query returned a blank required-biome key for "
- + normalizedStructureKey);
- }
- if (!possible.contains(biomeKey.toLowerCase(Locale.ROOT))) {
- missing.add(biomeKey);
- }
- }
- return missing;
- }
-
- private static String normalizeStructureKey(String structureKey) {
- if (structureKey == null || structureKey.isBlank()) {
- throw new IllegalArgumentException("Registered structure key must not be blank");
- }
- return structureKey.trim().toLowerCase(Locale.ROOT);
- }
-}
diff --git a/src/main/java/art/arcane/iris/engine/framework/structure/ImportedStructures.java b/src/main/java/art/arcane/iris/engine/framework/structure/ImportedStructures.java
index a7d215973..fd4680bfd 100644
--- a/src/main/java/art/arcane/iris/engine/framework/structure/ImportedStructures.java
+++ b/src/main/java/art/arcane/iris/engine/framework/structure/ImportedStructures.java
@@ -18,6 +18,7 @@
package art.arcane.iris.engine.framework.structure;
+import art.arcane.iris.builtin.RegistryKeyFamily;
import art.arcane.iris.builtin.structure.StructureAdjustment;
import art.arcane.iris.builtin.structure.StructureSetFrequency;
import art.arcane.iris.builtin.structure.StructureSettings;
@@ -34,7 +35,7 @@ import java.util.Optional;
* What a dimension's {@link StructureSettings} say about the platform's own structures: which ones it disables, how
* the starts of the others are adjusted, and how the platform sets them up. Keys match ignoring case and surrounding
* space; a family pattern also matches the keys it starts at a namespace, slash or underscore boundary
- * ({@link #matchesKey}).
+ * ({@link RegistryKeyFamily}).
*/
public final class ImportedStructures {
private final StructureSettings settings;
@@ -55,7 +56,7 @@ public final class ImportedStructures {
if (normalizedKey.isEmpty()) {
return false;
}
- return settings.disabled().stream().anyMatch(pattern -> matchesKey(pattern, key))
+ return settings.disabled().stream().anyMatch(pattern -> RegistryKeyFamily.matches(pattern, key))
|| settings.disabledExact().stream().map(ImportedStructures::normalize)
.anyMatch(exact -> !exact.isEmpty() && exact.equals(normalizedKey));
}
@@ -99,33 +100,8 @@ public final class ImportedStructures {
}
}
- /**
- * Whether the family pattern {@code pattern} matches the structure {@code key}: equal keys, or a pattern the key
- * starts with that ends in, or is followed in the key by, {@code :}, {@code /} or {@code _}. So
- * {@code minecraft:village} matches {@code minecraft:village_plains} and {@code nova_structures:} a whole namespace.
- */
- public static boolean matchesKey(String pattern, String key) {
- if (pattern == null || key == null) {
- return false;
- }
- String normalizedPattern = normalize(pattern);
- String normalizedKey = normalize(key);
- if (normalizedPattern.isEmpty() || !normalizedKey.startsWith(normalizedPattern)) {
- return false;
- }
- if (normalizedKey.length() == normalizedPattern.length()) {
- return true;
- }
- char patternEnd = normalizedPattern.charAt(normalizedPattern.length() - 1);
- if (patternEnd == ':' || patternEnd == '/' || patternEnd == '_') {
- return true;
- }
- char boundary = normalizedKey.charAt(normalizedPattern.length());
- return boundary == '/' || boundary == '_';
- }
-
private static boolean matchesAny(List patterns, String key) {
- return patterns.stream().anyMatch(pattern -> matchesKey(pattern, key));
+ return patterns.stream().anyMatch(pattern -> RegistryKeyFamily.matches(pattern, key));
}
private static NativeStructureFit asAdjustment(StructureAdjustment entry) {
diff --git a/src/main/java/art/arcane/iris/engine/framework/structure/NativeStartPlanner.java b/src/main/java/art/arcane/iris/engine/framework/structure/NativeStartPlanner.java
index bc21cf3d7..c5f273b39 100644
--- a/src/main/java/art/arcane/iris/engine/framework/structure/NativeStartPlanner.java
+++ b/src/main/java/art/arcane/iris/engine/framework/structure/NativeStartPlanner.java
@@ -21,10 +21,9 @@ package art.arcane.iris.engine.framework.structure;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.framework.StructurePlacementGrid;
import art.arcane.iris.engine.framework.StructurePlacementScope;
-import art.arcane.iris.engine.object.structure.IrisStructureAnchorMode;
-import art.arcane.iris.engine.object.structure.IrisStructurePlacement;
-import art.arcane.iris.engine.object.structure.vanilla.IrisNativeStructure;
-import art.arcane.volmlib.util.collection.KList;
+import art.arcane.iris.builtin.structure.StructureAnchorMode;
+import art.arcane.iris.builtin.structure.StructurePlacement;
+import art.arcane.iris.builtin.structure.NativeStructureSource;
import art.arcane.volmlib.util.math.RNG;
import java.util.LinkedHashMap;
@@ -46,17 +45,17 @@ public final class NativeStartPlanner {
}
/** One start a {@code nativeStructures} placement makes: the placement, its chosen source and world base Y. */
- public record Plan(IrisStructurePlacement placement, IrisNativeStructure source, int chunkX, int chunkZ, int baseY) {
+ public record Plan(StructurePlacement placement, NativeStructureSource source, int chunkX, int chunkZ, int baseY) {
}
public static List plansAt(Engine engine, int chunkX, int chunkZ) {
Map plansByStructure = new LinkedHashMap<>();
- for (IrisStructurePlacement placement : StructurePlacementScope.placementsAt(engine, chunkX, chunkZ)) {
+ for (StructurePlacement placement : StructurePlacementScope.placementsAt(engine, chunkX, chunkZ)) {
Plan plan = planAt(engine, placement, chunkX, chunkZ);
if (plan == null) {
continue;
}
- String structureKey = normalize(plan.source().getStructure());
+ String structureKey = normalize(plan.source().structure());
Plan current = plansByStructure.get(structureKey);
if (current == null || comparePlacementPriority(plan.placement(), current.placement()) < 0) {
plansByStructure.put(structureKey, plan);
@@ -65,7 +64,7 @@ public final class NativeStartPlanner {
return List.copyOf(plansByStructure.values());
}
- public static Plan planAt(Engine engine, IrisStructurePlacement placement, int chunkX, int chunkZ) {
+ public static Plan planAt(Engine engine, StructurePlacement placement, int chunkX, int chunkZ) {
validateBackend(placement);
if (!placement.hasNativeStructures()) {
return null;
@@ -80,7 +79,7 @@ public final class NativeStartPlanner {
}
RNG placementRng = StructurePlacementGrid.placementRng(
placement, chunkX, chunkZ, mantleSeed).nextParallelRNG(NATIVE_SELECTION_DOMAIN);
- IrisNativeStructure source = selectSource(placement.getNativeStructures(), placementRng);
+ NativeStructureSource source = selectSource(placement.nativeStructures(), placementRng);
Integer baseY = resolveBaseY(activeEngine, placement, chunkX, chunkZ, placementRng);
if (baseY == null) {
return null;
@@ -88,7 +87,7 @@ public final class NativeStartPlanner {
return new Plan(placement, source, chunkX, chunkZ, baseY);
}
- public static void validateBackend(IrisStructurePlacement placement) {
+ public static void validateBackend(StructurePlacement placement) {
if (placement == null) {
throw new IllegalStateException("Structure placement must not be null");
}
@@ -98,8 +97,7 @@ public final class NativeStartPlanner {
throw new IllegalStateException("Structure placement must declare exactly one backend: "
+ "structures or nativeStructures");
}
- if (nativeStructure && placement.getAnchor() != null
- && placement.getAnchor() != IrisStructureAnchorMode.LEGACY) {
+ if (nativeStructure && placement.anchor() != StructureAnchorMode.LEGACY) {
throw new IllegalStateException("Native structure placements do not support the Iris anchor field");
}
}
@@ -108,26 +106,26 @@ public final class NativeStartPlanner {
return engine.getHeight(blockX, blockZ, true) < engine.getDimension().getFluidHeight();
}
- static IrisNativeStructure selectSource(KList sources, RNG rng) {
+ static NativeStructureSource selectSource(List sources, RNG rng) {
Objects.requireNonNull(sources, "Native structure sources must not be null");
Objects.requireNonNull(rng, "Native structure selection requires an RNG");
long totalWeight = 0L;
- for (IrisNativeStructure source : sources) {
- if (source == null || source.getStructure() == null || source.getStructure().isBlank()) {
+ for (NativeStructureSource source : sources) {
+ if (source == null || source.structure() == null || source.structure().isBlank()) {
throw new IllegalStateException("Native structure placement contains a blank source");
}
- if (source.getWeight() < 1) {
- throw new IllegalStateException("Native structure source '" + source.getStructure()
- + "' has invalid weight " + source.getWeight());
+ if (source.weight() < 1) {
+ throw new IllegalStateException("Native structure source '" + source.structure()
+ + "' has invalid weight " + source.weight());
}
- totalWeight = Math.addExact(totalWeight, source.getWeight());
+ totalWeight = Math.addExact(totalWeight, source.weight());
}
if (totalWeight > Integer.MAX_VALUE) {
throw new IllegalStateException("Native structure source weights exceed " + Integer.MAX_VALUE);
}
int roll = rng.nextInt((int) totalWeight);
- for (IrisNativeStructure source : sources) {
- roll -= source.getWeight();
+ for (NativeStructureSource source : sources) {
+ roll -= source.weight();
if (roll < 0) {
return source;
}
@@ -135,7 +133,7 @@ public final class NativeStartPlanner {
throw new IllegalStateException("Native structure source selection produced no result");
}
- private static Integer resolveBaseY(Engine engine, IrisStructurePlacement placement,
+ private static Integer resolveBaseY(Engine engine, StructurePlacement placement,
int chunkX, int chunkZ, RNG rng) {
int worldMin = engine.getMinHeight() + 1;
int worldMax = engine.getMinHeight() + engine.getHeight() - 1;
@@ -144,25 +142,25 @@ public final class NativeStartPlanner {
}
int blockX = (chunkX << 4) + 8;
int blockZ = (chunkZ << 4) + 8;
- if (!placement.isUnderwater() && isSubmerged(engine, blockX, blockZ)) {
+ if (!placement.underwater() && isSubmerged(engine, blockX, blockZ)) {
return null;
}
- if (!placement.isUnderground()) {
+ if (!placement.underground()) {
int surfaceY = engine.getHeight(blockX, blockZ, true) + engine.getMinHeight();
- if (surfaceY < placement.getMinHeight() || surfaceY > placement.getMaxHeight()) {
+ if (surfaceY < placement.minHeight() || surfaceY > placement.maxHeight()) {
return null;
}
return surfaceY;
}
- int bandMin = Math.max(worldMin, Math.min(placement.getMinHeight(), placement.getMaxHeight()));
- int bandMax = Math.min(worldMax, Math.max(placement.getMinHeight(), placement.getMaxHeight()));
+ int bandMin = Math.max(worldMin, Math.min(placement.minHeight(), placement.maxHeight()));
+ int bandMax = Math.min(worldMax, Math.max(placement.minHeight(), placement.maxHeight()));
if (bandMin > bandMax) {
return null;
}
return bandMin == bandMax ? bandMin : bandMin + rng.nextInt((bandMax - bandMin) + 1);
}
- private static int comparePlacementPriority(IrisStructurePlacement left, IrisStructurePlacement right) {
+ private static int comparePlacementPriority(StructurePlacement left, StructurePlacement right) {
long leftIdentity = StructurePlacementGrid.placementIdentity(left);
long rightIdentity = StructurePlacementGrid.placementIdentity(right);
return Long.compareUnsigned(leftIdentity, rightIdentity);
diff --git a/src/main/java/art/arcane/iris/engine/framework/structure/StructureLocating.java b/src/main/java/art/arcane/iris/engine/framework/structure/StructureLocating.java
index 3f45eb15b..a3842ec4f 100644
--- a/src/main/java/art/arcane/iris/engine/framework/structure/StructureLocating.java
+++ b/src/main/java/art/arcane/iris/engine/framework/structure/StructureLocating.java
@@ -32,8 +32,9 @@ import java.util.Set;
/**
* How {@code iris:structure} lets Iris find its structures: the structures of the pack's {@code structures} folder,
* the ones the world's placements assemble from jigsaw pools, and their nearest start, searched with
- * {@link IrisStructureLocator}. Vanilla structures that Iris places through native placements are not among them; the
- * host's vanilla structure handling finds those.
+ * {@link IrisStructureLocator}. The keys it places also name the platform structures its native placements start and
+ * the ones its structures stand in for; it locates those too. The platform's own locate of a natively started
+ * structure goes through {@link StructureVanillaStructures#locateStart} instead.
*/
public final class StructureLocating implements StructureLocator {
@Override
@@ -46,6 +47,11 @@ public final class StructureLocating implements StructureLocator {
return IrisStructureLocator.locatableEditableKeys(engine(world));
}
+ @Override
+ public Set placed(PackWorld world) {
+ return IrisStructureLocator.placedKeysAndAliases(engine(world));
+ }
+
@Override
public LocateResult locate(PackWorld world, String key, int fromX, int fromZ, int maxRadiusChunks) {
Engine engine = engine(world);
diff --git a/src/main/java/art/arcane/iris/engine/framework/structure/StructureVanillaStructures.java b/src/main/java/art/arcane/iris/engine/framework/structure/StructureVanillaStructures.java
index ccaf5a5a4..b19815e41 100644
--- a/src/main/java/art/arcane/iris/engine/framework/structure/StructureVanillaStructures.java
+++ b/src/main/java/art/arcane/iris/engine/framework/structure/StructureVanillaStructures.java
@@ -25,9 +25,10 @@ import art.arcane.iris.engine.framework.IrisStructureLocator;
import art.arcane.iris.engine.framework.StructurePlacementGrid;
import art.arcane.iris.engine.framework.structure.fit.StartLayouts;
import art.arcane.iris.engine.framework.structure.fit.StructureFitting;
-import art.arcane.iris.engine.object.structure.IrisStructurePlacement;
-import art.arcane.iris.engine.object.structure.vanilla.NativeStructureSuppression;
+import art.arcane.iris.builtin.structure.StructurePlacement;
+import art.arcane.iris.builtin.structure.NativeStructureSuppression;
import com.volmit.resource.ResourceId;
+import com.volmit.service.LocateResult;
import com.volmit.service.VanillaStructures;
import com.volmit.vanilla.PlatformStart;
import com.volmit.vanilla.StartMemo;
@@ -38,16 +39,22 @@ import com.volmit.vanilla.VanillaStructureRule;
import com.volmit.vanilla.VanillaStructureSetup;
import com.volmit.vanilla.VanillaStructureStart;
import com.volmit.vanilla.VanillaStructureStartContext;
+import com.volmit.world.BlockPosition;
+import com.volmit.world.PackWorld;
+import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Locale;
import java.util.Optional;
+import java.util.Set;
/**
* What {@code iris:structure} says about the platform's own structures. The dimension's {@code importedStructures}
* settings ({@link ImportedStructures}) disable, move, fit and set them up; the pack's structure placements replace
* them ({@code vanillaSource} with native suppression), place them alongside ({@link IrisStructureLocator#isPlaced}),
* start them where their {@code nativeStructures} grids say ({@link NativeStartPlanner}) and fit those starts the way
- * the placement says, which their memo carries to every chunk they reach ({@link StructureFitting}).
+ * the placement says, which their memo carries to every chunk they reach ({@link StructureFitting}). It names the
+ * structures its native placements start and finds their starts for the platform's own locate.
*/
public final class StructureVanillaStructures implements VanillaStructures {
/**
@@ -68,7 +75,7 @@ public final class StructureVanillaStructures implements VanillaStructures {
@Override
public List starts(int chunkX, int chunkZ, VanillaStructureStartContext context) {
- Engine engine = IrisPackWorld.of(context.world()).engine();
+ Engine engine = engine(context.world());
return NativeStartPlanner.plansAt(engine, chunkX, chunkZ).stream()
.map(plan -> start(plan, engine.getMinHeight()))
.toList();
@@ -103,23 +110,56 @@ public final class StructureVanillaStructures implements VanillaStructures {
return ImportedStructures.of(context.settings()).setup();
}
+ @Override
+ public Set startedStructures(PackWorld world) {
+ return structureIds(IrisStructureLocator.nativeKeys(engine(world)));
+ }
+
+ @Override
+ public Set locatableStarts(PackWorld world) {
+ return structureIds(IrisStructureLocator.locatableNativeKeys(engine(world)));
+ }
+
+ /** Searches the rings of the placements that start {@code structure} natively, as the platform's own locate does. */
+ @Override
+ public LocateResult locateStart(PackWorld world, ResourceId structure, int fromX, int fromZ, int maxRings,
+ ChunkFilter accepts) {
+ Engine engine = engine(world);
+ IrisStructureLocator.LocateResult result = IrisStructureLocator.locateInPlacementRings(
+ engine, structure.toString(), fromX, fromZ, maxRings, accepts::accepts);
+ return switch (result.status()) {
+ case FOUND -> LocateResult.found(new BlockPosition(result.originX(), result.baseY() - engine.getMinHeight(), result.originZ()));
+ case NOT_FOUND -> LocateResult.NOT_FOUND;
+ case SEARCH_LIMIT_REACHED -> LocateResult.SEARCH_LIMIT_REACHED;
+ };
+ }
+
+ private static Engine engine(PackWorld world) {
+ return IrisPackWorld.of(world).engine();
+ }
+
+ private static Set structureIds(Set keys) {
+ Set ids = new LinkedHashSet<>();
+ for (String key : keys) {
+ ids.add(ResourceId.parse(key.toLowerCase(Locale.ROOT)));
+ }
+ return ids;
+ }
+
/** {@code plan} as the start the platform generates: heights above the bottom, the placement's identity and fit. */
static VanillaStructureStart start(NativeStartPlanner.Plan plan, int minHeight) {
- IrisStructurePlacement placement = plan.placement();
- NativeStructureFit fit = new NativeStructureFit(0, null, false, placement.getStilt(), placement.resolvedTerrain());
- VanillaStructureStart start = VanillaStructureStart.at(ResourceId.parse(plan.source().getStructure()),
+ StructurePlacement placement = plan.placement();
+ NativeStructureFit fit = new NativeStructureFit(0, null, false, placement.stilt().orElse(null), placement.resolvedTerrain());
+ VanillaStructureStart start = VanillaStructureStart.at(ResourceId.parse(plan.source().structure()),
plan.chunkX(), plan.chunkZ(), plan.baseY() - minHeight)
.withIdentity(StructurePlacementGrid.placementIdentity(placement))
.withMemo(fit.memo());
- if (placement.isUnderground()) {
+ if (placement.underground()) {
start = start.underground();
}
- if (placement.getNativeSuppression() == NativeStructureSuppression.REPLACE_SOURCE) {
+ if (placement.nativeSuppression() == NativeStructureSuppression.REPLACE_SOURCE) {
start = start.replacingPlatformStart();
}
- if (plan.source().getJigsaw() != null) {
- start = start.withJigsaw(plan.source().getJigsaw());
- }
- return start;
+ return plan.source().jigsaw().map(start::withJigsaw).orElse(start);
}
}
diff --git a/src/main/java/art/arcane/iris/engine/framework/structure/fit/FitStart.java b/src/main/java/art/arcane/iris/engine/framework/structure/fit/FitStart.java
index 07c9187ca..bad24142e 100644
--- a/src/main/java/art/arcane/iris/engine/framework/structure/fit/FitStart.java
+++ b/src/main/java/art/arcane/iris/engine/framework/structure/fit/FitStart.java
@@ -20,8 +20,8 @@ package art.arcane.iris.engine.framework.structure.fit;
import art.arcane.iris.builtin.structure.StructureTerrain;
import art.arcane.iris.engine.framework.structure.NativeStructureFit;
+import com.volmit.vanilla.DecorationStep;
import com.volmit.vanilla.StructureFit;
-import com.volmit.vanilla.StructureStep;
import com.volmit.vanilla.TerrainAdaptation;
import java.util.ArrayList;
@@ -63,7 +63,7 @@ final class FitStart {
return start.adaptation();
}
- StructureStep step() {
+ DecorationStep step() {
return start.step();
}
diff --git a/src/main/java/art/arcane/iris/engine/framework/structure/fit/SurfaceFitting.java b/src/main/java/art/arcane/iris/engine/framework/structure/fit/SurfaceFitting.java
index baa1d1ff0..504a2cc20 100644
--- a/src/main/java/art/arcane/iris/engine/framework/structure/fit/SurfaceFitting.java
+++ b/src/main/java/art/arcane/iris/engine/framework/structure/fit/SurfaceFitting.java
@@ -22,7 +22,7 @@ import art.arcane.iris.builtin.structure.StructureTerrainMode;
import art.arcane.iris.engine.object.placement.IrisObjectVacuum;
import com.volmit.ModuleLog;
import com.volmit.block.BlockState;
-import com.volmit.vanilla.StructureStep;
+import com.volmit.vanilla.DecorationStep;
import com.volmit.vanilla.TemplateCells;
import com.volmit.vanilla.TerrainAdaptation;
import com.volmit.world.BlockPosition;
@@ -114,8 +114,8 @@ final class SurfaceFitting {
}
}
- static boolean shouldPrepareSurfaceTerrain(TerrainAdaptation adaptation, StructureStep step) {
- return step == StructureStep.SURFACE_STRUCTURES
+ static boolean shouldPrepareSurfaceTerrain(TerrainAdaptation adaptation, DecorationStep step) {
+ return step == DecorationStep.SURFACE_STRUCTURES
&& (adaptation == TerrainAdaptation.BEARD_THIN || adaptation == TerrainAdaptation.BEARD_BOX);
}
diff --git a/src/main/java/art/arcane/iris/engine/framework/vanillafeatures/ImportedFeatures.java b/src/main/java/art/arcane/iris/engine/framework/vanillafeatures/ImportedFeatures.java
new file mode 100644
index 000000000..0cafe0ba5
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/framework/vanillafeatures/ImportedFeatures.java
@@ -0,0 +1,67 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.engine.framework.vanillafeatures;
+
+import art.arcane.iris.builtin.RegistryKeyFamily;
+import art.arcane.iris.builtin.vanillafeatures.ImportedFeaturesSettings;
+import com.volmit.config.FeatureSettings.Entry;
+import com.volmit.resource.ResourceId;
+import com.volmit.service.VanillaFeatures;
+import com.volmit.vanilla.DecorationStep;
+import com.volmit.world.PackWorld;
+
+import java.util.List;
+import java.util.Optional;
+
+/**
+ * What a dimension's {@link ImportedFeaturesSettings} say about the platform's own placed features: whether they run,
+ * and which decoration steps and features they leave out. A dimension without the settings runs none.
+ */
+public final class ImportedFeatures implements VanillaFeatures {
+ private static final ImportedFeaturesSettings NONE = new ImportedFeaturesSettings();
+
+ @Override
+ public boolean generates(PackWorld world) {
+ return settings(world).enabled();
+ }
+
+ /** A step the API does not name is allowed unless the dimension narrowed generation to listed steps. */
+ @Override
+ public boolean generatesStep(PackWorld world, Optional step) {
+ ImportedFeaturesSettings settings = settings(world);
+ if (step.isEmpty()) {
+ return settings.steps().isEmpty();
+ }
+ if (!settings.steps().isEmpty() && !settings.steps().contains(step.get())) {
+ return false;
+ }
+ return !settings.disabledSteps().contains(step.get());
+ }
+
+ @Override
+ public boolean generatesFeature(PackWorld world, ResourceId feature) {
+ String key = feature.toString();
+ return settings(world).disabled().stream().noneMatch(pattern -> RegistryKeyFamily.matches(pattern, key));
+ }
+
+ private static ImportedFeaturesSettings settings(PackWorld world) {
+ List> declared = world.settings().declared(ImportedFeaturesSettings.class);
+ return declared.isEmpty() ? NONE : declared.getFirst().value();
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/framework/vanillafeatures/VanillaFeaturesModule.java b/src/main/java/art/arcane/iris/engine/framework/vanillafeatures/VanillaFeaturesModule.java
new file mode 100644
index 000000000..035b15463
--- /dev/null
+++ b/src/main/java/art/arcane/iris/engine/framework/vanillafeatures/VanillaFeaturesModule.java
@@ -0,0 +1,51 @@
+/*
+ * Iris is a World Generator for Minecraft Servers
+ * Copyright (c) 2026 Arcane Arts (Volmit Software)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package art.arcane.iris.engine.framework.vanillafeatures;
+
+import art.arcane.iris.builtin.vanillafeatures.ImportedFeaturesSettings;
+import com.volmit.FeatureRegistry;
+import com.volmit.IrisModule;
+import com.volmit.ModuleInfo;
+import com.volmit.service.VanillaFeatures;
+import com.volmit.stage.StageGraph;
+
+/**
+ * Module {@code iris:vanilla-features}: whether the platform's own placed features (ores, trees, plants, springs) run
+ * over a dimension's terrain, and which steps and features they leave out, decided from the dimension's
+ * {@code importedFeatures} settings and answered through {@link VanillaFeatures} ({@link ImportedFeatures}). The
+ * platform runs the feature pass itself; the module has no stages.
+ */
+public final class VanillaFeaturesModule implements IrisModule {
+ private static final String VERSION = "built-in";
+
+ @Override
+ public ModuleInfo info() {
+ return ModuleInfo.of("iris:vanilla-features", "Vanilla features", VERSION);
+ }
+
+ @Override
+ public void install(StageGraph graph) {
+ }
+
+ @Override
+ public void register(FeatureRegistry registry) {
+ registry.registerSettings(ImportedFeaturesSettings.class);
+ registry.registerService(VanillaFeatures.class, new ImportedFeatures());
+ }
+}
diff --git a/src/main/java/art/arcane/iris/engine/mantle/components/StructureModule.java b/src/main/java/art/arcane/iris/engine/mantle/components/StructureModule.java
index e97c60212..f614d0ef0 100644
--- a/src/main/java/art/arcane/iris/engine/mantle/components/StructureModule.java
+++ b/src/main/java/art/arcane/iris/engine/mantle/components/StructureModule.java
@@ -19,14 +19,11 @@
package art.arcane.iris.engine.mantle.components;
import art.arcane.iris.builtin.IrisStages;
+import art.arcane.iris.builtin.structure.StructurePlacementSettings;
import art.arcane.iris.builtin.structure.StructureSettings;
-import art.arcane.iris.builtin.structure.StructureStilts;
-import art.arcane.iris.builtin.structure.StructureTerrain;
import art.arcane.iris.core.modules.IrisMantleChunk;
import art.arcane.iris.core.modules.IrisPackSettings;
-import art.arcane.iris.core.modules.IrisPackWorld;
import art.arcane.iris.engine.framework.Engine;
-import art.arcane.iris.engine.framework.IrisStructureLocator;
import art.arcane.iris.engine.framework.structure.StructureLocating;
import art.arcane.iris.engine.framework.structure.StructureResources;
import art.arcane.iris.engine.framework.structure.StructureValidator;
@@ -34,15 +31,12 @@ import art.arcane.iris.engine.framework.structure.StructureVanillaStructures;
import com.volmit.FeatureRegistry;
import com.volmit.IrisModule;
import com.volmit.ModuleInfo;
-import com.volmit.ModuleLifecycle;
import com.volmit.ModuleLog;
import com.volmit.config.PackSettings;
import com.volmit.service.StructureLocator;
import com.volmit.service.VanillaStructures;
import com.volmit.stage.MantleStageContext;
import com.volmit.stage.StageGraph;
-import com.volmit.vanilla.JigsawOverrides;
-import com.volmit.world.PackWorld;
/**
* Module {@code iris:structure}: Iris structures, written into the mantle after objects, whose trees they clear
@@ -52,16 +46,16 @@ import com.volmit.world.PackWorld;
* The module owns the pack's structures, jigsaw pools and jigsaw pieces as resource kinds
* ({@link StructureResources}), read from the folders packs have always used, and checks them with
* {@link StructureValidator} wherever Iris validates a pack. It lets Iris find its structures through
- * {@link StructureLocating}, and forgets a world's structure index when the world stops, which includes every reload of
- * the pack's structure files.
+ * {@link StructureLocating}; a world's structure index lives in the world's state, so a reload of the pack's structure
+ * files, which starts a new world, builds it again.
*
* It decides over the platform's own structures through its {@link VanillaStructures} provider
* ({@link StructureVanillaStructures}): the dimension's {@code importedStructures} settings disable, move, fit and set
* them up, and the pack's structure placements replace them, place them alongside, start them where their
- * {@code nativeStructures} grids say and fit them into the terrain. It describes the fit settings Iris's structure
- * placements hold.
+ * {@code nativeStructures} grids say and fit them into the terrain. The pack's structure placements are its
+ * {@code "structures"} settings ({@link StructurePlacementSettings}) of the dimension, its regions and biomes.
*/
-public final class StructureModule implements IrisModule, ModuleLifecycle {
+public final class StructureModule implements IrisModule {
private static final String VERSION = "built-in";
private ModuleLog log;
@@ -81,20 +75,11 @@ public final class StructureModule implements IrisModule, ModuleLifecycle {
public void register(FeatureRegistry registry) {
log = registry.log();
registry.registerSettings(StructureSettings.class);
+ registry.registerSettings(StructurePlacementSettings.class);
StructureResources.kinds().forEach(registry::registerResourceKind);
registry.registerValidator(new StructureValidator());
registry.registerService(StructureLocator.class, new StructureLocating());
- registry.registerLifecycle(this);
registry.registerService(VanillaStructures.class, new StructureVanillaStructures());
- registry.registerHeldType(StructureTerrain.class);
- registry.registerHeldType(StructureStilts.class);
- registry.registerHeldType(JigsawOverrides.class);
- }
-
- /** The structure index is still kept per engine rather than in the world's state, so a stopping world drops it. */
- @Override
- public void worldStopped(PackWorld world) {
- IrisStructureLocator.invalidate(IrisPackWorld.of(world).engine());
}
private static void place(MantleStageContext context) {
diff --git a/src/main/java/art/arcane/iris/engine/mantle/components/StructurePlacing.java b/src/main/java/art/arcane/iris/engine/mantle/components/StructurePlacing.java
index f461f23f8..c0acf37e2 100644
--- a/src/main/java/art/arcane/iris/engine/mantle/components/StructurePlacing.java
+++ b/src/main/java/art/arcane/iris/engine/mantle/components/StructurePlacing.java
@@ -37,7 +37,7 @@ import art.arcane.iris.engine.object.prefab.IrisObject;
import art.arcane.iris.engine.object.world.region.IrisRegion;
import art.arcane.iris.engine.object.structure.IrisStructure;
import art.arcane.iris.builtin.structure.StructureCarveShape;
-import art.arcane.iris.engine.object.structure.IrisStructurePlacement;
+import art.arcane.iris.builtin.structure.StructurePlacement;
import art.arcane.iris.builtin.structure.StructureStilts;
import com.volmit.ModuleLog;
import com.volmit.block.PaletteSampler;
@@ -61,6 +61,7 @@ import it.unimi.dsi.fastutil.longs.Long2IntMap;
import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
/**
@@ -82,7 +83,7 @@ public class StructurePlacing {
/** Places what originates in the chunk at chunk coordinates {@code x}, {@code z} into {@code writer}. */
@ChunkCoordinates
public void place(MantleWriter writer, int x, int z, ChunkContext context) {
- for (IrisStructurePlacement placement : StructurePlacementScope.placementsAt(
+ for (StructurePlacement placement : StructurePlacementScope.placementsAt(
engine, x, z)) {
if (!placement.hasIrisStructures()) {
continue;
@@ -92,7 +93,7 @@ public class StructurePlacing {
}
@ChunkCoordinates
- private void placeFromPlacement(MantleWriter writer, IrisStructurePlacement placement, int cx, int cz) {
+ private void placeFromPlacement(MantleWriter writer, StructurePlacement placement, int cx, int cz) {
IrisStructureLocator.ResolvedPlacement resolved = IrisStructureLocator.resolvePlacement(
engine, placement, cx, cz);
if (resolved == null) {
@@ -101,8 +102,8 @@ public class StructurePlacing {
boolean trace = IrisSettings.get().getGeneral().isDebug();
if (trace) {
- log.debug("[StructTrace] ORIGIN chunk=" + cx + "," + cz + " structures=" + placement.getStructures()
- + " anchor=" + placement.resolvedAnchor() + " band=" + placement.getMinHeight() + ".." + placement.getMaxHeight());
+ log.debug("[StructTrace] ORIGIN chunk=" + cx + "," + cz + " structures=" + placement.structures()
+ + " anchor=" + placement.resolvedAnchor() + " band=" + placement.minHeight() + ".." + placement.maxHeight());
}
String key = resolved.structureKey();
@@ -135,7 +136,7 @@ public class StructurePlacing {
ObjectPlaceMode mode = structure.getPlaceMode();
int failedPieces = 0;
- StructureStilts stilt = placement.getStilt();
+ StructureStilts stilt = placement.stilt().orElse(null);
Long2IntOpenHashMap foundationColumns = stilt == null
? null : new Long2IntOpenHashMap();
boolean supportNonOccluding = stilt != null && stilt.supportNonOccluding();
@@ -590,19 +591,19 @@ public class StructurePlacing {
int maxBlocks = 0;
for (IrisRegion region : dimension.getAllRegions(engine)) {
- maxBlocks = Math.max(maxBlocks, maxBlocksFrom(region.getStructures()));
+ maxBlocks = Math.max(maxBlocks, maxBlocksFrom(StructurePlacementScope.placementsOf(region)));
}
for (IrisBiome biome : dimension.getReachableBiomes(engine)) {
- maxBlocks = Math.max(maxBlocks, maxBlocksFrom(biome.getStructures()));
+ maxBlocks = Math.max(maxBlocks, maxBlocksFrom(StructurePlacementScope.placementsOf(biome)));
}
- maxBlocks = Math.max(maxBlocks, maxBlocksFrom(dimension.getStructures()));
+ maxBlocks = Math.max(maxBlocks, maxBlocksFrom(StructurePlacementScope.placementsOf(dimension)));
return maxBlocks;
}
- private int maxBlocksFrom(KList placements) {
+ private int maxBlocksFrom(List placements) {
int max = 0;
- for (IrisStructurePlacement placement : placements) {
+ for (StructurePlacement placement : placements) {
if (!placement.hasIrisStructures()) {
continue;
}
@@ -610,7 +611,7 @@ public class StructurePlacing {
int carvePadding = terrain.resolvedMode() == StructureTerrainMode.FORCE_CARVE
|| terrain.resolvedMode() == StructureTerrainMode.BORE
? Math.max(0, terrain.horizontalPadding()) : 0;
- for (String key : placement.getStructures()) {
+ for (String key : placement.structures()) {
IrisStructure structure = StructureResources.structure(engine.getData(), key);
if (structure != null) {
max = Math.max(max, Math.max(1, structure.getMaxSizeChunks()) * 16 + carvePadding);
diff --git a/src/main/java/art/arcane/iris/engine/object/annotations/RegistryListStructure.java b/src/main/java/art/arcane/iris/engine/object/annotations/RegistryListStructure.java
deleted file mode 100644
index 8f985907c..000000000
--- a/src/main/java/art/arcane/iris/engine/object/annotations/RegistryListStructure.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Bukkit Servers
- * Copyright (c) 2022 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package art.arcane.iris.engine.object.annotations;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-@Retention(RUNTIME)
-@Target({PARAMETER, TYPE, FIELD})
-public @interface RegistryListStructure {
-
-}
diff --git a/src/main/java/art/arcane/iris/engine/object/decoration/IrisDecorationStep.java b/src/main/java/art/arcane/iris/engine/object/decoration/IrisDecorationStep.java
deleted file mode 100644
index a2ee1d3ab..000000000
--- a/src/main/java/art/arcane/iris/engine/object/decoration/IrisDecorationStep.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Servers
- * Copyright (c) 2026 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package art.arcane.iris.engine.object.decoration;
-
-import art.arcane.iris.engine.object.annotations.Desc;
-
-import java.util.Locale;
-
-/**
- * Pure-JVM mirror of Minecraft's decoration generation steps, in registry (ordinal) order. The ordinals and
- * serialized names match {@code GenerationStep.Decoration} on MC 26.2 so a platform can convert either way
- * without core depending on a Minecraft type. Verified against MC 26.2 GenerationStep.Decoration.
- */
-@Desc("A vanilla decoration generation step. Placed features are grouped into these steps and run in this order.")
-public enum IrisDecorationStep {
- @Desc("Raw generation - the earliest step, before lakes.")
- RAW_GENERATION("raw_generation"),
-
- @Desc("Lakes.")
- LAKES("lakes"),
-
- @Desc("Local modifications such as amethyst geodes, icebergs and dripstone clusters.")
- LOCAL_MODIFICATIONS("local_modifications"),
-
- @Desc("Underground structure features (not the structure system - features tagged as underground structures).")
- UNDERGROUND_STRUCTURES("underground_structures"),
-
- @Desc("Surface structure features.")
- SURFACE_STRUCTURES("surface_structures"),
-
- @Desc("Stronghold step.")
- STRONGHOLDS("strongholds"),
-
- @Desc("Underground ores. This is the step that carries vanilla and mod ore veins.")
- UNDERGROUND_ORES("underground_ores"),
-
- @Desc("Underground decoration such as glow lichen, sculk patches and cave vegetation.")
- UNDERGROUND_DECORATION("underground_decoration"),
-
- @Desc("Fluid springs - the small water and lava spring features.")
- FLUID_SPRINGS("fluid_springs"),
-
- @Desc("Vegetal decoration - trees, grass, flowers, kelp and most surface plant life.")
- VEGETAL_DECORATION("vegetal_decoration"),
-
- @Desc("Top layer modification - freezing and snow placement.")
- TOP_LAYER_MODIFICATION("top_layer_modification");
-
- private final String serializedName;
-
- IrisDecorationStep(String serializedName) {
- this.serializedName = serializedName;
- }
-
- public String getSerializedName() {
- return serializedName;
- }
-
- /**
- * Resolves a step by its vanilla ordinal. Returns null when the running Minecraft version declares more
- * decoration steps than this enum knows about, which the callers treat as "unknown step, generate it".
- */
- public static IrisDecorationStep byOrdinal(int ordinal) {
- IrisDecorationStep[] values = values();
- return ordinal < 0 || ordinal >= values.length ? null : values[ordinal];
- }
-
- public static IrisDecorationStep byKey(String key) {
- if (key == null || key.isBlank()) {
- return null;
- }
- String normalized = key.trim().toLowerCase(Locale.ROOT);
- for (IrisDecorationStep step : values()) {
- if (step.serializedName.equals(normalized) || step.name().toLowerCase(Locale.ROOT).equals(normalized)) {
- return step;
- }
- }
- return null;
- }
-}
diff --git a/src/main/java/art/arcane/iris/engine/object/decoration/IrisImportedFeatureControl.java b/src/main/java/art/arcane/iris/engine/object/decoration/IrisImportedFeatureControl.java
deleted file mode 100644
index 28a572d6c..000000000
--- a/src/main/java/art/arcane/iris/engine/object/decoration/IrisImportedFeatureControl.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Iris is a World Generator for Minecraft Servers
- * Copyright (c) 2026 Arcane Arts (Volmit Software)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package art.arcane.iris.engine.object.decoration;
-
-import art.arcane.iris.engine.framework.structure.ImportedStructures;
-import art.arcane.iris.engine.object.annotations.ArrayType;
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.volmlib.util.collection.KList;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-
-import java.util.Objects;
-
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Desc("Controls native vanilla, mod, and ingested datapack PLACED FEATURE generation for this dimension (set as the dimension's 'importedFeatures' field). Placed features are ores, trees, plants, springs, geodes and every other decoration entry a biome declares. This is OFF by default: with 'enabled' false Iris generates exactly the terrain it always has and no native feature runs. With it true, every placed feature the biome's vanilla derivative declares runs over Iris terrain, in vanilla step order, on the same worldgen thread vanilla uses. Carvers are never imported - Iris has no NoiseGeneratorSettings, so there is nothing for a carver to carve against. Family matching on 'disabled' uses namespace, slash, or underscore boundaries, so 'minecraft:ore' covers every vanilla ore feature without matching unrelated names.")
-@Data
-public class IrisImportedFeatureControl {
- @Desc("Master switch. False (the default) means no native placed feature generates and chunk output is identical to a pack without this block at all. True runs the vanilla decoration feature pass over Iris terrain.")
- private boolean enabled = false;
-
- @ArrayType(type = String.class, min = 1)
- @Desc("Placed feature keys to deny explicitly, e.g. 'minecraft:ore_diamond'. A namespace:path prefix also matches, so 'minecraft:ore' denies every vanilla ore and 'minecraft:trees' denies every tree placement. Every key not matched here generates while 'enabled' is true.")
- private KList disabled = new KList<>();
-
- @ArrayType(type = IrisDecorationStep.class, min = 1)
- @Desc("Restrict feature generation to these decoration steps only. Empty (the default) means every step is eligible. Use this to import ores without importing vegetation: set it to UNDERGROUND_ORES.")
- private KList steps = new KList<>();
-
- @ArrayType(type = IrisDecorationStep.class, min = 1)
- @Desc("Decoration steps to deny. Applied after 'steps', so a step listed here never generates even if 'steps' allows it. VEGETAL_DECORATION is the usual entry for packs that grow their own trees.")
- private KList disabledSteps = new KList<>();
-
- /**
- * True when this dimension wants the native feature pass at all. Every other accessor on this class is
- * meaningless while this is false, and the platform must not build any feature machinery.
- */
- public boolean shouldGenerateFeatures() {
- return enabled;
- }
-
- public boolean shouldGenerateStep(IrisDecorationStep step) {
- if (!enabled) {
- return false;
- }
- KList allowed = Objects.requireNonNull(
- steps, "importedFeatures.steps must not be null");
- KList denied = Objects.requireNonNull(
- disabledSteps, "importedFeatures.disabledSteps must not be null");
- if (step == null) {
- // A step this Iris build does not know about (newer Minecraft): allow it unless the pack
- // narrowed generation to an explicit step list.
- return allowed.isEmpty();
- }
- if (!allowed.isEmpty() && !allowed.contains(step)) {
- return false;
- }
- return !denied.contains(step);
- }
-
- public boolean shouldGenerate(String placedFeatureKey) {
- return resolve(placedFeatureKey, null) == NativeFeatureGenerationStatus.GENERATE_NATIVE;
- }
-
- /**
- * Resolves one placed feature against this control. A null step skips the step gate, which is what the
- * key-only query does.
- */
- public NativeFeatureGenerationStatus resolve(String placedFeatureKey, IrisDecorationStep step) {
- if (!enabled) {
- return NativeFeatureGenerationStatus.FEATURES_DISABLED;
- }
- if (placedFeatureKey == null || placedFeatureKey.isBlank()) {
- return NativeFeatureGenerationStatus.INVALID_REGISTRY_KEY;
- }
- if (step != null && !shouldGenerateStep(step)) {
- return NativeFeatureGenerationStatus.STEP_DISABLED;
- }
- KList deniedKeys = Objects.requireNonNull(
- disabled, "importedFeatures.disabled must not be null");
- for (String entry : deniedKeys) {
- if (ImportedStructures.matchesKey(entry, placedFeatureKey)) {
- return NativeFeatureGenerationStatus.DISABLED_BY_PACK;
- }
- }
- return NativeFeatureGenerationStatus.GENERATE_NATIVE;
- }
-}
diff --git a/src/main/java/art/arcane/iris/engine/object/structure/IrisStructureAnchorMode.java b/src/main/java/art/arcane/iris/engine/object/structure/IrisStructureAnchorMode.java
deleted file mode 100644
index b7d17991a..000000000
--- a/src/main/java/art/arcane/iris/engine/object/structure/IrisStructureAnchorMode.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package art.arcane.iris.engine.object.structure;
-
-import art.arcane.iris.engine.object.annotations.Desc;
-
-@Desc("Selects the vertical environment used to anchor an Iris structure placement.")
-public enum IrisStructureAnchorMode {
- @Desc("Preserve the historical underground boolean behavior.")
- LEGACY,
-
- @Desc("Anchor to the terrain surface and use minHeight/maxHeight as a surface gate.")
- SURFACE,
-
- @Desc("Choose a deterministic Y inside the minHeight/maxHeight band.")
- HEIGHT_BAND,
-
- @Desc("Anchor in carved space with solid support below.")
- CAVE_FLOOR,
-
- @Desc("Anchor in carved space with solid support above.")
- CAVE_CEILING,
-
- @Desc("Anchor in carved space without nearby floor or ceiling support.")
- CAVE_CENTER,
-
- @Desc("Anchor at any carved-space position.")
- CAVE_ANY;
-
- public boolean isCave() {
- return switch (this) {
- case CAVE_FLOOR, CAVE_CEILING, CAVE_CENTER, CAVE_ANY -> true;
- default -> false;
- };
- }
-}
diff --git a/src/main/java/art/arcane/iris/engine/object/structure/vanilla/IrisNativeStructure.java b/src/main/java/art/arcane/iris/engine/object/structure/vanilla/IrisNativeStructure.java
deleted file mode 100644
index 357b0002d..000000000
--- a/src/main/java/art/arcane/iris/engine/object/structure/vanilla/IrisNativeStructure.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package art.arcane.iris.engine.object.structure.vanilla;
-
-import art.arcane.iris.engine.object.annotations.Desc;
-import art.arcane.iris.engine.object.annotations.MinNumber;
-import art.arcane.iris.engine.object.annotations.RegistryListVanillaStructure;
-import art.arcane.iris.engine.object.annotations.Required;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
-import com.volmit.vanilla.JigsawOverrides;
-
-@Accessors(chain = true)
-@NoArgsConstructor
-@AllArgsConstructor
-@Data
-@Desc("A live vanilla, datapack, or modded structure generated by Minecraft at an Iris-controlled placement.")
-public class IrisNativeStructure {
- @Required
- @RegistryListVanillaStructure
- @Desc("Registered structure key. The source retains its native generator, pieces, templates, processors, entities, markers, and data.")
- private String structure = "";
-
- @MinNumber(1)
- @Desc("Relative selection weight when a placement offers multiple native structure sources.")
- private int weight = 1;
-
- @Desc("Optional jigsaw-only assembly overrides. Null preserves the complete registered structure definition.")
- private JigsawOverrides jigsaw = null;
-}
diff --git a/src/main/java/art/arcane/iris/engine/object/structure/vanilla/NativeStructureSuppression.java b/src/main/java/art/arcane/iris/engine/object/structure/vanilla/NativeStructureSuppression.java
deleted file mode 100644
index 35051cc68..000000000
--- a/src/main/java/art/arcane/iris/engine/object/structure/vanilla/NativeStructureSuppression.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package art.arcane.iris.engine.object.structure.vanilla;
-
-import art.arcane.iris.engine.object.annotations.Desc;
-
-@Desc("Controls whether an Iris structure placement suppresses its imported native source.")
-public enum NativeStructureSuppression {
- @Desc("Leaves native generation enabled alongside this Iris structure placement.")
- NONE,
-
- @Desc("Suppresses the structure's vanillaSource when used by a validated dimension-level replacement placement.")
- REPLACE_SOURCE
-}
diff --git a/src/main/java/art/arcane/iris/engine/object/world/biome/IrisBiome.java b/src/main/java/art/arcane/iris/engine/object/world/biome/IrisBiome.java
index 659bec501..3a1a3d934 100644
--- a/src/main/java/art/arcane/iris/engine/object/world/biome/IrisBiome.java
+++ b/src/main/java/art/arcane/iris/engine/object/world/biome/IrisBiome.java
@@ -22,7 +22,6 @@ import art.arcane.iris.engine.object.noise.IrisGeneratorStyle;
import art.arcane.iris.engine.object.noise.NoiseStyle;
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
import art.arcane.iris.engine.object.procedural.IrisProceduralObjects;
-import art.arcane.iris.engine.object.structure.IrisStructurePlacement;
import art.arcane.iris.engine.object.value.IRare;
import art.arcane.iris.engine.object.world.biome.custom.IrisBiomeCustom;
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
@@ -146,9 +145,6 @@ public class IrisBiome extends IrisRegistrant implements IRare {
private KList objects = new KList<>();
@Desc("Procedural objects (such as trees) iris generates from scratch and places in this biome, instead of loading them from iob files")
private IrisProceduralObjects proceduralObjects = new IrisProceduralObjects();
- @ArrayType(min = 1, type = IrisStructurePlacement.class)
- @Desc("Structures define jigsaw or vanilla/datapack structures iris will place in this biome")
- private KList structures = new KList<>();
@ArrayType(min = 1, type = IrisBiomeGeneratorLink.class)
@Desc("Generators for this biome. Multiple generators with different interpolation sizes will mix with other biomes how you would expect. This defines your biome height relative to the fluid height. Use negative for oceans.")
private KList generators = new KList().qadd(new IrisBiomeGeneratorLink());
diff --git a/src/main/java/art/arcane/iris/engine/object/world/dimension/IrisDimension.java b/src/main/java/art/arcane/iris/engine/object/world/dimension/IrisDimension.java
index 327edb132..cb4d0c812 100644
--- a/src/main/java/art/arcane/iris/engine/object/world/dimension/IrisDimension.java
+++ b/src/main/java/art/arcane/iris/engine/object/world/dimension/IrisDimension.java
@@ -18,7 +18,6 @@
package art.arcane.iris.engine.object.world.dimension;
-import art.arcane.iris.engine.object.decoration.IrisImportedFeatureControl;
import art.arcane.iris.engine.object.image.IrisImageMap;
import art.arcane.iris.engine.object.image.IrisImageMapApplication;
import art.arcane.iris.engine.object.image.IrisImageMapBinding;
@@ -27,7 +26,6 @@ import art.arcane.iris.engine.object.noise.IrisShapedGeneratorStyle;
import art.arcane.iris.engine.object.noise.NoiseStyle;
import art.arcane.iris.engine.object.procedural.tree.IrisTreeSettings;
import art.arcane.iris.engine.object.runtime.StudioMode;
-import art.arcane.iris.engine.object.structure.IrisStructurePlacement;
import art.arcane.iris.engine.object.value.IrisRange;
import art.arcane.iris.engine.object.world.IrisEnvironment;
import art.arcane.iris.engine.object.world.IrisWorldBoundary;
@@ -237,11 +235,6 @@ public class IrisDimension extends IrisRegistrant {
@ArrayType(min = 1, type = IrisShapedGeneratorStyle.class)
@Desc("Overlay additional noise on top of the interoplated terrain.")
private KList overlayNoise = new KList<>();
- @Desc("Dimension-wide Iris structure placements, independent of biome/region placements")
- @ArrayType(type = IrisStructurePlacement.class, min = 1)
- private KList structures = new KList<>();
- @Desc("Controls native vanilla, mod, and ingested datapack PLACED FEATURE generation (ores, trees, plants, springs, geodes) for this dimension. Disabled by default: leaving this out generates exactly the terrain Iris always has. Set 'enabled' true to run the vanilla decoration feature pass over Iris terrain. Carvers are never imported.")
- private IrisImportedFeatureControl importedFeatures = new IrisImportedFeatureControl();
@ArrayType(type = String.class, min = 1)
@Desc("External datapack sources owned by this dimension. Bukkit registers their resources server-wide, but Iris excludes their structure sets and definitions from generation and locate state in vanilla worlds and Iris dimensions that do not declare the same source. Editable auto-import is limited to resources supplied by the URLs declared by each Iris pack. Any registered datapack structure can be placed directly through nativeStructures without conversion. Replacing native generation requires a dimension-level structure placement with nativeSuppression set to REPLACE_SOURCE; provenance alone never disables native structures.")
private KList datapackImports = new KList<>();
diff --git a/src/main/java/art/arcane/iris/engine/object/world/region/IrisRegion.java b/src/main/java/art/arcane/iris/engine/object/world/region/IrisRegion.java
index e57c3b9f9..4b70f84e7 100644
--- a/src/main/java/art/arcane/iris/engine/object/world/region/IrisRegion.java
+++ b/src/main/java/art/arcane/iris/engine/object/world/region/IrisRegion.java
@@ -20,7 +20,6 @@ package art.arcane.iris.engine.object.world.region;
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
import art.arcane.iris.engine.object.procedural.IrisProceduralObjects;
-import art.arcane.iris.engine.object.structure.IrisStructurePlacement;
import art.arcane.iris.engine.object.value.IRare;
import art.arcane.iris.engine.object.world.biome.InferredType;
import art.arcane.iris.engine.object.world.biome.IrisBiome;
@@ -81,9 +80,6 @@ public class IrisRegion extends IrisRegistrant implements IRare {
private KList objects = new KList<>();
@Desc("Procedural objects (trees, ruins, formations, coral, fungi, crystals) iris generates from scratch and places across this region")
private IrisProceduralObjects proceduralObjects = new IrisProceduralObjects();
- @ArrayType(min = 1, type = IrisStructurePlacement.class)
- @Desc("Structures define jigsaw or vanilla/datapack structures iris will place in this region")
- private KList structures = new KList<>();
@MinNumber(0)
@Desc("The min shore height")
private double shoreHeightMin = 1.2;