c_gravel = ndef->getId("mapgen_gravel");
c_cobble = ndef->getId("mapgen_cobble");
c_ice = ndef->getId("default:ice");
+ c_desert_stone = ndef->getId("mapgen_desert_stone");
c_mossycobble = ndef->getId("mapgen_mossycobble");
c_sandbrick = ndef->getId("mapgen_sandstonebrick");
c_stair_cobble = ndef->getId("mapgen_stair_cobble");
noise_humidity->result, heightmap, biomemap);
// Actually place the biome-specific nodes
- generateBiomes(noise_heat->result, noise_humidity->result);
+ bool desert_stone = generateBiomes(noise_heat->result, noise_humidity->result);
// Generate caves
if ((flags & MG_CAVES) && (stone_surface_max_y >= node_min.Y))
// Generate dungeons and desert temples
if ((flags & MG_DUNGEONS) && (stone_surface_max_y >= node_min.Y)) {
- DungeonGen dgen(this, NULL);
+ DungeonParams dp;
+
+ dp.np_rarity = nparams_dungeon_rarity;
+ dp.np_density = nparams_dungeon_density;
+ dp.np_wetness = nparams_dungeon_wetness;
+ dp.c_water = c_water_source;
+ if (desert_stone) {
+ dp.c_cobble = c_sandbrick;
+ dp.c_moss = c_sandbrick; // should make this 'cracked sandstone' later
+ dp.c_stair = c_stair_sandstone;
+
+ dp.diagonal_dirs = true;
+ dp.mossratio = 0.0;
+ dp.holesize = v3s16(2, 3, 2);
+ dp.roomsize = v3s16(2, 5, 2);
+ dp.notifytype = GENNOTIFY_TEMPLE;
+ } else {
+ dp.c_cobble = c_cobble;
+ dp.c_moss = c_mossycobble;
+ dp.c_stair = c_stair_cobble;
+
+ dp.diagonal_dirs = false;
+ dp.mossratio = 3.0;
+ dp.holesize = v3s16(1, 2, 1);
+ dp.roomsize = v3s16(0, 0, 0);
+ dp.notifytype = GENNOTIFY_DUNGEON;
+ }
+
+ DungeonGen dgen(this, &dp);
dgen.generate(blockseed, full_node_min, full_node_max);
}
}
-void MapgenV5::generateBiomes(float *heat_map, float *humidity_map)
+bool MapgenV5::generateBiomes(float *heat_map, float *humidity_map)
{
if (node_max.Y < water_level)
- return;
+ return false;
MapNode n_air(CONTENT_AIR);
MapNode n_stone(c_stone);
v3s16 em = vm->m_area.getExtent();
u32 index = 0;
+ bool desert_stone = false;
for (s16 z = node_min.Z; z <= node_max.Z; z++)
for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
y0_top = biome->depth_top;
y0_filler = biome->depth_top + dfiller;
depth_water_top = biome->depth_water_top;
+
+ if (biome->c_stone == c_desert_stone)
+ desert_stone = true;
}
if (c == c_stone && have_air) {
} else if (c == c_water_source) {
have_air = true;
nplaced = 0;
- if(y > water_level - depth_water_top)
+ if (y > water_level - depth_water_top)
vm->m_data[i] = MapNode(biome->c_water_top);
else
vm->m_data[i] = MapNode(biome->c_water);
vm->m_area.add_y(em, i, -1);
}
}
+
+ return desert_stone;
}
int getGroundLevelAtPoint(v2s16 p);
void calculateNoise();
int generateBaseTerrain();
- void generateBiomes(float *heat_map, float *humidity_map);
+ bool generateBiomes(float *heat_map, float *humidity_map);
void generateCaves(int max_stone_y);
void dustTopNodes();
};
c_water_source = ndef->getId("mapgen_water_source");
c_lava_source = ndef->getId("mapgen_lava_source");
c_ice = ndef->getId("default:ice");
+ c_cobble = ndef->getId("mapgen_cobble");
+ c_desert_stone = ndef->getId("mapgen_desert_stone");
+ c_mossycobble = ndef->getId("mapgen_mossycobble");
+ c_sandbrick = ndef->getId("mapgen_sandstonebrick");
+ c_stair_cobble = ndef->getId("mapgen_stair_cobble");
+ c_stair_sandstone = ndef->getId("mapgen_stair_sandstone");
if (c_ice == CONTENT_IGNORE)
c_ice = CONTENT_AIR;
+ if (c_mossycobble == CONTENT_IGNORE)
+ c_mossycobble = c_cobble;
+ if (c_sandbrick == CONTENT_IGNORE)
+ c_sandbrick = c_desert_stone;
+ if (c_stair_cobble == CONTENT_IGNORE)
+ c_stair_cobble = c_cobble;
+ if (c_stair_sandstone == CONTENT_IGNORE)
+ c_stair_sandstone = c_sandbrick;
}
noise_humidity->result, heightmap, biomemap);
// Actually place the biome-specific nodes
- generateBiomes(noise_heat->result, noise_humidity->result);
+ bool desert_stone = generateBiomes(noise_heat->result, noise_humidity->result);
if (flags & MG_CAVES)
generateCaves(stone_surface_max_y);
if ((flags & MG_DUNGEONS) && (stone_surface_max_y >= node_min.Y)) {
- DungeonGen dgen(this, NULL);
+ DungeonParams dp;
+
+ dp.np_rarity = nparams_dungeon_rarity;
+ dp.np_density = nparams_dungeon_density;
+ dp.np_wetness = nparams_dungeon_wetness;
+ dp.c_water = c_water_source;
+ if (desert_stone) {
+ dp.c_cobble = c_sandbrick;
+ dp.c_moss = c_sandbrick; // should make this 'cracked sandstone' later
+ dp.c_stair = c_stair_sandstone;
+
+ dp.diagonal_dirs = true;
+ dp.mossratio = 0.0;
+ dp.holesize = v3s16(2, 3, 2);
+ dp.roomsize = v3s16(2, 5, 2);
+ dp.notifytype = GENNOTIFY_TEMPLE;
+ } else {
+ dp.c_cobble = c_cobble;
+ dp.c_moss = c_mossycobble;
+ dp.c_stair = c_stair_cobble;
+
+ dp.diagonal_dirs = false;
+ dp.mossratio = 3.0;
+ dp.holesize = v3s16(1, 2, 1);
+ dp.roomsize = v3s16(0, 0, 0);
+ dp.notifytype = GENNOTIFY_DUNGEON;
+ }
+
+ DungeonGen dgen(this, &dp);
dgen.generate(blockseed, full_node_min, full_node_max);
}
}
-void MapgenV7::generateBiomes(float *heat_map, float *humidity_map)
+bool MapgenV7::generateBiomes(float *heat_map, float *humidity_map)
{
if (node_max.Y < water_level)
- return;
+ return false;
MapNode n_air(CONTENT_AIR);
MapNode n_stone(c_stone);
v3s16 em = vm->m_area.getExtent();
u32 index = 0;
+ bool desert_stone = false;
for (s16 z = node_min.Z; z <= node_max.Z; z++)
for (s16 x = node_min.X; x <= node_max.X; x++, index++) {
y0_top = biome->depth_top;
y0_filler = biome->depth_top + dfiller;
depth_water_top = biome->depth_water_top;
+
+ if (biome->c_stone == c_desert_stone)
+ desert_stone = true;
}
if (c == c_stone && have_air) {
} else if (c == c_water_source) {
have_air = true;
nplaced = 0;
- if(y > water_level - depth_water_top)
+ if (y > water_level - depth_water_top)
vm->m_data[i] = MapNode(biome->c_water_top);
else
vm->m_data[i] = MapNode(biome->c_water);
vm->m_area.add_y(em, i, -1);
}
}
+
+ return desert_stone;
}
content_t c_cobble;
content_t c_desert_sand;
content_t c_desert_stone;
+ content_t c_mossycobble;
+ content_t c_sandbrick;
+ content_t c_stair_cobble;
+ content_t c_stair_sandstone;
MapgenV7(int mapgenid, MapgenParams *params, EmergeManager *emerge);
~MapgenV7();
int generateMountainTerrain(int ymax);
void generateRidgeTerrain();
- void generateBiomes(float *heat_map, float *humidity_map);
+ bool generateBiomes(float *heat_map, float *humidity_map);
void dustTopNodes();
//void addTopNodes();