1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Mapgen flags: Add 'biomes' global mapgen flag (#7355)

Previously the only way to disable biomes was to 'clear' the registered
biomes in a mod, but this method causes large amounts of unnecessary
processing:
1. Calculation of 4 2D noises.
2. Looping through all nodes of a mapchunk replacing nodes with identical
nodes.
The new flag disables those operations.
This commit is contained in:
Paramat 2018-06-08 23:24:36 +01:00 committed by GitHub
parent 9ca37d86a3
commit 0b23253447
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 44 additions and 20 deletions

View file

@ -326,8 +326,10 @@ void MapgenV7::makeChunk(BlockMakeData *data)
updateHeightmap(node_min, node_max);
// Init biome generator, place biome-specific nodes, and build biomemap
biomegen->calcBiomeNoise(node_min);
generateBiomes();
if (flags & MG_BIOMES) {
biomegen->calcBiomeNoise(node_min);
generateBiomes();
}
// Generate tunnels, caverns and large randomwalk caves
if (flags & MG_CAVES) {
@ -363,7 +365,8 @@ void MapgenV7::makeChunk(BlockMakeData *data)
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Sprinkle some dust on top after everything else was generated
dustTopNodes();
if (flags & MG_BIOMES)
dustTopNodes();
// Update liquids
updateLiquid(&data->transforming_liquid, full_node_min, full_node_max);