From 8299e4b67eff48e0f6e101afea2fae8f0e65c421 Mon Sep 17 00:00:00 2001 From: paramat Date: Wed, 14 Jun 2017 02:00:51 +0100 Subject: 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. --- src/mapgen_fractal.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mapgen_fractal.cpp') diff --git a/src/mapgen_fractal.cpp b/src/mapgen_fractal.cpp index 4fe0d8369..13da2f180 100644 --- a/src/mapgen_fractal.cpp +++ b/src/mapgen_fractal.cpp @@ -199,7 +199,7 @@ void MapgenFractal::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); @@ -209,10 +209,12 @@ void MapgenFractal::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(); -- cgit v1.2.3