Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
ModApiMapgen Class Reference

#include <l_mapgen.h>

+ Inheritance diagram for ModApiMapgen:
+ Collaboration diagram for ModApiMapgen:

Static Public Member Functions

static void Initialize (lua_State *L, int top)
 
static void InitializeEmerge (lua_State *L, int top)
 
- Static Public Member Functions inherited from ModApiBase
static ScriptApiBasegetScriptApiBase (lua_State *L)
 
static ServergetServer (lua_State *L)
 
static ServerInventoryManagergetServerInventoryMgr (lua_State *L)
 
static EmergeThreadgetEmergeThread (lua_State *L)
 
static IGameDefgetGameDef (lua_State *L)
 
static EnvironmentgetEnv (lua_State *L)
 
static std::string getCurrentModPath (lua_State *L)
 
template<typename T >
static T * getScriptApi (lua_State *L)
 
static bool registerFunction (lua_State *L, const char *name, lua_CFunction func, int top)
 
static void registerClass (lua_State *L, const char *name, const luaL_Reg *methods, const luaL_Reg *metamethods)
 
template<typename T >
static T * checkObject (lua_State *L, int narg)
 
static int l_deprecated_function (lua_State *L, const char *good, const char *bad, lua_CFunction func)
 A wrapper for deprecated functions.
 

Static Public Attributes

static struct EnumString es_BiomeTerrainType []
 
static struct EnumString es_DecorationType []
 
static struct EnumString es_MapgenObject []
 
static struct EnumString es_OreType []
 
static struct EnumString es_Rotation []
 
static struct EnumString es_SchematicFormatType []
 
static struct EnumString es_NodeResolveMethod []
 

Static Private Member Functions

static int l_get_biome_id (lua_State *L)
 
static int l_get_biome_name (lua_State *L)
 
static int l_get_heat (lua_State *L)
 
static int l_get_humidity (lua_State *L)
 
static int l_get_biome_data (lua_State *L)
 
static int l_get_mapgen_object (lua_State *L)
 
static int l_get_spawn_level (lua_State *L)
 
static int l_get_mapgen_params (lua_State *L)
 
static int l_set_mapgen_params (lua_State *L)
 
static int l_get_mapgen_edges (lua_State *L)
 
static int l_get_seed (lua_State *L)
 
static int l_get_mapgen_setting (lua_State *L)
 
static int l_set_mapgen_setting (lua_State *L)
 
static int l_get_mapgen_setting_noiseparams (lua_State *L)
 
static int l_set_mapgen_setting_noiseparams (lua_State *L)
 
static int l_set_noiseparams (lua_State *L)
 
static int l_get_noiseparams (lua_State *L)
 
static int l_set_gen_notify (lua_State *L)
 
static int l_get_gen_notify (lua_State *L)
 
static int l_save_gen_notify (lua_State *L)
 
static int l_get_decoration_id (lua_State *L)
 
static int l_register_biome (lua_State *L)
 
static int l_register_decoration (lua_State *L)
 
static int l_register_ore (lua_State *L)
 
static int l_register_schematic (lua_State *L)
 
static int l_clear_registered_biomes (lua_State *L)
 
static int l_clear_registered_decorations (lua_State *L)
 
static int l_clear_registered_schematics (lua_State *L)
 
static int l_generate_ores (lua_State *L)
 
static int l_generate_decorations (lua_State *L)
 
static int l_clear_registered_ores (lua_State *L)
 
static int l_create_schematic (lua_State *L)
 
static int l_place_schematic (lua_State *L)
 
static int l_place_schematic_on_vmanip (lua_State *L)
 
static int l_serialize_schematic (lua_State *L)
 
static int l_read_schematic (lua_State *L)
 
static int update_liquids (lua_State *L, MMVManip *vm)
 
static int calc_lighting (lua_State *L, MMVManip *vm, v3s16 pmin, v3s16 pmax, bool propagate_shadow)
 
static int set_lighting (lua_State *L, MMVManip *vm, v3s16 pmin, v3s16 pmax, u8 light)
 
static const EmergeManagergetEmergeManager (lua_State *L)
 
static const BiomeGengetBiomeGen (lua_State *L)
 
static MapgengetMapgen (lua_State *L)
 

Friends

class LuaVoxelManip
 

Additional Inherited Members

- Protected Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
 
template<>
s16 readParam (lua_State *L, int index)
 
template<>
int readParam (lua_State *L, int index)
 
template<>
float readParam (lua_State *L, int index)
 
template<>
v2s16 readParam (lua_State *L, int index)
 
template<>
v2f readParam (lua_State *L, int index)
 
template<>
v3f readParam (lua_State *L, int index)
 
template<>
std::string_view readParam (lua_State *L, int index)
 
template<>
std::string readParam (lua_State *L, int index)
 
template<>
std::string_view readParam (lua_State *L, int index)
 Read a string from Lua state L at index without copying it.
 
- Static Protected Member Functions inherited from LuaHelper
template<typename T >
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua state L at index.
 
template<typename T >
static T readParam (lua_State *L, int index, const T &default_value)
 Read a value using a template type T from Lua state L at index.
 

Member Function Documentation

◆ calc_lighting()

int ModApiMapgen::calc_lighting ( lua_State * L,
MMVManip * vm,
v3s16 pmin,
v3s16 pmax,
bool propagate_shadow )
staticprivate

References Mapgen::calcLighting(), VoxelArea::contains(), getEmergeManager(), ModApiBase::getGameDef(), VoxelManipulator::m_area, VoxelArea::MaxEdge, VoxelArea::MinEdge, IGameDef::ndef(), Mapgen::ndef, Mapgen::vm, and Mapgen::water_level.

Referenced by LuaVoxelManip::l_calc_lighting().

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

◆ getBiomeGen()

const BiomeGen * ModApiMapgen::getBiomeGen ( lua_State * L)
staticprivate

References EmergeManager::getBiomeGen(), Server::getEmergeManager(), ModApiBase::getEmergeThread(), and ModApiBase::getServer().

Referenced by l_get_biome_data(), l_get_heat(), and l_get_humidity().

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

◆ getEmergeManager()

const EmergeManager * ModApiMapgen::getEmergeManager ( lua_State * L)
staticprivate

References Server::getEmergeManager(), ModApiBase::getEmergeThread(), and ModApiBase::getServer().

Referenced by calc_lighting(), l_generate_decorations(), l_generate_ores(), l_get_biome_id(), l_get_biome_name(), l_get_decoration_id(), l_get_gen_notify(), l_get_mapgen_edges(), l_get_mapgen_params(), l_get_mapgen_setting(), l_get_mapgen_setting_noiseparams(), l_get_seed(), l_read_schematic(), and l_serialize_schematic().

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

◆ getMapgen()

Mapgen * ModApiMapgen::getMapgen ( lua_State * L)
staticprivate

References EmergeManager::getCurrentMapgen(), Server::getEmergeManager(), ModApiBase::getEmergeThread(), and ModApiBase::getServer().

Referenced by l_generate_decorations(), l_generate_ores(), l_get_mapgen_object(), and l_place_schematic_on_vmanip().

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

◆ Initialize()

void ModApiMapgen::Initialize ( lua_State * L,
int top )
static

References API_FCT, and get_mapgen_edges().

Referenced by ServerScripting::InitializeModApi().

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

◆ InitializeEmerge()

void ModApiMapgen::InitializeEmerge ( lua_State * L,
int top )
static

References API_FCT, and get_mapgen_edges().

Referenced by EmergeScripting::InitializeModApi().

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

◆ l_clear_registered_biomes()

int ModApiMapgen::l_clear_registered_biomes ( lua_State * L)
staticprivate

References BiomeManager::clear(), Server::getEmergeManager(), ModApiBase::getServer(), EmergeManager::getWritableBiomeManager(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_clear_registered_decorations()

int ModApiMapgen::l_clear_registered_decorations ( lua_State * L)
staticprivate

References ObjDefManager::clear(), Server::getEmergeManager(), ModApiBase::getServer(), EmergeManager::getWritableDecorationManager(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_clear_registered_ores()

int ModApiMapgen::l_clear_registered_ores ( lua_State * L)
staticprivate

References OreManager::clear(), Server::getEmergeManager(), ModApiBase::getServer(), EmergeManager::getWritableOreManager(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_clear_registered_schematics()

int ModApiMapgen::l_clear_registered_schematics ( lua_State * L)
staticprivate

References SchematicManager::clear(), Server::getEmergeManager(), ModApiBase::getServer(), EmergeManager::getWritableSchematicManager(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_create_schematic()

int ModApiMapgen::l_create_schematic ( lua_State * L)
staticprivate

◆ l_generate_decorations()

int ModApiMapgen::l_generate_decorations ( lua_State * L)
staticprivate

References check_v3s16(), ModApiBase::checkObject(), Mapgen::getBlockSeed(), getEmergeManager(), getMapgen(), VoxelManipulator::m_area, MAP_BLOCKSIZE, VoxelArea::MaxEdge, VoxelArea::MinEdge, Mapgen::ndef, NO_MAP_LOCK_REQUIRED, DecorationManager::placeAllDecos(), Mapgen::seed, sortBoxVerticies(), and Mapgen::vm.

+ Here is the call graph for this function:

◆ l_generate_ores()

int ModApiMapgen::l_generate_ores ( lua_State * L)
staticprivate

References check_v3s16(), ModApiBase::checkObject(), Mapgen::getBlockSeed(), getEmergeManager(), getMapgen(), VoxelManipulator::m_area, MAP_BLOCKSIZE, VoxelArea::MaxEdge, VoxelArea::MinEdge, Mapgen::ndef, NO_MAP_LOCK_REQUIRED, OreManager::placeAllOres(), Mapgen::seed, sortBoxVerticies(), and Mapgen::vm.

+ Here is the call graph for this function:

◆ l_get_biome_data()

int ModApiMapgen::l_get_biome_data ( lua_State * L)
staticprivate

References BIOMEGEN_ORIGINAL, BiomeGen::calcBiomeAtPoint(), getBiomeGen(), BiomeGen::getType(), ObjDef::index, NO_MAP_LOCK_REQUIRED, OBJDEF_INVALID_INDEX, and read_v3s16().

+ Here is the call graph for this function:

◆ l_get_biome_id()

int ModApiMapgen::l_get_biome_id ( lua_State * L)
staticprivate

References EmergeManager::getBiomeManager(), ObjDefManager::getByName(), getEmergeManager(), ObjDef::index, NO_MAP_LOCK_REQUIRED, and OBJDEF_INVALID_INDEX.

+ Here is the call graph for this function:

◆ l_get_biome_name()

int ModApiMapgen::l_get_biome_name ( lua_State * L)
staticprivate

References EmergeManager::getBiomeManager(), getEmergeManager(), ObjDefManager::getRaw(), ObjDef::name, and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_decoration_id()

int ModApiMapgen::l_get_decoration_id ( lua_State * L)
staticprivate

References ObjDefManager::getByName(), EmergeManager::getDecorationManager(), getEmergeManager(), ObjDef::index, and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_gen_notify()

int ModApiMapgen::l_get_gen_notify ( lua_State * L)
staticprivate

References flagdesc_gennotify, getEmergeManager(), NO_MAP_LOCK_REQUIRED, and push_flags_string().

+ Here is the call graph for this function:

◆ l_get_heat()

int ModApiMapgen::l_get_heat ( lua_State * L)
staticprivate

References BIOMEGEN_ORIGINAL, getBiomeGen(), BiomeGen::getType(), NO_MAP_LOCK_REQUIRED, and read_v3s16().

+ Here is the call graph for this function:

◆ l_get_humidity()

int ModApiMapgen::l_get_humidity ( lua_State * L)
staticprivate

References BIOMEGEN_ORIGINAL, getBiomeGen(), BiomeGen::getType(), NO_MAP_LOCK_REQUIRED, and read_v3s16().

+ Here is the call graph for this function:

◆ l_get_mapgen_edges()

int ModApiMapgen::l_get_mapgen_edges ( lua_State * L)
staticprivate

References get_mapgen_edges(), getEmergeManager(), MapSettingsManager::getMapSetting(), EmergeManager::map_settings_mgr, MAX_MAP_GENERATION_LIMIT, NO_MAP_LOCK_REQUIRED, push_v3s16(), and stoi.

+ Here is the call graph for this function:

◆ l_get_mapgen_object()

◆ l_get_mapgen_params()

int ModApiMapgen::l_get_mapgen_params ( lua_State * L)
staticprivate

References from_string(), getEmergeManager(), MapSettingsManager::getMapSetting(), log_deprecated(), EmergeManager::map_settings_mgr, NO_MAP_LOCK_REQUIRED, and stoi.

+ Here is the call graph for this function:

◆ l_get_mapgen_setting()

int ModApiMapgen::l_get_mapgen_setting ( lua_State * L)
staticprivate

References getEmergeManager(), MapSettingsManager::getMapSetting(), EmergeManager::map_settings_mgr, and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_mapgen_setting_noiseparams()

int ModApiMapgen::l_get_mapgen_setting_noiseparams ( lua_State * L)
staticprivate

References getEmergeManager(), MapSettingsManager::getMapSettingNoiseParams(), EmergeManager::map_settings_mgr, NO_MAP_LOCK_REQUIRED, and push_noiseparams().

+ Here is the call graph for this function:

◆ l_get_noiseparams()

int ModApiMapgen::l_get_noiseparams ( lua_State * L)
staticprivate

References g_settings, Settings::getNoiseParams(), NO_MAP_LOCK_REQUIRED, and push_noiseparams().

+ Here is the call graph for this function:

◆ l_get_seed()

int ModApiMapgen::l_get_seed ( lua_State * L)
staticprivate

References getEmergeManager(), and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_get_spawn_level()

int ModApiMapgen::l_get_spawn_level ( lua_State * L)
staticprivate

References Server::getEmergeManager(), ModApiBase::getServer(), EmergeManager::getSpawnLevelAtPoint(), MAX_MAP_GENERATION_LIMIT, and NO_MAP_LOCK_REQUIRED.

+ Here is the call graph for this function:

◆ l_place_schematic()

int ModApiMapgen::l_place_schematic ( lua_State * L)
staticprivate

References check_v3s16(), errorstream, es_Rotation, flagdesc_deco, GET_ENV_PTR, get_or_load_schematic(), Server::getEmergeManager(), ModApiBase::getServer(), MAP_LOCK_REQUIRED, p(), Schematic::placeOnMap(), read_flags(), read_schematic_replacements(), LuaHelper::readParam(), ROTATE_0, EmergeManager::schemmgr, and string_to_enum().

+ Here is the call graph for this function:

◆ l_place_schematic_on_vmanip()

int ModApiMapgen::l_place_schematic_on_vmanip ( lua_State * L)
staticprivate

◆ l_read_schematic()

◆ l_register_biome()

int ModApiMapgen::l_register_biome ( lua_State * L)
staticprivate

References ObjDefManager::add(), Server::getEmergeManager(), Server::getNodeDefManager(), ModApiBase::getServer(), EmergeManager::getWritableBiomeManager(), NO_MAP_LOCK_REQUIRED, OBJDEF_INVALID_HANDLE, and read_biome_def().

+ Here is the call graph for this function:

◆ l_register_decoration()

◆ l_register_ore()

◆ l_register_schematic()

int ModApiMapgen::l_register_schematic ( lua_State * L)
staticprivate

References ObjDefManager::add(), Server::getEmergeManager(), ObjDefManager::getNodeDef(), ModApiBase::getServer(), EmergeManager::getWritableSchematicManager(), load_schematic(), NO_MAP_LOCK_REQUIRED, OBJDEF_INVALID_HANDLE, and read_schematic_replacements().

+ Here is the call graph for this function:

◆ l_save_gen_notify()

int ModApiMapgen::l_save_gen_notify ( lua_State * L)
staticprivate

References ModApiBase::getEmergeThread(), and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_serialize_schematic()

int ModApiMapgen::l_serialize_schematic ( lua_State * L)
staticprivate

◆ l_set_gen_notify()

int ModApiMapgen::l_set_gen_notify ( lua_State * L)
staticprivate

References flagdesc_gennotify, EmergeManager::gen_notify_on, EmergeManager::gen_notify_on_custom, EmergeManager::gen_notify_on_deco_ids, GENNOTIFY_CUSTOM, GENNOTIFY_DECORATION, Server::getEmergeManager(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, read_flags(), and LuaHelper::readParam().

+ Here is the call graph for this function:

◆ l_set_mapgen_params()

int ModApiMapgen::l_set_mapgen_params ( lua_State * L)
staticprivate

References Server::getEmergeManager(), ModApiBase::getServer(), log_deprecated(), EmergeManager::map_settings_mgr, NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and MapSettingsManager::setMapSetting().

+ Here is the call graph for this function:

◆ l_set_mapgen_setting()

int ModApiMapgen::l_set_mapgen_setting ( lua_State * L)
staticprivate

References errorstream, Server::getEmergeManager(), ModApiBase::getServer(), EmergeManager::map_settings_mgr, NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and MapSettingsManager::setMapSetting().

+ Here is the call graph for this function:

◆ l_set_mapgen_setting_noiseparams()

int ModApiMapgen::l_set_mapgen_setting_noiseparams ( lua_State * L)
staticprivate

References errorstream, Server::getEmergeManager(), ModApiBase::getServer(), EmergeManager::map_settings_mgr, NO_MAP_LOCK_REQUIRED, read_noiseparams(), LuaHelper::readParam(), and MapSettingsManager::setMapSettingNoiseParams().

+ Here is the call graph for this function:

◆ l_set_noiseparams()

int ModApiMapgen::l_set_noiseparams ( lua_State * L)
staticprivate

References errorstream, Settings::getLayer(), NO_MAP_LOCK_REQUIRED, read_noiseparams(), LuaHelper::readParam(), SL_DEFAULTS, and SL_GLOBAL.

+ Here is the call graph for this function:

◆ set_lighting()

int ModApiMapgen::set_lighting ( lua_State * L,
MMVManip * vm,
v3s16 pmin,
v3s16 pmax,
u8 light )
staticprivate

References VoxelArea::contains(), VoxelManipulator::m_area, Mapgen::setLighting(), and Mapgen::vm.

Referenced by LuaVoxelManip::l_set_lighting().

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

◆ update_liquids()

int ModApiMapgen::update_liquids ( lua_State * L,
MMVManip * vm )
staticprivate

References GET_ENV_PTR, ModApiBase::getEmergeThread(), ModApiBase::getGameDef(), VoxelManipulator::m_area, VoxelArea::MaxEdge, VoxelArea::MinEdge, IGameDef::ndef(), Mapgen::ndef, Mapgen::updateLiquid(), and Mapgen::vm.

Referenced by LuaVoxelManip::l_update_liquids().

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

Friends And Related Symbol Documentation

◆ LuaVoxelManip

friend class LuaVoxelManip
friend

Member Data Documentation

◆ es_BiomeTerrainType

struct EnumString ModApiMapgen::es_BiomeTerrainType
static
Initial value:
=
{
{BIOMETYPE_NORMAL, "normal"},
{0, NULL},
}
@ BIOMETYPE_NORMAL
Definition mg_biome.h:25

Referenced by read_biome_def().

◆ es_DecorationType

struct EnumString ModApiMapgen::es_DecorationType
static
Initial value:
=
{
{DECO_SIMPLE, "simple"},
{DECO_SCHEMATIC, "schematic"},
{DECO_LSYSTEM, "lsystem"},
{0, NULL},
}
@ DECO_SCHEMATIC
Definition mg_decoration.h:23
@ DECO_LSYSTEM
Definition mg_decoration.h:24
@ DECO_SIMPLE
Definition mg_decoration.h:22

Referenced by l_register_decoration().

◆ es_MapgenObject

struct EnumString ModApiMapgen::es_MapgenObject
static
Initial value:
=
{
{MGOBJ_VMANIP, "voxelmanip"},
{MGOBJ_HEIGHTMAP, "heightmap"},
{MGOBJ_BIOMEMAP, "biomemap"},
{MGOBJ_HEATMAP, "heatmap"},
{MGOBJ_HUMIDMAP, "humiditymap"},
{MGOBJ_GENNOTIFY, "gennotify"},
{0, NULL},
}
@ MGOBJ_HEATMAP
Definition mapgen.h:51
@ MGOBJ_HUMIDMAP
Definition mapgen.h:52
@ MGOBJ_GENNOTIFY
Definition mapgen.h:53
@ MGOBJ_VMANIP
Definition mapgen.h:48
@ MGOBJ_HEIGHTMAP
Definition mapgen.h:49
@ MGOBJ_BIOMEMAP
Definition mapgen.h:50

Referenced by l_get_mapgen_object().

◆ es_NodeResolveMethod

struct EnumString ModApiMapgen::es_NodeResolveMethod[]
static

◆ es_OreType

struct EnumString ModApiMapgen::es_OreType
static
Initial value:
=
{
{ORE_SCATTER, "scatter"},
{ORE_SHEET, "sheet"},
{ORE_PUFF, "puff"},
{ORE_BLOB, "blob"},
{ORE_VEIN, "vein"},
{ORE_STRATUM, "stratum"},
{0, NULL},
}
@ ORE_SCATTER
Definition mg_ore.h:28
@ ORE_VEIN
Definition mg_ore.h:32
@ ORE_SHEET
Definition mg_ore.h:29
@ ORE_BLOB
Definition mg_ore.h:31
@ ORE_STRATUM
Definition mg_ore.h:33
@ ORE_PUFF
Definition mg_ore.h:30

Referenced by l_register_ore().

◆ es_Rotation

struct EnumString ModApiMapgen::es_Rotation
static
Initial value:
=
{
{ROTATE_0, "0"},
{ROTATE_90, "90"},
{ROTATE_180, "180"},
{ROTATE_270, "270"},
{ROTATE_RAND, "random"},
{0, NULL},
}
@ ROTATE_180
Definition mapnode.h:91
@ ROTATE_270
Definition mapnode.h:92
@ ROTATE_RAND
Definition mapnode.h:93
@ ROTATE_90
Definition mapnode.h:90
@ ROTATE_0
Definition mapnode.h:89

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

◆ es_SchematicFormatType

struct EnumString ModApiMapgen::es_SchematicFormatType
static
Initial value:
=
{
{SCHEM_FMT_HANDLE, "handle"},
{SCHEM_FMT_MTS, "mts"},
{SCHEM_FMT_LUA, "lua"},
{0, NULL},
}
@ SCHEM_FMT_LUA
Definition mg_schematic.h:76
@ SCHEM_FMT_HANDLE
Definition mg_schematic.h:74
@ SCHEM_FMT_MTS
Definition mg_schematic.h:75

Referenced by l_serialize_schematic().


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