mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01:00
Add 'ores' global mapgen flag (#10276)
This commit is contained in:
parent
74e22b72e1
commit
4ba5046308
@ -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,7 +315,8 @@ void MapgenCarpathian::makeChunk(BlockMakeData *data)
|
||||
}
|
||||
|
||||
// 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
|
||||
if (flags & MG_DUNGEONS)
|
||||
|
@ -264,7 +264,8 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
|
||||
}
|
||||
|
||||
// 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)
|
||||
generateDungeons(stone_surface_max_y);
|
||||
|
@ -250,7 +250,8 @@ void MapgenFractal::makeChunk(BlockMakeData *data)
|
||||
}
|
||||
|
||||
// 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
|
||||
if (flags & MG_DUNGEONS)
|
||||
|
@ -257,7 +257,8 @@ void MapgenV5::makeChunk(BlockMakeData *data)
|
||||
}
|
||||
|
||||
// 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
|
||||
if (flags & MG_DUNGEONS)
|
||||
|
@ -652,7 +652,8 @@ void MapgenV6::makeChunk(BlockMakeData *data)
|
||||
m_emerge->decomgr->placeAllDecos(this, blockseed, node_min, node_max);
|
||||
|
||||
// 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
|
||||
if (flags & MG_LIGHT)
|
||||
|
@ -377,7 +377,8 @@ void MapgenV7::makeChunk(BlockMakeData *data)
|
||||
}
|
||||
|
||||
// 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
|
||||
if (flags & MG_DUNGEONS)
|
||||
|
@ -268,7 +268,8 @@ void MapgenValleys::makeChunk(BlockMakeData *data)
|
||||
}
|
||||
|
||||
// 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
|
||||
if (flags & MG_DUNGEONS)
|
||||
|
Loading…
Reference in New Issue
Block a user