diff options
author | paramat <paramat@users.noreply.github.com> | 2017-06-14 02:00:51 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-07-11 01:14:24 +0100 |
commit | 8299e4b67eff48e0f6e101afea2fae8f0e65c421 (patch) | |
tree | fed891f09468aca2b53c8ced933fb88de2a823c6 /src/mapgen_flat.cpp | |
parent | ef285b2815962a7a01791059ed984cb12fdba4dd (diff) | |
download | minetest-8299e4b67eff48e0f6e101afea2fae8f0e65c421.tar.gz minetest-8299e4b67eff48e0f6e101afea2fae8f0e65c421.tar.bz2 minetest-8299e4b67eff48e0f6e101afea2fae8f0e65c421.zip |
Biomes/decorations/ores: Make relative to 'water_level' setting
Add 'biome_zero_level' argument to 'generateBiomes()', 'deco_zero_level'
argument to 'placeAllDecos()' and 'ore_zero_level' to 'placeAllOres()'
to allow mapgens to vertically shift the registered biomes, decorations
and ores per-mapchunk.
Will also allow many realm possibilities in future mapgens.
Diffstat (limited to 'src/mapgen_flat.cpp')
-rw-r--r-- | src/mapgen_flat.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mapgen_flat.cpp b/src/mapgen_flat.cpp index 95fb35412..56dca1f06 100644 --- a/src/mapgen_flat.cpp +++ b/src/mapgen_flat.cpp @@ -189,7 +189,7 @@ void MapgenFlat::makeChunk(BlockMakeData *data) // Init biome generator, place biome-specific nodes, and build biomemap biomegen->calcBiomeNoise(node_min); - MgStoneType stone_type = generateBiomes(); + MgStoneType stone_type = generateBiomes(water_level - 1); if (flags & MG_CAVES) generateCaves(stone_surface_max_y, large_cave_depth); @@ -199,10 +199,12 @@ void MapgenFlat::makeChunk(BlockMakeData *data) // Generate the registered decorations if (flags & MG_DECORATIONS) - m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max); + m_emerge->decomgr->placeAllDecos(this, blockseed, + node_min, node_max, water_level - 1); // Generate the registered ores - m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max); + m_emerge->oremgr->placeAllOres(this, blockseed, + node_min, node_max, water_level - 1); // Sprinkle some dust on top after everything else was generated dustTopNodes(); |