#include "dungeongen.h"
#include "cavegen.h"
#include "treegen.h"
-#include "biome.h"
+#include "mg_biome.h"
+#include "mg_ore.h"
+#include "mg_decoration.h"
#include "mapgen_v7.h"
FlagDesc flagdesc_mapgen_v7[] = {
- {"v7_mountains", MGV7_MOUNTAINS},
- {"v7_ridges", MGV7_RIDGES},
- {NULL, 0}
+ {"mountains", MGV7_MOUNTAINS},
+ {"ridges", MGV7_RIDGES},
+ {NULL, 0}
};
///////////////////////////////////////////////////////////////////////////////
this->emerge = emerge;
this->bmgr = emerge->biomedef;
- this->seed = (int)params->seed;
+ this->seed = (int)params->seed;
this->water_level = params->water_level;
- this->flags = params->flags | MGV7_MOUNTAINS | MGV7_RIDGES;
- this->gennotify = emerge->gennotify;
+ this->flags = params->flags;
+ this->gennotify = emerge->gennotify;
this->csize = v3s16(1, 1, 1) * params->chunksize * MAP_BLOCKSIZE;
- // amount of elements to skip for the next index
- // for noise/height/biome maps (not vmanip)
+ //// amount of elements to skip for the next index
+ //// for noise/height/biome maps (not vmanip)
this->ystride = csize.X;
this->zstride = csize.X * csize.Y;
MapgenV7Params *sp = (MapgenV7Params *)params->sparams;
- // Terrain noise
+ //// Terrain noise
noise_terrain_base = new Noise(&sp->np_terrain_base, seed, csize.X, csize.Z);
noise_terrain_alt = new Noise(&sp->np_terrain_alt, seed, csize.X, csize.Z);
noise_terrain_persist = new Noise(&sp->np_terrain_persist, seed, csize.X, csize.Z);
noise_mount_height = new Noise(&sp->np_mount_height, seed, csize.X, csize.Z);
noise_ridge_uwater = new Noise(&sp->np_ridge_uwater, seed, csize.X, csize.Z);
- // 3d terrain noise
+ //// 3d terrain noise
noise_mountain = new Noise(&sp->np_mountain, seed, csize.X, csize.Y, csize.Z);
noise_ridge = new Noise(&sp->np_ridge, seed, csize.X, csize.Y, csize.Z);
- // Biome noise
+ //// Biome noise
noise_heat = new Noise(bmgr->np_heat, seed, csize.X, csize.Z);
- noise_humidity = new Noise(bmgr->np_humidity, seed, csize.X, csize.Z);
+ noise_humidity = new Noise(bmgr->np_humidity, seed, csize.X, csize.Z);
+
+ //// Resolve nodes to be used
+ INodeDefManager *ndef = emerge->ndef;
+
+ c_stone = ndef->getId("mapgen_stone");
+ c_dirt = ndef->getId("mapgen_dirt");
+ c_dirt_with_grass = ndef->getId("mapgen_dirt_with_grass");
+ c_sand = ndef->getId("mapgen_sand");
+ c_water_source = ndef->getId("mapgen_water_source");
+ c_lava_source = ndef->getId("mapgen_lava_source");
+ c_ice = ndef->getId("default:ice");
+ if (c_ice == CONTENT_IGNORE)
+ c_ice = CONTENT_AIR;
}
void MapgenV7Params::writeParams(Settings *settings) {
- settings->setFlagStr("mgv7_spflags", spflags, flagdesc_mapgen_v7);
+ settings->setFlagStr("mgv7_spflags", spflags, flagdesc_mapgen_v7, (u32)-1);
settings->setNoiseParams("mgv7_np_terrain_base", np_terrain_base);
settings->setNoiseParams("mgv7_np_terrain_alt", np_terrain_alt);
blockseed = emerge->getBlockSeed(full_node_min); //////use getBlockSeed2()!
- c_stone = ndef->getId("mapgen_stone");
- c_dirt = ndef->getId("mapgen_dirt");
- c_dirt_with_grass = ndef->getId("mapgen_dirt_with_grass");
- c_sand = ndef->getId("mapgen_sand");
- c_water_source = ndef->getId("mapgen_water_source");
- c_lava_source = ndef->getId("mapgen_lava_source");
- c_ice = ndef->getId("default:ice");
- if (c_ice == CONTENT_IGNORE)
- c_ice = CONTENT_AIR;
-
// Make some noise
calculateNoise();
updateLiquid(&data->transforming_liquid, full_node_min, full_node_max);
- if (!(flags & MG_NOLIGHT))
+ if (flags & MG_LIGHT)
calcLighting(node_min - v3s16(1, 0, 1) * MAP_BLOCKSIZE,
node_max + v3s16(1, 0, 1) * MAP_BLOCKSIZE);
//setLighting(node_min - v3s16(1, 0, 1) * MAP_BLOCKSIZE,