Keep the land biome under inland water above sea level

The surface biome is typed from the ground height, so a pond or stream whose floor dips below the
dimension's fluid height became the region's sea biome (ocean colours and ocean spawns in a small
pond on low land). When the hydrology raster marks the column as inland water (pond, channel,
cascade or waterfall; not a mouth or sea inlet) whose surface is above sea level, and the base biome
is a land biome, keep that land biome.
This commit is contained in:
Michael committed 2026-10-31 02:12:01 -05:00
1 parent 6d6bd4f054
commit 6ed70b3856
1 file changed
+18 -1
@@ -1721,9 +1721,14 @@ public class IrisComplex implements DataProvider {
if (mapped != null) {
return mapped;
}
IrisBiome base = baseBiomeStream.get(x, z);
if (base.getInferredType() == InferredType.LAND && inlandWater(x, z)) {
// a pond or stream above sea level keeps the land around it, even where its floor dips below sea level
return base;
}
return fixBiomeType(
terrainHeight,
baseBiomeStream.get(x, z),
base,
regionStream.get(x, z),
x,
z,
@@ -1731,6 +1736,18 @@ public class IrisComplex implements DataProvider {
);
}
private boolean inlandWater(double x, double z) {
int blockX = blockCoordinate(x);
int blockZ = blockCoordinate(z);
ChunkWaterRaster raster = hydrologyRasterAt(blockX, blockZ);
if (raster.empty()) {
return false;
}
WaterRole role = raster.role(blockX & 15, blockZ & 15);
return role.wet() && role != WaterRole.MOUTH && role != WaterRole.INLET
&& raster.waterHead(blockX & 15, blockZ & 15) > transitionFluidHeight(x, z, fluidHeight);
}
private IrisBiome hydrologyShoreBiome(double terrainHeight, double x, double z) {
int blockX = blockCoordinate(x);
int blockZ = blockCoordinate(z);