Minetest  5.4.0
Mapgen Class Reference

#include <mapgen.h>

+ Inheritance diagram for Mapgen:
+ Collaboration diagram for Mapgen:

Public Member Functions

 Mapgen ()=default
 
 Mapgen (int mapgenid, MapgenParams *params, EmergeParams *emerge)
 
virtual ~Mapgen ()=default
 
 DISABLE_CLASS_COPY (Mapgen)
 
virtual MapgenType getType () const
 
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)
 
virtual void makeChunk (BlockMakeData *data)
 
virtual int getGroundLevelAtPoint (v2s16 p)
 
virtual int getSpawnLevelAtPoint (v2s16 p)
 

Static Public Member Functions

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)
 

Public Attributes

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
 

Private Member Functions

bool isLiquidHorizontallyFlowable (u32 vi, v3s16 em)
 

Constructor & Destructor Documentation

◆ Mapgen() [1/2]

Mapgen::Mapgen ( )
default

◆ Mapgen() [2/2]

Mapgen::Mapgen ( int  mapgenid,
MapgenParams params,
EmergeParams emerge 
)

◆ ~Mapgen()

virtual Mapgen::~Mapgen ( )
virtualdefault

Member Function Documentation

◆ calcLighting()

void Mapgen::calcLighting ( v3s16  nmin,
v3s16  nmax,
v3s16  full_nmin,
v3s16  full_nmax,
bool  propagate_shadow = true 
)

References g_profiler, propagateSunlight(), spreadLight(), and SPT_AVG.

Referenced by LuaVoxelManip::l_calc_lighting(), MapgenCarpathian::makeChunk(), MapgenFlat::makeChunk(), MapgenFractal::makeChunk(), MapgenV5::makeChunk(), MapgenV6::makeChunk(), MapgenV7::makeChunk(), and MapgenValleys::makeChunk().

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

◆ createMapgen()

Mapgen * Mapgen::createMapgen ( MapgenType  mgtype,
MapgenParams params,
EmergeParams emerge 
)
static

References MAPGEN_CARPATHIAN, MAPGEN_FLAT, MAPGEN_FRACTAL, MAPGEN_SINGLENODE, MAPGEN_V5, MAPGEN_V6, MAPGEN_V7, MAPGEN_VALLEYS, and params.

Referenced by EmergeManager::initMapgens().

+ Here is the caller graph for this function:

◆ createMapgenParams()

MapgenParams * Mapgen::createMapgenParams ( MapgenType  mgtype)
static

References MAPGEN_CARPATHIAN, MAPGEN_FLAT, MAPGEN_FRACTAL, MAPGEN_SINGLENODE, MAPGEN_V5, MAPGEN_V6, MAPGEN_V7, and MAPGEN_VALLEYS.

Referenced by MapSettingsManager::makeMapgenParams(), and setDefaultSettings().

+ Here is the caller graph for this function:

◆ DISABLE_CLASS_COPY()

Mapgen::DISABLE_CLASS_COPY ( Mapgen  )

◆ findGroundLevel()

s16 Mapgen::findGroundLevel ( v2s16  p2d,
s16  ymin,
s16  ymax 
)

References VoxelArea::add_y(), NodeDefManager::get(), VoxelArea::getExtent(), VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, MAX_MAP_GENERATION_LIMIT, ndef, vm, and ContentFeatures::walkable.

Referenced by Decoration::placeDeco(), and updateHeightmap().

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

◆ findLiquidSurface()

s16 Mapgen::findLiquidSurface ( v2s16  p2d,
s16  ymin,
s16  ymax 
)

References VoxelArea::add_y(), NodeDefManager::get(), VoxelArea::getExtent(), VoxelArea::index(), ContentFeatures::isLiquid(), VoxelManipulator::m_area, VoxelManipulator::m_data, MAX_MAP_GENERATION_LIMIT, ndef, vm, and ContentFeatures::walkable.

Referenced by Decoration::placeDeco().

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

◆ getBlockSeed()

u32 Mapgen::getBlockSeed ( v3s16  p,
s32  seed 
)
static

References p(), and seed.

Referenced by ModApiMapgen::l_generate_decorations(), and ModApiMapgen::l_generate_ores().

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

◆ getBlockSeed2()

u32 Mapgen::getBlockSeed2 ( v3s16  p,
s32  seed 
)
static

References p(), and seed.

Referenced by MapgenCarpathian::makeChunk(), MapgenFlat::makeChunk(), MapgenFractal::makeChunk(), MapgenSinglenode::makeChunk(), MapgenV5::makeChunk(), MapgenV7::makeChunk(), and MapgenValleys::makeChunk().

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

◆ getGroundLevelAtPoint()

virtual int Mapgen::getGroundLevelAtPoint ( v2s16  p)
inlinevirtual

Reimplemented in MapgenV6.

◆ getMapgenName()

const char * Mapgen::getMapgenName ( MapgenType  mgtype)
static

References ARRLEN, g_reg_mapgens, MAPGEN_INVALID, and MapgenDesc::name.

Referenced by Server::AsyncRunStep(), MapSettingsManager::makeMapgenParams(), and MapgenParams::writeParams().

+ Here is the caller graph for this function:

◆ getMapgenNames()

void Mapgen::getMapgenNames ( std::vector< const char * > *  mgnames,
bool  include_hidden 
)
static

References ARRLEN, and g_reg_mapgens.

Referenced by ModApiMainMenu::l_get_mapgen_names().

+ Here is the caller graph for this function:

◆ getMapgenType()

MapgenType Mapgen::getMapgenType ( const std::string &  mgname)
static

References ARRLEN, g_reg_mapgens, and MAPGEN_INVALID.

Referenced by MapSettingsManager::makeMapgenParams(), and MapgenParams::readParams().

+ Here is the caller graph for this function:

◆ getSpawnLevelAtPoint()

virtual int Mapgen::getSpawnLevelAtPoint ( v2s16  p)
inlinevirtual

◆ getSurfaces()

void Mapgen::getSurfaces ( v2s16  p2d,
s16  ymin,
s16  ymax,
std::vector< s16 > &  floors,
std::vector< s16 > &  ceilings 
)

References VoxelArea::add_y(), NodeDefManager::get(), VoxelArea::getExtent(), VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, ndef, vm, and ContentFeatures::walkable.

Referenced by Decoration::placeDeco().

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

◆ getType()

virtual MapgenType Mapgen::getType ( ) const
inlinevirtual

◆ isLiquidHorizontallyFlowable()

bool Mapgen::isLiquidHorizontallyFlowable ( u32  vi,
v3s16  em 
)
inlineprivate

References VoxelArea::add_x(), VoxelArea::add_z(), CONTENT_IGNORE, ContentFeatures::floodable, NodeDefManager::get(), MapNode::getContent(), ContentFeatures::isLiquid(), VoxelManipulator::m_data, ndef, and vm.

Referenced by updateLiquid().

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

◆ lightSpread()

void Mapgen::lightSpread ( VoxelArea a,
std::queue< std::pair< v3s16, u8 >> &  queue,
const v3s16 p,
u8  light 
)

References VoxelArea::contains(), NodeDefManager::get(), VoxelArea::index(), ContentFeatures::light_propagates, VoxelManipulator::m_area, VoxelManipulator::m_data, MYMAX, ndef, p(), MapNode::param1, and vm.

Referenced by spreadLight().

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

◆ makeChunk()

virtual void Mapgen::makeChunk ( BlockMakeData data)
inlinevirtual

Reimplemented in MapgenValleys, MapgenV7, MapgenV6, MapgenV5, MapgenSinglenode, MapgenFractal, MapgenFlat, and MapgenCarpathian.

Referenced by EmergeThread::run().

+ Here is the caller graph for this function:

◆ propagateSunlight()

void Mapgen::propagateSunlight ( v3s16  nmin,
v3s16  nmax,
bool  propagate_shadow 
)

References VoxelArea::add_y(), CONTENT_IGNORE, NodeDefManager::get(), MapNode::getContent(), VoxelArea::getExtent(), VoxelArea::index(), LIGHT_SUN, VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelArea::MaxEdge, VoxelArea::MinEdge, ndef, MapNode::param1, ContentFeatures::sunlight_propagates, vm, and water_level.

Referenced by calcLighting().

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

◆ setDefaultSettings()

void Mapgen::setDefaultSettings ( Settings settings)
static

References createMapgenParams(), flagdesc_mapgen, MAPGEN_INVALID, MG_BIOMES, MG_CAVES, MG_DECORATIONS, MG_DUNGEONS, MG_LIGHT, MG_ORES, params, and Settings::setDefault().

Referenced by MapSettingsManager::MapSettingsManager(), and set_default_settings().

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

◆ setLighting()

void Mapgen::setLighting ( u8  light,
v3s16  nmin,
v3s16  nmax 
)

References g_profiler, VoxelArea::index(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelArea::MaxEdge, VoxelArea::MinEdge, MapNode::param1, SPT_AVG, and vm.

Referenced by LuaVoxelManip::l_set_lighting(), and MapgenSinglenode::makeChunk().

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

◆ spreadLight()

void Mapgen::spreadLight ( const v3s16 nmin,
const v3s16 nmax 
)

References CONTENT_IGNORE, dir(), g_6dirs, NodeDefManager::get(), MapNode::getContent(), VoxelArea::index(), ContentFeatures::light_propagates, ContentFeatures::light_source, lightSpread(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelArea::MaxEdge, VoxelArea::MinEdge, ndef, p(), MapNode::param1, and vm.

Referenced by calcLighting().

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

◆ updateHeightmap()

void Mapgen::updateHeightmap ( v3s16  nmin,
v3s16  nmax 
)

References findGroundLevel(), and heightmap.

Referenced by MapgenCarpathian::makeChunk(), MapgenFlat::makeChunk(), MapgenFractal::makeChunk(), MapgenV5::makeChunk(), MapgenV6::makeChunk(), MapgenV7::makeChunk(), and MapgenValleys::makeChunk().

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

◆ updateLiquid()

void Mapgen::updateLiquid ( UniqueQueue< v3s16 > *  trans_liquid,
v3s16  nmin,
v3s16  nmax 
)

References VoxelArea::add_y(), CONTENT_IGNORE, ContentFeatures::floodable, NodeDefManager::get(), MapNode::getContent(), VoxelArea::getExtent(), VoxelArea::index(), ContentFeatures::isLiquid(), isLiquidHorizontallyFlowable(), VoxelManipulator::m_area, VoxelManipulator::m_data, ndef, UniqueQueue< Value >::push_back(), and vm.

Referenced by LuaVoxelManip::l_update_liquids(), MapgenCarpathian::makeChunk(), MapgenFlat::makeChunk(), MapgenFractal::makeChunk(), MapgenSinglenode::makeChunk(), MapgenV5::makeChunk(), MapgenV6::makeChunk(), MapgenV7::makeChunk(), and MapgenValleys::makeChunk().

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

Member Data Documentation

◆ biomegen

◆ biomemap

◆ blockseed

◆ csize

◆ flags

◆ generating

◆ gennotify

◆ heightmap

◆ id

int Mapgen::id = -1

◆ mapgen_limit

int Mapgen::mapgen_limit = 0

Referenced by Mapgen().

◆ ndef

◆ seed

◆ vm

◆ water_level


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