From 746ca41f58e356b0fbeeca1b43b7061ad1e1c02d Mon Sep 17 00:00:00 2001 From: Paramat Date: Sat, 7 Apr 2018 22:09:54 +0100 Subject: Biome API / dungeons: Add biome-defined dungeon nodes Add new biome fields 'node_dungeon', 'node_dungeon_alt', 'node_dungeon_stair'. If 'node_dungeon' is not defined dungeons fall back to classic behaviour. Remove messy and imprecise dungeon material code from 'generateBiomes()'. Code deciding dungeon materials is now in 'generateDungeons()' and uses the biome at mapchunk centre for more precision. Remove hardcoded 'MG_STONE' types as long intended. --- src/mapgen/mapgen_flat.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/mapgen/mapgen_flat.cpp') diff --git a/src/mapgen/mapgen_flat.cpp b/src/mapgen/mapgen_flat.cpp index 57d358e86..60b30137b 100644 --- a/src/mapgen/mapgen_flat.cpp +++ b/src/mapgen/mapgen_flat.cpp @@ -196,17 +196,14 @@ void MapgenFlat::makeChunk(BlockMakeData *data) // Init biome generator, place biome-specific nodes, and build biomemap biomegen->calcBiomeNoise(node_min); - - MgStoneType mgstone_type; - content_t biome_stone; - generateBiomes(&mgstone_type, &biome_stone); + generateBiomes(); if (flags & MG_CAVES) generateCaves(stone_surface_max_y, large_cave_depth); if ((flags & MG_DUNGEONS) && full_node_min.Y >= dungeon_ymin && full_node_max.Y <= dungeon_ymax) - generateDungeons(stone_surface_max_y, mgstone_type, biome_stone); + generateDungeons(stone_surface_max_y); // Generate the registered decorations if (flags & MG_DECORATIONS) -- cgit v1.2.3