mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-30 01:34:04 +00:00
Open water under falls
- Estuary and inlet columns that a higher neighbouring water column falls into skip the sea layers, so falling water lands in open sea water instead of spreading over sea ice - Fall check compares the unclamped water head with the 4-neighbour wet heads, the rule the mantle uses to place falls - IrisTerrainNormalActuatorHydrologyTest.aFallIntoAFrozenMouthLandsInOpenWater pins the open plunge and keeps ice beside level water and dry banks
This commit is contained in:
1 parent
2ddc9f1106
commit
2ed13f9b7f
2 files changed
+51
-5
No files matched your search
@@ -215,10 +215,8 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<NativeBloc
|
||||
IrisBiome biome = biomeCache.get(xf, zf);
|
||||
IrisRegion region = regionCache.get(xf, zf);
|
||||
int he = Math.min(chunkHeight, context.getRoundedHeight(xf, zf));
|
||||
int surfaceFluidHeight = Math.min(
|
||||
chunkHeight,
|
||||
(int) Math.round(waterHeadStream.getDouble(realX, realZ))
|
||||
);
|
||||
int waterHead = (int) Math.round(waterHeadStream.getDouble(realX, realZ));
|
||||
int surfaceFluidHeight = Math.min(chunkHeight, waterHead);
|
||||
int hf = Math.max(surfaceFluidHeight, he);
|
||||
if (hf < 0) {
|
||||
return;
|
||||
@@ -229,6 +227,7 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<NativeBloc
|
||||
boolean wet = role.wet();
|
||||
boolean submerged = wet && he < surfaceFluidHeight;
|
||||
boolean seaFloor = !wet || role == WaterRole.INLET || role == WaterRole.MOUTH;
|
||||
boolean openUnderFall = wet && seaFloor && receivesFall(realX, realZ, waterHead);
|
||||
IrisHydrologyMaterials materials = role == WaterRole.NONE || role == WaterRole.INLET ? null
|
||||
: complex.resolveWaterMaterials(realX, realZ);
|
||||
Terrain3DColumn terrainColumn = complex.terrainColumn(realX, realZ);
|
||||
@@ -298,7 +297,7 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<NativeBloc
|
||||
fblocks,
|
||||
fdepth,
|
||||
fluid,
|
||||
!seaFloor
|
||||
!seaFloor || openUnderFall
|
||||
));
|
||||
continue;
|
||||
}
|
||||
@@ -364,6 +363,15 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<NativeBloc
|
||||
}
|
||||
}
|
||||
|
||||
private boolean receivesFall(int realX, int realZ, int head) {
|
||||
return fallsFrom(realX + 1, realZ, head) || fallsFrom(realX - 1, realZ, head)
|
||||
|| fallsFrom(realX, realZ + 1, head) || fallsFrom(realX, realZ - 1, head);
|
||||
}
|
||||
|
||||
private boolean fallsFrom(int realX, int realZ, int head) {
|
||||
return waterRoleStream.get(realX, realZ).wet() && Math.round(waterHeadStream.getDouble(realX, realZ)) > head;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paints the solid run from {@code top} down to {@code floor}, which lies below every biome
|
||||
* layer, river material, mapped surface and cave ceiling of its span: only ores or rock land there.
|
||||
|
||||
Reference in new issue
Block a user