Minetest  5.4.0
MapgenV6 Class Reference

#include <mapgen_v6.h>

+ Inheritance diagram for MapgenV6:
+ Collaboration diagram for MapgenV6:

Public Member Functions

 MapgenV6 (MapgenV6Params *params, EmergeParams *emerge)
 
 ~MapgenV6 ()
 
virtual MapgenType getType () const
 
void makeChunk (BlockMakeData *data)
 
int getGroundLevelAtPoint (v2s16 p)
 
int getSpawnLevelAtPoint (v2s16 p)
 
float baseTerrainLevel (float terrain_base, float terrain_higher, float steepness, float height_select)
 
virtual float baseTerrainLevelFromNoise (v2s16 p)
 
virtual float baseTerrainLevelFromMap (v2s16 p)
 
virtual float baseTerrainLevelFromMap (int index)
 
s16 find_stone_level (v2s16 p2d)
 
bool block_is_underground (u64 seed, v3s16 blockpos)
 
float getHumidity (v2s16 p)
 
float getTreeAmount (v2s16 p)
 
bool getHaveAppleTree (v2s16 p)
 
float getMudAmount (v2s16 p)
 
virtual float getMudAmount (int index)
 
bool getHaveBeach (v2s16 p)
 
bool getHaveBeach (int index)
 
BiomeV6Type getBiome (v2s16 p)
 
BiomeV6Type getBiome (int index, v2s16 p)
 
u32 get_blockseed (u64 seed, v3s16 p)
 
virtual void calculateNoise ()
 
int generateGround ()
 
void addMud ()
 
void flowMud (s16 &mudflow_minpos, s16 &mudflow_maxpos)
 
void moveMud (u32 remove_index, u32 place_index, u32 above_remove_index, v2s16 pos, v3s16 em)
 
void growGrass ()
 
void placeTreesAndJungleGrass ()
 
virtual void generateCaves (int max_stone_y)
 
- Public Member Functions inherited from Mapgen
 Mapgen ()=default
 
 Mapgen (int mapgenid, MapgenParams *params, EmergeParams *emerge)
 
virtual ~Mapgen ()=default
 
 DISABLE_CLASS_COPY (Mapgen)
 
s16 findGroundLevel (v2s16 p2d, s16 ymin, s16 ymax)
 
s16 findLiquidSurface (v2s16 p2d, s16 ymin, s16 ymax)
 
void updateHeightmap (v3s16 nmin, v3s16 nmax)
 
void getSurfaces (v2s16 p2d, s16 ymin, s16 ymax, std::vector< s16 > &floors, std::vector< s16 > &ceilings)
 
void updateLiquid (UniqueQueue< v3s16 > *trans_liquid, v3s16 nmin, v3s16 nmax)
 
void setLighting (u8 light, v3s16 nmin, v3s16 nmax)
 
void lightSpread (VoxelArea &a, std::queue< std::pair< v3s16, u8 >> &queue, const v3s16 &p, u8 light)
 
void calcLighting (v3s16 nmin, v3s16 nmax, v3s16 full_nmin, v3s16 full_nmax, bool propagate_shadow=true)
 
void propagateSunlight (v3s16 nmin, v3s16 nmax, bool propagate_shadow)
 
void spreadLight (const v3s16 &nmin, const v3s16 &nmax)
 

Public Attributes

EmergeParamsm_emerge
 
int ystride
 
u32 spflags
 
v3s16 node_min
 
v3s16 node_max
 
v3s16 full_node_min
 
v3s16 full_node_max
 
v3s16 central_area_size
 
Noisenoise_terrain_base
 
Noisenoise_terrain_higher
 
Noisenoise_steepness
 
Noisenoise_height_select
 
Noisenoise_mud
 
Noisenoise_beach
 
Noisenoise_biome
 
Noisenoise_humidity
 
NoiseParamsnp_cave
 
NoiseParamsnp_humidity
 
NoiseParamsnp_trees
 
NoiseParamsnp_apple_trees
 
NoiseParams np_dungeons
 
float freq_desert
 
float freq_beach
 
s16 dungeon_ymin
 
s16 dungeon_ymax
 
content_t c_stone
 
content_t c_dirt
 
content_t c_dirt_with_grass
 
content_t c_sand
 
content_t c_water_source
 
content_t c_lava_source
 
content_t c_gravel
 
content_t c_desert_stone
 
content_t c_desert_sand
 
content_t c_dirt_with_snow
 
content_t c_snow
 
content_t c_snowblock
 
content_t c_ice
 
content_t c_cobble
 
content_t c_mossycobble
 
content_t c_stair_cobble
 
content_t c_stair_desert_stone
 
- Public Attributes inherited from Mapgen
s32 seed = 0
 
int water_level = 0
 
int mapgen_limit = 0
 
u32 flags = 0
 
bool generating = false
 
int id = -1
 
MMVManipvm = nullptr
 
const NodeDefManagerndef = nullptr
 
u32 blockseed
 
s16 * heightmap = nullptr
 
biome_tbiomemap = nullptr
 
v3s16 csize
 
BiomeGenbiomegen = nullptr
 
GenerateNotifier gennotify
 

Additional Inherited Members

- Static Public Member Functions inherited from Mapgen
static u32 getBlockSeed (v3s16 p, s32 seed)
 
static u32 getBlockSeed2 (v3s16 p, s32 seed)
 
static MapgenType getMapgenType (const std::string &mgname)
 
static const char * getMapgenName (MapgenType mgtype)
 
static MapgencreateMapgen (MapgenType mgtype, MapgenParams *params, EmergeParams *emerge)
 
static MapgenParamscreateMapgenParams (MapgenType mgtype)
 
static void getMapgenNames (std::vector< const char * > *mgnames, bool include_hidden)
 
static void setDefaultSettings (Settings *settings)
 

Constructor & Destructor Documentation

◆ MapgenV6()

◆ ~MapgenV6()

Member Function Documentation

◆ addMud()

void MapgenV6::addMud ( )

References VoxelArea::add_y(), BT_DESERT, BT_TUNDRA, c_desert_sand, c_dirt, c_gravel, c_sand, find_stone_level(), getBiome(), VoxelArea::getExtent(), getHaveBeach(), getMudAmount(), VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelArea::MinEdge, MYMAX, node_max, node_min, Mapgen::vm, and Mapgen::water_level.

Referenced by makeChunk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ baseTerrainLevel()

float MapgenV6::baseTerrainLevel ( float  terrain_base,
float  terrain_higher,
float  steepness,
float  height_select 
)

References rangelim.

Referenced by baseTerrainLevelFromMap(), and baseTerrainLevelFromNoise().

+ Here is the caller graph for this function:

◆ baseTerrainLevelFromMap() [1/2]

float MapgenV6::baseTerrainLevelFromMap ( int  index)
virtual

References baseTerrainLevel(), MGV6_FLAT, noise_height_select, noise_steepness, noise_terrain_base, noise_terrain_higher, Noise::result, spflags, and Mapgen::water_level.

+ Here is the call graph for this function:

◆ baseTerrainLevelFromMap() [2/2]

float MapgenV6::baseTerrainLevelFromMap ( v2s16  p)
virtual

References node_min, p(), and ystride.

Referenced by generateGround().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ baseTerrainLevelFromNoise()

float MapgenV6::baseTerrainLevelFromNoise ( v2s16  p)
virtual

References baseTerrainLevel(), MGV6_FLAT, noise_height_select, noise_steepness, noise_terrain_base, noise_terrain_higher, NoisePerlin2D_PO(), Noise::np, p(), Mapgen::seed, spflags, and Mapgen::water_level.

Referenced by getGroundLevelAtPoint(), and getSpawnLevelAtPoint().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ block_is_underground()

bool MapgenV6::block_is_underground ( u64  seed,
v3s16  blockpos 
)

◆ calculateNoise()

void MapgenV6::calculateNoise ( )
virtual

References full_node_min, MGV6_FLAT, node_min, noise_beach, noise_biome, noise_height_select, noise_humidity, noise_mud, noise_steepness, noise_terrain_base, noise_terrain_higher, Noise::perlinMap2D_PO(), and spflags.

Referenced by makeChunk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_stone_level()

s16 MapgenV6::find_stone_level ( v2s16  p2d)

References VoxelArea::add_y(), c_desert_stone, c_stone, CONTENT_IGNORE, MapNode::getContent(), VoxelArea::getExtent(), VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelArea::MaxEdge, VoxelArea::MinEdge, and Mapgen::vm.

Referenced by addMud().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowMud()

void MapgenV6::flowMud ( s16 &  mudflow_minpos,
s16 &  mudflow_maxpos 
)

References VoxelArea::add_p(), VoxelArea::add_y(), c_dirt, c_dirt_with_grass, c_gravel, CONTENT_IGNORE, NodeDefManager::get(), MapNode::getContent(), VoxelArea::getExtent(), VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, moveMud(), Mapgen::ndef, node_max, node_min, MapNode::setContent(), Mapgen::vm, and ContentFeatures::walkable.

Referenced by makeChunk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateCaves()

void MapgenV6::generateCaves ( int  max_stone_y)
virtual

References Mapgen::blockseed, BT_DESERT, c_lava_source, c_water_source, Mapgen::gennotify, getBiome(), Mapgen::heightmap, CavesV6::makeCave(), MAP_BLOCKSIZE, MYMAX, Mapgen::ndef, node_max, node_min, NoisePerlin2D(), np_cave, PseudoRandom::range(), Mapgen::seed, Mapgen::vm, and Mapgen::water_level.

Referenced by makeChunk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateGround()

int MapgenV6::generateGround ( )

References VoxelArea::add_y(), baseTerrainLevelFromMap(), BT_DESERT, BT_TUNDRA, c_desert_stone, c_ice, c_stone, c_water_source, CONTENT_AIR, CONTENT_IGNORE, getBiome(), MapNode::getContent(), VoxelArea::getExtent(), VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, MAX_MAP_GENERATION_LIMIT, MGV6_DESERT_STONE_BASE, MGV6_ICE_BASE, node_max, node_min, Mapgen::vm, and Mapgen::water_level.

Referenced by makeChunk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_blockseed()

u32 MapgenV6::get_blockseed ( u64  seed,
v3s16  p 
)

References p(), and Mapgen::seed.

Referenced by makeChunk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBiome() [1/2]

BiomeV6Type MapgenV6::getBiome ( int  index,
v2s16  p 
)

References BT_DESERT, BT_JUNGLE, BT_NORMAL, BT_TAIGA, BT_TUNDRA, freq_desert, MGV6_BIOMEBLEND, MGV6_FREQ_HOT, MGV6_FREQ_JUNGLE, MGV6_FREQ_SNOW, MGV6_FREQ_TAIGA, MGV6_JUNGLES, MGV6_SNOWBIOMES, noise2d(), noise_biome, noise_humidity, p(), Noise::result, Mapgen::seed, and spflags.

+ Here is the call graph for this function:

◆ getBiome() [2/2]

BiomeV6Type MapgenV6::getBiome ( v2s16  p)

References full_node_min, MAP_BLOCKSIZE, p(), and ystride.

Referenced by addMud(), generateCaves(), generateGround(), growGrass(), makeChunk(), and placeTreesAndJungleGrass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGroundLevelAtPoint()

int MapgenV6::getGroundLevelAtPoint ( v2s16  p)
virtual

Reimplemented from Mapgen.

References baseTerrainLevelFromNoise(), MGV6_AVERAGE_MUD_AMOUNT, and p().

+ Here is the call graph for this function:

◆ getHaveAppleTree()

bool MapgenV6::getHaveAppleTree ( v2s16  p)

References NoisePerlin2D(), np_apple_trees, p(), and Mapgen::seed.

Referenced by placeTreesAndJungleGrass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHaveBeach() [1/2]

bool MapgenV6::getHaveBeach ( int  index)

◆ getHaveBeach() [2/2]

bool MapgenV6::getHaveBeach ( v2s16  p)

References node_min, p(), and ystride.

Referenced by addMud().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHumidity()

float MapgenV6::getHumidity ( v2s16  p)

References full_node_min, MAP_BLOCKSIZE, noise_humidity, p(), Noise::result, and ystride.

Referenced by placeTreesAndJungleGrass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMudAmount() [1/2]

float MapgenV6::getMudAmount ( int  index)
virtual

◆ getMudAmount() [2/2]

float MapgenV6::getMudAmount ( v2s16  p)

References node_min, p(), and ystride.

Referenced by addMud().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSpawnLevelAtPoint()

int MapgenV6::getSpawnLevelAtPoint ( v2s16  p)
virtual

Reimplemented from Mapgen.

References baseTerrainLevelFromNoise(), MAX_MAP_GENERATION_LIMIT, MGV6_AVERAGE_MUD_AMOUNT, p(), and Mapgen::water_level.

+ Here is the call graph for this function:

◆ getTreeAmount()

float MapgenV6::getTreeAmount ( v2s16  p)

References NoisePerlin2D(), np_trees, p(), and Mapgen::seed.

Referenced by placeTreesAndJungleGrass().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

virtual MapgenType MapgenV6::getType ( ) const
inlinevirtual

Reimplemented from Mapgen.

References MAPGEN_V6.

◆ growGrass()

void MapgenV6::growGrass ( )

References VoxelArea::add_y(), BT_TAIGA, BT_TUNDRA, c_dirt, c_dirt_with_grass, c_dirt_with_snow, c_ice, c_snowblock, c_stone, CPT_LIGHT, full_node_max, full_node_min, NodeDefManager::get(), getBiome(), MapNode::getContent(), VoxelArea::getExtent(), VoxelArea::index(), LIQUID_NONE, ContentFeatures::liquid_type, VoxelManipulator::m_area, VoxelManipulator::m_data, Mapgen::ndef, node_max, ContentFeatures::param_type, Mapgen::vm, and Mapgen::water_level.

Referenced by makeChunk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeChunk()

void MapgenV6::makeChunk ( BlockMakeData data)
virtual

Reimplemented from Mapgen.

References addMud(), BlockMakeData::blockpos_max, BlockMakeData::blockpos_min, Mapgen::blockseed, BT_DESERT, DungeonParams::c_alt_wall, c_cobble, c_desert_stone, c_mossycobble, DungeonParams::c_stair, c_stair_cobble, c_stair_desert_stone, DungeonParams::c_wall, Mapgen::calcLighting(), calculateNoise(), central_area_size, CONTENT_IGNORE, DungeonParams::corridor_len_max, DungeonParams::corridor_len_min, EmergeParams::decomgr, DungeonParams::diagonal_dirs, dungeon_ymax, dungeon_ymin, Mapgen::flags, flowMud(), full_node_max, full_node_min, DungeonGen::generate(), generateCaves(), generateGround(), Mapgen::generating, Mapgen::gennotify, GENNOTIFY_DUNGEON, GENNOTIFY_TEMPLE, get_blockseed(), getBiome(), growGrass(), DungeonParams::holesize, DungeonParams::large_room_chance, m_emerge, MAP_BLOCKSIZE, MG_CAVES, MG_DECORATIONS, MG_DUNGEONS, MG_LIGHT, MG_ORES, MGV6_MUDFLOW, MGV6_TREES, Mapgen::ndef, node_max, node_min, BlockMakeData::nodedef, NoisePerlin3D(), DungeonParams::notifytype, DungeonParams::np_alt_wall, np_dungeons, DungeonParams::num_dungeons, DungeonParams::num_rooms, DungeonParams::only_in_ground, EmergeParams::oremgr, DecorationManager::placeAllDecos(), OreManager::placeAllOres(), placeTreesAndJungleGrass(), PseudoRandom::range(), DungeonParams::room_size_large_max, DungeonParams::room_size_large_min, DungeonParams::room_size_max, DungeonParams::room_size_min, BlockMakeData::seed, DungeonParams::seed, Mapgen::seed, spflags, BlockMakeData::transforming_liquid, Mapgen::updateHeightmap(), Mapgen::updateLiquid(), Mapgen::vm, and BlockMakeData::vmanip.

+ Here is the call graph for this function:

◆ moveMud()

void MapgenV6::moveMud ( u32  remove_index,
u32  place_index,
u32  above_remove_index,
v2s16  pos,
v3s16  em 
)

References VoxelArea::add_y(), c_water_source, VoxelArea::contains(), CONTENT_AIR, CONTENT_IGNORE, MapNode::getContent(), VoxelManipulator::m_area, VoxelManipulator::m_data, node_max, node_min, and Mapgen::vm.

Referenced by flowMud().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ placeTreesAndJungleGrass()

void MapgenV6::placeTreesAndJungleGrass ( )

References VoxelArea::add_y(), Mapgen::blockseed, BT_JUNGLE, BT_NORMAL, BT_TAIGA, c_dirt, c_dirt_with_grass, c_dirt_with_snow, central_area_size, CONTENT_AIR, CONTENT_IGNORE, getBiome(), MapNode::getContent(), VoxelArea::getExtent(), getHaveAppleTree(), getHumidity(), NodeDefManager::getId(), getTreeAmount(), Mapgen::heightmap, VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, treegen::make_jungletree(), treegen::make_pine_tree(), treegen::make_tree(), myrand(), myrand_range(), Mapgen::ndef, node_max, node_min, p(), PseudoRandom::range(), Mapgen::vm, and Mapgen::water_level.

Referenced by makeChunk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ c_cobble

content_t MapgenV6::c_cobble

Referenced by MapgenV6(), and makeChunk().

◆ c_desert_sand

content_t MapgenV6::c_desert_sand

Referenced by MapgenV6(), and addMud().

◆ c_desert_stone

content_t MapgenV6::c_desert_stone

◆ c_dirt

◆ c_dirt_with_grass

content_t MapgenV6::c_dirt_with_grass

◆ c_dirt_with_snow

content_t MapgenV6::c_dirt_with_snow

◆ c_gravel

content_t MapgenV6::c_gravel

Referenced by MapgenV6(), addMud(), and flowMud().

◆ c_ice

content_t MapgenV6::c_ice

Referenced by MapgenV6(), generateGround(), and growGrass().

◆ c_lava_source

content_t MapgenV6::c_lava_source

Referenced by MapgenV6(), and generateCaves().

◆ c_mossycobble

content_t MapgenV6::c_mossycobble

Referenced by MapgenV6(), and makeChunk().

◆ c_sand

content_t MapgenV6::c_sand

Referenced by MapgenV6(), and addMud().

◆ c_snow

content_t MapgenV6::c_snow

Referenced by MapgenV6().

◆ c_snowblock

content_t MapgenV6::c_snowblock

Referenced by MapgenV6(), and growGrass().

◆ c_stair_cobble

content_t MapgenV6::c_stair_cobble

Referenced by MapgenV6(), and makeChunk().

◆ c_stair_desert_stone

content_t MapgenV6::c_stair_desert_stone

Referenced by MapgenV6(), and makeChunk().

◆ c_stone

content_t MapgenV6::c_stone

◆ c_water_source

content_t MapgenV6::c_water_source

◆ central_area_size

v3s16 MapgenV6::central_area_size

◆ dungeon_ymax

s16 MapgenV6::dungeon_ymax

Referenced by MapgenV6(), and makeChunk().

◆ dungeon_ymin

s16 MapgenV6::dungeon_ymin

Referenced by MapgenV6(), and makeChunk().

◆ freq_beach

float MapgenV6::freq_beach

Referenced by MapgenV6(), and getHaveBeach().

◆ freq_desert

float MapgenV6::freq_desert

Referenced by MapgenV6(), and getBiome().

◆ full_node_max

v3s16 MapgenV6::full_node_max

Referenced by growGrass(), and makeChunk().

◆ full_node_min

v3s16 MapgenV6::full_node_min

◆ m_emerge

EmergeParams* MapgenV6::m_emerge

Referenced by MapgenV6(), ~MapgenV6(), and makeChunk().

◆ node_max

◆ node_min

◆ noise_beach

Noise* MapgenV6::noise_beach

◆ noise_biome

Noise* MapgenV6::noise_biome

◆ noise_height_select

◆ noise_humidity

Noise* MapgenV6::noise_humidity

◆ noise_mud

Noise* MapgenV6::noise_mud

◆ noise_steepness

◆ noise_terrain_base

◆ noise_terrain_higher

◆ np_apple_trees

NoiseParams* MapgenV6::np_apple_trees

Referenced by MapgenV6(), and getHaveAppleTree().

◆ np_cave

NoiseParams* MapgenV6::np_cave

Referenced by MapgenV6(), and generateCaves().

◆ np_dungeons

NoiseParams MapgenV6::np_dungeons

Referenced by MapgenV6(), and makeChunk().

◆ np_humidity

NoiseParams* MapgenV6::np_humidity

Referenced by MapgenV6().

◆ np_trees

NoiseParams* MapgenV6::np_trees

Referenced by MapgenV6(), and getTreeAmount().

◆ spflags

◆ ystride


The documentation for this class was generated from the following files: