diff options
author | paramat <mat.gregory@virginmedia.com> | 2017-03-12 13:26:09 +0000 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-04-03 04:49:32 +0100 |
commit | 859141a0ce38fbd606d95ae7a2f0999acf2fbe84 (patch) | |
tree | 10a77bdb7f52eadbc0dea7dd9e3066e622a681a8 /src/mapgen.cpp | |
parent | 86b1542181a92841d174e1caec94d084a34e5158 (diff) | |
download | minetest-859141a0ce38fbd606d95ae7a2f0999acf2fbe84.tar.gz minetest-859141a0ce38fbd606d95ae7a2f0999acf2fbe84.tar.bz2 minetest-859141a0ce38fbd606d95ae7a2f0999acf2fbe84.zip |
Cavegen/Mgv5/Mgv7: Add optional giant caverns
Add to MapgenBasic for use by multiple mapgens.
Add to mgv5 and mgv7, enabled by default.
Similar to mgvalleys caverns but half the scale.
Parameters for upper y limit, distance caverns taper to full size, and
noise threshold (full cavern size).
As with mgvalleys caverns are generated first and classic caves are
disabled in any mapchunk containing a cavern, to avoid excessive
spreading volumes of liquids.
This also avoids floating blobs of liquid where a large classic cave
has overgenerated out into a neighbouring previously-generated mapchunk.
Diffstat (limited to 'src/mapgen.cpp')
-rw-r--r-- | src/mapgen.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp index b6e8c0fd1..c63c426fa 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -840,6 +840,18 @@ void MapgenBasic::generateCaves(s16 max_stone_y, s16 large_cave_depth) } +bool MapgenBasic::generateCaverns(s16 max_stone_y) +{ + if (node_min.Y > max_stone_y || node_min.Y > cavern_limit) + return false; + + CavernsNoise caverns_noise(ndef, csize, &np_cavern, + seed, cavern_limit, cavern_taper, cavern_threshold); + + return caverns_noise.generateCaverns(vm, node_min, node_max); +} + + void MapgenBasic::generateDungeons(s16 max_stone_y, MgStoneType stone_type) { if (max_stone_y < node_min.Y) |