Resurface shallow tidal banks

- Keep the biome surface layer on tidal bank cuts of 6 blocks or less
This commit is contained in:
Brian Fopiano committed 2026-11-03 19:50:33 -05:00
1 parent 8189215328
commit ab3e22c619
3 files changed
+25

No files matched your search

@@ -1405,6 +1405,11 @@ public class IrisComplex implements DataProvider {
return tier == null ? pondMaterials : tier.materials();
}
public boolean isTidalBank(int x, int z) {
WaterRole role = resolveWaterRole(x, z);
return (role == WaterRole.BANK || role == WaterRole.SHORE) && chunkRasterAt(x, z).tier(x & 15, z & 15) == hydrologyRuntime.settings().tidalTier();
}
public HydrologyVegetation.Decorators resolveWaterDecorators(int x, int z) {
if (!waterVegetation.planted()) {
return HydrologyVegetation.Decorators.EMPTY;
@@ -51,6 +51,7 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<NativeBloc
private static final BoundBlockState DIRT = BoundBlockState.of("minecraft:dirt");
private static final BoundBlockState NETHERRACK = BoundBlockState.of("minecraft:netherrack");
private static final int INLET_SEA_LAYERS = 1;
private static final int TIDAL_BANK_SHALLOW_CUT = 6;
@Getter
private final RNG rng;
@@ -313,6 +314,9 @@ public class IrisTerrainNormalActuator extends EngineAssignedActuator<NativeBloc
int naturalSurfaceY = naturalColumn == null
? complex.naturalTrueHeight(realX, realZ) : naturalColumn.surfaceY(layerSurfaceY);
cut = Math.max(0, naturalSurfaceY - layerSurfaceY);
if (cut <= TIDAL_BANK_SHALLOW_CUT && complex.isTidalBank(realX, realZ)) {
cut = 0;
}
}
blocks = biome.generateLayers(dimension, realX, realZ, rng,
layerSurfaceY + cut + 1 - bedrockFloor, layerSurfaceY + cut, data, complex);
@@ -140,6 +140,22 @@ public class IrisTerrainNormalActuatorHydrologyTest {
assertSame("a slot cut through the cliff shows the strata below the old surface", cliff.dirt, cliff.paint().get(0, GROUND, 0));
}
@Test
public void shallowTidalBankCutsKeepTheBiomeSurfaceLayer() {
Painter cut = new Painter(WaterRole.BANK, 0);
when(cut.complex.naturalTrueHeight(11, -4)).thenReturn(GROUND + 3);
NativeBlockState stripped = cut.paint().get(0, GROUND, 0);
Painter tidal = new Painter(WaterRole.BANK, 0);
when(tidal.complex.naturalTrueHeight(11, -4)).thenReturn(GROUND + 3);
when(tidal.complex.isTidalBank(11, -4)).thenReturn(true);
assertSame("the shallow tidal cut is resurfaced", tidal.grass, tidal.paint().get(0, GROUND, 0));
assertSame("a river bank keeps its strata", cut.dirt, stripped);
Painter deep = new Painter(WaterRole.BANK, 0);
when(deep.complex.naturalTrueHeight(11, -4)).thenReturn(GROUND + 20);
when(deep.complex.isTidalBank(11, -4)).thenReturn(true);
assertSame("a deep tidal cut shows the strata", deep.dirt, deep.paint().get(0, GROUND, 0));
}
@Test
public void openInletSlotsKeepLiquidWaterUnderOnlyTheTopSeaLayer() {
Painter slot = new Painter(WaterRole.INLET, HEAD);