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.
# In Mapgen v6 the 'decorations' flag controls all decorations except trees
# 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]

@ -58,6 +58,7 @@ FlagDesc flagdesc_mapgen[] = {
{"light", MG_LIGHT},
{"decorations", MG_DECORATIONS},
{"biomes", MG_BIOMES},
{"ores", MG_ORES},
{NULL, 0}
};
@ -217,7 +218,7 @@ void Mapgen::getMapgenNames(std::vector<const char *> *mgnames, bool include_hid
void Mapgen::setDefaultSettings(Settings *settings)
{
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) {
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_DECORATIONS 0x20
#define MG_BIOMES 0x40
#define MG_ORES 0x80
typedef u16 biome_t; // copy from mg_biome.h to avoid an unnecessary include

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

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

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

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

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

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

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