Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
l_mapgen.cpp File Reference
#include "lua_api/l_mapgen.h"
#include "lua_api/l_internal.h"
#include "lua_api/l_vmanip.h"
#include "common/c_converter.h"
#include "common/c_content.h"
#include "cpp_api/s_security.h"
#include "util/serialize.h"
#include "server.h"
#include "environment.h"
#include "emerge_internal.h"
#include "mapgen/mg_biome.h"
#include "mapgen/mg_ore.h"
#include "mapgen/mg_decoration.h"
#include "mapgen/mg_schematic.h"
#include "mapgen/mapgen_v5.h"
#include "mapgen/mapgen_v7.h"
#include "mapgen/treegen.h"
#include "filesys.h"
#include "settings.h"
#include "log.h"
+ Include dependency graph for l_mapgen.cpp:

Functions

ObjDefget_objdef (lua_State *L, int index, const ObjDefManager *objmgr)
 
Biomeget_or_load_biome (lua_State *L, int index, BiomeManager *biomemgr)
 
Biomeread_biome_def (lua_State *L, int index, const NodeDefManager *ndef)
 
size_t get_biome_list (lua_State *L, int index, BiomeManager *biomemgr, std::unordered_set< biome_t > *biome_id_list)
 
Schematicget_or_load_schematic (lua_State *L, int index, SchematicManager *schemmgr, StringMap *replace_names)
 
Schematicload_schematic (lua_State *L, int index, const NodeDefManager *ndef, StringMap *replace_names)
 
Schematicload_schematic_from_def (lua_State *L, int index, const NodeDefManager *ndef, StringMap *replace_names)
 
bool read_schematic_def (lua_State *L, int index, Schematic *schem, std::vector< std::string > *names)
 
bool read_deco_simple (lua_State *L, DecoSimple *deco)
 
bool read_deco_schematic (lua_State *L, SchematicManager *schemmgr, DecoSchematic *deco)
 
bool read_deco_lsystem (lua_State *L, const NodeDefManager *ndef, DecoLSystem *deco)
 
void read_schematic_replacements (lua_State *L, int index, StringMap *replace_names)
 

Function Documentation

◆ get_biome_list()

size_t get_biome_list ( lua_State * L,
int index,
BiomeManager * biomemgr,
std::unordered_set< biome_t > * biome_id_list )

References get_or_load_biome(), ObjDef::index, and infostream.

Referenced by ModApiMapgen::l_register_decoration(), and ModApiMapgen::l_register_ore().

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

◆ get_objdef()

ObjDef * get_objdef ( lua_State * L,
int index,
const ObjDefManager * objmgr )

References ObjDefManager::get(), and ObjDefManager::getByName().

Referenced by get_or_load_biome(), get_or_load_schematic(), ModApiMapgen::l_read_schematic(), and ModApiMapgen::l_serialize_schematic().

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

◆ get_or_load_biome()

Biome * get_or_load_biome ( lua_State * L,
int index,
BiomeManager * biomemgr )

References ObjDefManager::add(), get_objdef(), ObjDefManager::getNodeDef(), OBJDEF_INVALID_HANDLE, and read_biome_def().

Referenced by get_biome_list().

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

◆ get_or_load_schematic()

Schematic * get_or_load_schematic ( lua_State * L,
int index,
SchematicManager * schemmgr,
StringMap * replace_names )

References ObjDefManager::add(), get_objdef(), ObjDefManager::getNodeDef(), load_schematic(), and OBJDEF_INVALID_HANDLE.

Referenced by ModApiMapgen::l_place_schematic(), ModApiMapgen::l_place_schematic_on_vmanip(), and read_deco_schematic().

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

◆ load_schematic()

Schematic * load_schematic ( lua_State * L,
int index,
const NodeDefManager * ndef,
StringMap * replace_names )

References SchematicManager::create(), DIR_DELIM, ModApiBase::getCurrentModPath(), fs::IsPathAbsolute(), load_schematic_from_def(), Schematic::loadSchematicFromFile(), and SCHEMATIC_NORMAL.

Referenced by get_or_load_schematic(), ModApiMapgen::l_read_schematic(), ModApiMapgen::l_register_schematic(), and ModApiMapgen::l_serialize_schematic().

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

◆ load_schematic_from_def()

Schematic * load_schematic_from_def ( lua_State * L,
int index,
const NodeDefManager * ndef,
StringMap * replace_names )

References SchematicManager::create(), NodeResolver::m_nnlistsizes, NodeResolver::m_nodenames, NodeDefManager::pendNodeResolve(), read_schematic_def(), and SCHEMATIC_NORMAL.

Referenced by load_schematic().

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

◆ read_biome_def()

Biome * read_biome_def ( lua_State * L,
int index,
const NodeDefManager * ndef )

References BIOMETYPE_NORMAL, BiomeManager::create(), Biome::depth_filler, Biome::depth_riverbed, Biome::depth_top, Biome::depth_water_top, ModApiMapgen::es_BiomeTerrainType, Biome::flags, getenumfield(), getfloatfield_default(), getintfield(), getintfield_default(), getstringfield_default(), getstringlistfield(), getv3s16field_default(), Biome::heat_point, Biome::humidity_point, NodeResolver::m_nnlistsizes, NodeResolver::m_nodenames, Biome::max_pos, Biome::min_pos, ObjDef::name, NodeDefManager::pendNodeResolve(), and Biome::vertical_blend.

Referenced by get_or_load_biome(), and ModApiMapgen::l_register_biome().

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

◆ read_deco_lsystem()

bool read_deco_lsystem ( lua_State * L,
const NodeDefManager * ndef,
DecoLSystem * deco )

References read_tree_def(), and DecoLSystem::tree_def.

Referenced by ModApiMapgen::l_register_decoration().

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

◆ read_deco_schematic()

bool read_deco_schematic ( lua_State * L,
SchematicManager * schemmgr,
DecoSchematic * deco )

References ModApiMapgen::es_Rotation, get_or_load_schematic(), getenumfield(), read_schematic_replacements(), ROTATE_0, DecoSchematic::rotation, and DecoSchematic::schematic.

Referenced by ModApiMapgen::l_register_decoration().

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

◆ read_deco_simple()

bool read_deco_simple ( lua_State * L,
DecoSimple * deco )

References DecoSimple::deco_height, DecoSimple::deco_height_max, DecoSimple::deco_param2, DecoSimple::deco_param2_max, errorstream, getintfield_default(), getstringlistfield(), NodeResolver::m_nnlistsizes, and NodeResolver::m_nodenames.

Referenced by ModApiMapgen::l_register_decoration().

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

◆ read_schematic_def()

bool read_schematic_def ( lua_State * L,
int index,
Schematic * schem,
std::vector< std::string > * names )

References check_v3s16(), errorstream, getboolfield_default(), getintfield(), getintfield_default(), getstringfield(), MTSCHEM_FORCE_PLACE, MTSCHEM_PROB_ALWAYS, MTSCHEM_PROB_ALWAYS_OLD, Schematic::schemdata, Schematic::size, and Schematic::slice_probs.

Referenced by load_schematic_from_def().

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

◆ read_schematic_replacements()

void read_schematic_replacements ( lua_State * L,
int index,
StringMap * replace_names )

Referenced by ModApiMapgen::l_place_schematic(), ModApiMapgen::l_place_schematic_on_vmanip(), ModApiMapgen::l_register_schematic(), and read_deco_schematic().

+ Here is the caller graph for this function: