Add 'ores' global mapgen flag (#10276)

This commit is contained in:
Paramat 2020-09-03 01:28:40 +01:00 committed by GitHub
parent 74e22b72e1
commit 4ba5046308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 18 additions and 9 deletions

@ -1475,7 +1475,7 @@ mapgen_limit (Map generation limit) int 31000 0 31000
# Global map generation attributes. # Global map generation attributes.
# In Mapgen v6 the 'decorations' flag controls all decorations except trees # In Mapgen v6 the 'decorations' flag controls all decorations except trees
# and junglegrass, in all other mapgens this flag controls all decorations. # and junglegrass, in all other mapgens this flag controls all decorations.
mg_flags (Mapgen flags) flags caves,dungeons,light,decorations,biomes caves,dungeons,light,decorations,biomes,nocaves,nodungeons,nolight,nodecorations,nobiomes mg_flags (Mapgen flags) flags caves,dungeons,light,decorations,biomes,ores caves,dungeons,light,decorations,biomes,ores,nocaves,nodungeons,nolight,nodecorations,nobiomes,noores
[*Biome API temperature and humidity noise parameters] [*Biome API temperature and humidity noise parameters]

@ -58,6 +58,7 @@ FlagDesc flagdesc_mapgen[] = {
{"light", MG_LIGHT}, {"light", MG_LIGHT},
{"decorations", MG_DECORATIONS}, {"decorations", MG_DECORATIONS},
{"biomes", MG_BIOMES}, {"biomes", MG_BIOMES},
{"ores", MG_ORES},
{NULL, 0} {NULL, 0}
}; };
@ -217,7 +218,7 @@ void Mapgen::getMapgenNames(std::vector<const char *> *mgnames, bool include_hid
void Mapgen::setDefaultSettings(Settings *settings) void Mapgen::setDefaultSettings(Settings *settings)
{ {
settings->setDefault("mg_flags", flagdesc_mapgen, settings->setDefault("mg_flags", flagdesc_mapgen,
MG_CAVES | MG_DUNGEONS | MG_LIGHT | MG_DECORATIONS | MG_BIOMES); MG_CAVES | MG_DUNGEONS | MG_LIGHT | MG_DECORATIONS | MG_BIOMES | MG_ORES);
for (int i = 0; i < (int)MAPGEN_INVALID; ++i) { for (int i = 0; i < (int)MAPGEN_INVALID; ++i) {
MapgenParams *params = createMapgenParams((MapgenType)i); MapgenParams *params = createMapgenParams((MapgenType)i);

@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define MG_LIGHT 0x10 #define MG_LIGHT 0x10
#define MG_DECORATIONS 0x20 #define MG_DECORATIONS 0x20
#define MG_BIOMES 0x40 #define MG_BIOMES 0x40
#define MG_ORES 0x80
typedef u16 biome_t; // copy from mg_biome.h to avoid an unnecessary include typedef u16 biome_t; // copy from mg_biome.h to avoid an unnecessary include

@ -315,7 +315,8 @@ void MapgenCarpathian::makeChunk(BlockMakeData *data)
} }
// Generate the registered ores // Generate the registered ores
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max); if (flags & MG_ORES)
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons // Generate dungeons
if (flags & MG_DUNGEONS) if (flags & MG_DUNGEONS)

@ -264,7 +264,8 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
} }
// Generate the registered ores // Generate the registered ores
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max); if (flags & MG_ORES)
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
if (flags & MG_DUNGEONS) if (flags & MG_DUNGEONS)
generateDungeons(stone_surface_max_y); generateDungeons(stone_surface_max_y);

@ -250,7 +250,8 @@ void MapgenFractal::makeChunk(BlockMakeData *data)
} }
// Generate the registered ores // Generate the registered ores
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max); if (flags & MG_ORES)
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons // Generate dungeons
if (flags & MG_DUNGEONS) if (flags & MG_DUNGEONS)

@ -257,7 +257,8 @@ void MapgenV5::makeChunk(BlockMakeData *data)
} }
// Generate the registered ores // Generate the registered ores
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max); if (flags & MG_ORES)
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons and desert temples // Generate dungeons and desert temples
if (flags & MG_DUNGEONS) if (flags & MG_DUNGEONS)

@ -652,7 +652,8 @@ void MapgenV6::makeChunk(BlockMakeData *data)
m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max); m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
// Generate the registered ores // Generate the registered ores
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max); if (flags & MG_ORES)
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Calculate lighting // Calculate lighting
if (flags & MG_LIGHT) if (flags & MG_LIGHT)

@ -377,7 +377,8 @@ void MapgenV7::makeChunk(BlockMakeData *data)
} }
// Generate the registered ores // Generate the registered ores
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max); if (flags & MG_ORES)
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons // Generate dungeons
if (flags & MG_DUNGEONS) if (flags & MG_DUNGEONS)

@ -268,7 +268,8 @@ void MapgenValleys::makeChunk(BlockMakeData *data)
} }
// Generate the registered ores // Generate the registered ores
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max); if (flags & MG_ORES)
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Dungeon creation // Dungeon creation
if (flags & MG_DUNGEONS) if (flags & MG_DUNGEONS)