Supply structure sea surface

- GenerationWritePolicy.seaSurface returns minHeight + fluidHeight and the first fluid of the dimension fluidPalette
- Dimensions with no sea fluid or a sea at the world floor return StructureSeaSurface.NONE
- Bukkit and modded structure stage policies supply the sea surface to native structure fitting
- Native fitter tests pass SeaSurface.NONE to keep their expectations
- FLATTEN descriptions state the sea-surface clamp and sea-fluid fill
- Schema digest recaptured for the description change
This commit is contained in:
Brian Neumann-Fopiano committed 2026-11-01 16:50:57 -05:00
1 parent 8bc1ed760e
commit 701b3191eb
11 files changed
+243 -121

No files matched your search

@@ -21,6 +21,7 @@ import art.arcane.volmlib.nativelib.terrain.structure.StructureLocateSearchAcces
import art.arcane.volmlib.nativelib.terrain.structure.StructurePalette;
import art.arcane.volmlib.nativelib.terrain.structure.StructurePlacementDecision;
import art.arcane.volmlib.nativelib.terrain.structure.StructureReferencePolicy;
import art.arcane.volmlib.nativelib.terrain.structure.StructureSeaSurface;
import art.arcane.volmlib.nativelib.terrain.structure.StructureVolumePolicy;
import art.arcane.volmlib.util.math.RNG;
@@ -120,6 +121,11 @@ public final class BukkitStructureStagePolicy implements StructureStagePolicy<
return (x, z) -> Engine.hostHeight(context, x, z, true) + context.getMinHeight();
}
@Override
public StructureSeaSurface seaSurface(Engine context) {
return GenerationWritePolicy.seaSurface(context);
}
@Override
public IntBinaryOperator worldgenHeight(Engine context, int runtimeMinY, boolean floor) {
return (x, z) -> Engine.hostHeight(context, x, z, floor) + runtimeMinY + 1;
@@ -4,9 +4,12 @@ import art.arcane.iris.generation.runtime.DimensionStackContext;
import art.arcane.iris.generation.runtime.DimensionStackLayout;
import art.arcane.iris.generation.runtime.Engine;
import art.arcane.iris.generation.runtime.IrisEngine;
import art.arcane.iris.generation.terrain.IrisDimension;
import art.arcane.iris.world.history.GenerationHistoryRuntimeRouter;
import art.arcane.iris.structure.object.IrisStaticObjectLayer;
import art.arcane.volmlib.nativelib.terrain.NativeBlockPositionPredicate;
import art.arcane.volmlib.nativelib.terrain.NativeBlockState;
import art.arcane.volmlib.nativelib.terrain.structure.StructureSeaSurface;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -23,6 +26,20 @@ public final class GenerationWritePolicy {
return router != null && activation < router.history().activeActivation().activationId();
}
public static StructureSeaSurface seaSurface(Engine engine) {
IrisDimension dimension = engine.getDimension();
int fluidHeight = dimension.getFluidHeight();
if (fluidHeight <= 0) {
return StructureSeaSurface.NONE;
}
for (NativeBlockState fluid : dimension.getFluidPalette().getBlockData(engine.getData())) {
if (fluid.isFluid()) {
return new StructureSeaSurface(engine.getMinHeight() + fluidHeight, fluid);
}
}
return StructureSeaSurface.NONE;
}
public static NativeBlockPositionPredicate protectedPositions(
IrisStaticObjectLayer staticObjects,
DimensionStackContext stackContext,
@@ -58,7 +58,7 @@ public class IrisVanillaStructureAdjustment {
@Description("Optional foundation columns placed beneath the native structure piece bases after placement.")
private IrisStructureStiltSettings stilt = null;
@Description("Optional terrain integration override. FLATTEN cuts and fills exposed surface foundations within flattenRange, blending across horizontalPadding blocks while preserving buried and submerged structures. VACUUM raises processed rigid-template foundations with a fixed 12-block falloff without lowering ground. BORE and FORCE_CARVE clear every intersecting chunk before native placement, while ENCASE fills it. Left unset, SOURCE replays the registered structure's authored terrain adaptation.")
@Description("Optional terrain integration override. FLATTEN cuts and fills exposed surface foundations within flattenRange, blending across horizontalPadding blocks while preserving buried and submerged structures. It never lowers dry ground outside a structure footprint below the dimension fluidHeight, and cuts at or below fluidHeight fill with the dimension sea fluid instead of air. VACUUM raises processed rigid-template foundations with a fixed 12-block falloff without lowering ground. BORE and FORCE_CARVE clear every intersecting chunk before native placement, while ENCASE fills it. Left unset, SOURCE replays the registered structure's authored terrain adaptation.")
private IrisStructureTerrain terrain = null;
public boolean matches(String key) {
@@ -30,7 +30,7 @@ public class IrisStructureTerrain implements StructureTerrainSettings {
private static final double MAX_EROSION_FREQUENCY = 1D;
private static final double MAX_LOBE_FREQUENCY = 1D;
@Description("Terrain operation. SOURCE applies the registered native structure's authored terrain adaptation and is a no-op for editable Iris structures. PRESERVE disables terrain integration. FLATTEN cuts and fills exposed native structure terrain within flattenRange, blending across horizontalPadding blocks. VACUUM raises terrain from processed rigid-template foundations with a fixed 12-block falloff without lowering ground. BORE and FORCE_CARVE clear the requested envelope, while ENCASE fills it before placement.")
@Description("Terrain operation. SOURCE applies the registered native structure's authored terrain adaptation and is a no-op for editable Iris structures. PRESERVE disables terrain integration. FLATTEN cuts and fills exposed native structure terrain within flattenRange, blending across horizontalPadding blocks, and never lowers dry ground outside a structure footprint below the dimension fluidHeight. SOURCE and FLATTEN surface cuts at or below fluidHeight fill with the dimension sea fluid instead of air. VACUUM raises terrain from processed rigid-template foundations with a fixed 12-block falloff without lowering ground. BORE and FORCE_CARVE clear the requested envelope, while ENCASE fills it before placement.")
private StructureTerrainMode mode = StructureTerrainMode.SOURCE;
@MinNumber(0)