1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Mgv7: Add option to repeat surface biomes in floatlands

This commit is contained in:
paramat 2017-07-13 21:03:16 +01:00 committed by paramat
parent 49920cfe8d
commit dc9e4517a8
4 changed files with 29 additions and 20 deletions

View file

@ -40,11 +40,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
FlagDesc flagdesc_mapgen_v7[] = {
{"mountains", MGV7_MOUNTAINS},
{"ridges", MGV7_RIDGES},
{"floatlands", MGV7_FLOATLANDS},
{"caverns", MGV7_CAVERNS},
{NULL, 0}
{"mountains", MGV7_MOUNTAINS},
{"ridges", MGV7_RIDGES},
{"floatlands", MGV7_FLOATLANDS},
{"caverns", MGV7_CAVERNS},
{"biomerepeat", MGV7_BIOMEREPEAT},
{NULL, 0}
};
@ -285,6 +286,12 @@ void MapgenV7::makeChunk(BlockMakeData *data)
blockseed = getBlockSeed2(full_node_min, seed);
// Get zero level for biomes and decorations
// Optionally repeat surface biomes in floatlands
s16 biome_zero_level = ((spflags & MGV7_FLOATLANDS) &&
(spflags & MGV7_BIOMEREPEAT) && node_max.Y >= shadow_limit) ?
floatland_level - 1 : water_level - 1;
// Generate base and mountain terrain
// An initial heightmap is no longer created here for use in generateRidgeTerrain()
s16 stone_surface_max_y = generateTerrain();
@ -298,7 +305,7 @@ void MapgenV7::makeChunk(BlockMakeData *data)
// Init biome generator, place biome-specific nodes, and build biomemap
biomegen->calcBiomeNoise(node_min);
MgStoneType stone_type = generateBiomes(water_level - 1);
MgStoneType stone_type = generateBiomes(biome_zero_level);
// Generate caverns, tunnels and classic caves
if (flags & MG_CAVES) {
@ -323,7 +330,7 @@ void MapgenV7::makeChunk(BlockMakeData *data)
// Generate the registered decorations
if (flags & MG_DECORATIONS)
m_emerge->decomgr->placeAllDecos(this, blockseed,
node_min, node_max, water_level - 1);
node_min, node_max, biome_zero_level);
// Generate the registered ores
m_emerge->oremgr->placeAllOres(this, blockseed,