feat(world-gen): add MinCaveY ceiling to CaveCarver

This commit is contained in:
MDietermann
2026-06-01 18:42:29 +02:00
parent 262933238c
commit 89ac70f1ab
2 changed files with 18 additions and 0 deletions

View File

@@ -183,4 +183,20 @@ public class CaveCarverTests
Assert.True(bothEmpty || bothCarved,
$"seam mismatch: c1={airC1Seam}, c2={airC2Seam}");
}
[Fact]
public void Carve_RespectsMinCaveY_NoCarvingAboveCeiling()
{
var cfg = new Configuration { MinCaveY = 20 };
var carver = new CaveCarver(seed: 42, Blocks, cfg);
Chunk c = MakeStoneChunk();
// Chunk Y=2 → worldY 32..47, all above MinCaveY=20 → must stay solid.
carver.Carve(c, new Vector3i(0, 2, 0));
for (int x = 0; x < Chunk.Size; x++)
for (int y = 0; y < Chunk.Size; y++)
for (int z = 0; z < Chunk.Size; z++)
Assert.Equal(Blocks.Stone.Id, c[x, y, z]);
}
}