mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-02 02:34:24 +00:00
Fall and estuary check fixes
- missingSurface: a sea-floor head under sea layers or sea decoration holds its cover or its own planned fluid, so a wrong fluid at a frozen estuary or inlet head fails again (R76). - Column parity test mirrors the open-water-under-a-fall rule with a random 4-neighbour of its own head and role, guarding the actuator against drift from the mantle fall rule. - An inlet mouth under a fall keeps open sea water, and one without a fall keeps its sea layers. - bermOverCap still counts an over-cap wall beside a lake's outlet, which is never held.
This commit is contained in:
1 parent
6f3b96cfb3
commit
a21e59f53b
5 files changed
+86
-13
No files matched your search
@@ -182,6 +182,9 @@ public class HydrologyMetricsTest {
|
||||
assertEquals(0L, berms(List.of(outlet), List.of(held), rasters, low));
|
||||
assertEquals(1L, berms(List.of(outlet), List.of(pond(10L, 51, square(0, 0, 2), 0L, 4, 4)), rasters(columns), low));
|
||||
assertEquals(1L, berms(List.of(outlet), List.of(pond(10L, 55, square(0, 0, 2), 3L, 4, 4)), rasters(columns), low));
|
||||
Pond lake = new Pond(10L, PondKind.LAKE, 51, 47, 4, 4, 52f, square(0, 0, 2), 3L, 0, "minecraft:water", 4, 4);
|
||||
assertEquals("a lake's outlet is never held, so its over-cap wall still counts", 1L,
|
||||
berms(List.of(outlet), List.of(lake), rasters(columns), low));
|
||||
columns.put(HydrologyVoxels.columnKey(10, 5), new Column(WaterRole.BANK, HydrologyVoxels.NO_WATER, head + 1, 3L));
|
||||
assertEquals(1L, berms(List.of(outlet), List.of(held), rasters(columns), low));
|
||||
}
|
||||
|
||||
@@ -176,9 +176,11 @@ public class HydrologyVoxelsTest {
|
||||
@Test
|
||||
public void seaFloorHeadsMayHoldTheSeaLayersOrTheDecorationOfTheSeaTheyJoin() {
|
||||
for (WaterRole role : new WaterRole[]{WaterRole.INLET, WaterRole.MOUTH}) {
|
||||
assertEquals(role.name(), HydrologyVoxels.SOLID, HydrologyVoxels.plannedSurface(role, false, true, false, HydrologyVoxels.WATER));
|
||||
assertEquals(role.name(), HydrologyVoxels.SOLID, HydrologyVoxels.plannedSurface(role, false, false, true, HydrologyVoxels.WATER));
|
||||
byte cover = HydrologyVoxels.seaCover(HydrologyVoxels.WATER);
|
||||
assertEquals(role.name(), cover, HydrologyVoxels.plannedSurface(role, false, true, false, HydrologyVoxels.WATER));
|
||||
assertEquals(role.name(), cover, HydrologyVoxels.plannedSurface(role, false, false, true, HydrologyVoxels.WATER));
|
||||
assertEquals(role.name(), HydrologyVoxels.WATER, HydrologyVoxels.plannedSurface(role, false, false, false, HydrologyVoxels.WATER));
|
||||
assertEquals(role.name(), HydrologyVoxels.SOLID, HydrologyVoxels.plannedSurface(role, true, true, false, HydrologyVoxels.WATER));
|
||||
}
|
||||
for (WaterRole role : new WaterRole[]{WaterRole.CHANNEL, WaterRole.POND, WaterRole.CASCADE, WaterRole.WATERFALL}) {
|
||||
assertEquals(role.name(), HydrologyVoxels.WATER, HydrologyVoxels.plannedSurface(role, false, true, true, HydrologyVoxels.WATER));
|
||||
@@ -187,6 +189,30 @@ public class HydrologyVoxelsTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void seaFloorHeadsHoldTheirCoverOrTheirOwnFluid() {
|
||||
HydrologyVoxels.ChunkBlocks chunk = pond(10);
|
||||
for (int z = 3; z <= 5; z++) {
|
||||
for (int x = 3; x <= 5; x++) {
|
||||
chunk.heads()[(z << 4) | x] = 10;
|
||||
}
|
||||
}
|
||||
for (WaterRole role : new WaterRole[]{WaterRole.INLET, WaterRole.MOUTH}) {
|
||||
for (boolean layers : new boolean[]{true, false}) {
|
||||
String cover = role + (layers ? " under sea layers" : " under the sea's decoration");
|
||||
chunk.surfaces()[(4 << 4) | 4] = HydrologyVoxels.plannedSurface(role, false, layers, !layers, HydrologyVoxels.WATER);
|
||||
chunk.set(4, 10, 4, HydrologyVoxels.WATER);
|
||||
assertEquals("open water at the head of a " + cover, 0L, scan(volume(chunk)).missingSurfaces);
|
||||
chunk.set(4, 10, 4, HydrologyVoxels.SOLID);
|
||||
assertEquals("the cover at the head of a " + cover, 0L, scan(volume(chunk)).missingSurfaces);
|
||||
chunk.set(4, 10, 4, HydrologyVoxels.LAVA);
|
||||
HydrologyVoxels.WaterScan scan = scan(volume(chunk));
|
||||
assertEquals("the wrong fluid at the head of a " + cover, 1L, scan.missingSurfaces);
|
||||
assertEquals("missing planned surface at 4,10,4", scan.examples.get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onlyBlocksTheBiomeDecoratesWithAreItsDecoration() {
|
||||
IrisData data = mock(IrisData.class);
|
||||
|
||||
Reference in new issue
Block a user