Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
ModApiEnv Class Reference

#include <l_env.h>

+ Inheritance diagram for ModApiEnv:
+ Collaboration diagram for ModApiEnv:

Static Public Member Functions

static void Initialize (lua_State *L, int top)
 
static void InitializeClient (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 ClientgetClient (lua_State *L)
 
static GUIEnginegetGuiEngine (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 Private Member Functions

static int l_set_node (lua_State *L)
 
static int l_bulk_set_node (lua_State *L)
 
static int l_add_node (lua_State *L)
 
static int l_remove_node (lua_State *L)
 
static int l_swap_node (lua_State *L)
 
static int l_get_node_raw (lua_State *L)
 
static int l_get_node_light (lua_State *L)
 
static int l_get_natural_light (lua_State *L)
 
static int l_place_node (lua_State *L)
 
static int l_dig_node (lua_State *L)
 
static int l_punch_node (lua_State *L)
 
static int l_get_node_max_level (lua_State *L)
 
static int l_get_node_level (lua_State *L)
 
static int l_set_node_level (lua_State *L)
 
static int l_add_node_level (lua_State *L)
 
static int l_get_node_boxes (lua_State *L)
 
static int l_find_nodes_with_meta (lua_State *L)
 
static int l_get_meta (lua_State *L)
 
static int l_get_node_timer (lua_State *L)
 
static int l_add_entity (lua_State *L)
 
static int l_add_item (lua_State *L)
 
static int l_get_connected_players (lua_State *L)
 
static int l_get_player_by_name (lua_State *L)
 
static int l_get_objects_inside_radius (lua_State *L)
 
static int l_get_objects_in_area (lua_State *L)
 
static int l_set_timeofday (lua_State *L)
 
static int l_get_timeofday (lua_State *L)
 
static int l_get_gametime (lua_State *L)
 
static int l_get_day_count (lua_State *L)
 
static int l_find_node_near (lua_State *L)
 
static int l_find_nodes_in_area (lua_State *L)
 
static int l_find_nodes_in_area_under_air (lua_State *L)
 
static int l_fix_light (lua_State *L)
 
static int l_load_area (lua_State *L)
 
static int l_emerge_area (lua_State *L)
 
static int l_delete_area (lua_State *L)
 
static int l_get_perlin (lua_State *L)
 
static int l_get_perlin_map (lua_State *L)
 
static int l_get_voxel_manip (lua_State *L)
 
static int l_clear_objects (lua_State *L)
 
static int l_spawn_tree (lua_State *L)
 
static int l_line_of_sight (lua_State *L)
 
static int l_raycast (lua_State *L)
 
static int l_find_path (lua_State *L)
 
static int l_transforming_liquid_add (lua_State *L)
 
static int l_forceload_block (lua_State *L)
 
static int l_forceload_free_block (lua_State *L)
 
static int l_compare_block_status (lua_State *L)
 
static int l_get_translated_string (lua_State *L)
 

Additional Inherited Members

- Protected Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
 Read a string from Lua state L at index without copying it.
 
- Static Protected Member Functions inherited from ModApiEnvBase
static void collectNodeIds (lua_State *L, int idx, const NodeDefManager *ndef, std::vector< content_t > &filter)
 
static void checkArea (v3s16 &minp, v3s16 &maxp)
 
template<typename F >
static int findNodeNear (lua_State *L, v3s16 pos, int radius, const std::vector< content_t > &filter, int start_radius, F &&getNode)
 
template<typename F >
static int findNodesInArea (lua_State *L, const NodeDefManager *ndef, const std::vector< content_t > &filter, bool grouped, F &&iterate)
 
template<typename F >
static int findNodesInAreaUnderAir (lua_State *L, v3s16 minp, v3s16 maxp, const std::vector< content_t > &filter, F &&getNode)
 
- 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.
 
- Static Protected Attributes inherited from ModApiEnvBase
static const EnumString es_ClearObjectsMode []
 
static const EnumString es_BlockStatusType []
 

Member Function Documentation

◆ Initialize()

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

References add_entity(), and API_FCT.

Referenced by ServerScripting::InitializeModApi().

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

◆ InitializeClient()

void ModApiEnv::InitializeClient ( lua_State *  L,
int  top 
)
static

References API_FCT.

Referenced by ClientScripting::InitializeModApi().

+ Here is the caller graph for this function:

◆ l_add_entity()

int ModApiEnv::l_add_entity ( lua_State *  L)
staticprivate

References checkFloatPos(), GET_ENV_PTR, ModApiBase::getScriptApiBase(), and ScriptApiBase::objectrefGetOrCreate().

+ Here is the call graph for this function:

◆ l_add_item()

int ModApiEnv::l_add_item ( lua_State *  L)
staticprivate

References ItemStack::empty(), GET_ENV_PTR, ItemStack::getItemString(), ModApiBase::getServer(), ItemStack::isKnown(), PCALL_RESL, PUSH_ERROR_HANDLER, and read_item().

+ Here is the call graph for this function:

◆ l_add_node()

int ModApiEnv::l_add_node ( lua_State *  L)
staticprivate

References l_set_node().

+ Here is the call graph for this function:

◆ l_add_node_level()

int ModApiEnv::l_add_node_level ( lua_State *  L)
staticprivate

References MapNode::addLevel(), GET_ENV_PTR, and read_v3s16().

+ Here is the call graph for this function:

◆ l_bulk_set_node()

int ModApiEnv::l_bulk_set_node ( lua_State *  L)
staticprivate

References GET_ENV_PTR, read_v3s16(), and readnode().

+ Here is the call graph for this function:

◆ l_clear_objects()

int ModApiEnv::l_clear_objects ( lua_State *  L)
staticprivate

References CLEAR_OBJECTS_MODE_QUICK, ModApiEnvBase::es_ClearObjectsMode, GET_ENV_PTR, and getenumfield().

+ Here is the call graph for this function:

◆ l_compare_block_status()

int ModApiEnv::l_compare_block_status ( lua_State *  L)
staticprivate

References check_v3s16(), ModApiEnvBase::es_BlockStatusType, GET_ENV_PTR, getNodeBlockPos(), and string_to_enum().

+ Here is the call graph for this function:

◆ l_delete_area()

int ModApiEnv::l_delete_area ( lua_State *  L)
staticprivate

References ServerMap::deleteBlock(), Map::dispatchEvent(), GET_ENV_PTR, getNodeBlockPos(), MEET_OTHER, read_v3s16(), sortBoxVerticies(), and MapEditEvent::type.

+ Here is the call graph for this function:

◆ l_dig_node()

int ModApiEnv::l_dig_node ( lua_State *  L)
staticprivate

References CONTENT_IGNORE, GET_ENV_PTR, MapNode::getContent(), ObjectRef::getobject(), ScriptApiNode::node_on_dig(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_emerge_area()

◆ l_find_node_near()

int ModApiEnv::l_find_node_near ( lua_State *  L)
staticprivate

References ModApiEnvBase::collectNodeIds(), ModApiEnvBase::findNodeNear(), GET_PLAIN_ENV_PTR, ModApiBase::getClient(), Map::getNode(), p(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_find_nodes_in_area()

int ModApiEnv::l_find_nodes_in_area ( lua_State *  L)
staticprivate

References ModApiEnvBase::checkArea(), ModApiEnvBase::collectNodeIds(), ModApiEnvBase::findNodesInArea(), Map::forEachNodeInArea(), GET_PLAIN_ENV_PTR, ModApiBase::getClient(), read_v3s16(), and sortBoxVerticies().

+ Here is the call graph for this function:

◆ l_find_nodes_in_area_under_air()

int ModApiEnv::l_find_nodes_in_area_under_air ( lua_State *  L)
staticprivate

References ModApiEnvBase::checkArea(), ModApiEnvBase::collectNodeIds(), ModApiEnvBase::findNodesInAreaUnderAir(), GET_PLAIN_ENV_PTR, ModApiBase::getClient(), Map::getNode(), p(), read_v3s16(), and sortBoxVerticies().

+ Here is the call graph for this function:

◆ l_find_nodes_with_meta()

int ModApiEnv::l_find_nodes_with_meta ( lua_State *  L)
staticprivate

References check_v3s16(), GET_PLAIN_ENV_PTR, and push_v3s16().

+ Here is the call graph for this function:

◆ l_find_path()

int ModApiEnv::l_find_path ( lua_State *  L)
staticprivate

References GET_ENV_PTR, get_path(), PA_DIJKSTRA, PA_PLAIN, PA_PLAIN_NP, push_v3s16(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_fix_light()

int ModApiEnv::l_fix_light ( lua_State *  L)
staticprivate

References Map::dispatchEvent(), GET_ENV_PTR, getContainerPos(), MAP_BLOCKSIZE, MEET_OTHER, read_v3s16(), ServerMap::repairBlockLight(), and MapEditEvent::type.

+ Here is the call graph for this function:

◆ l_forceload_block()

int ModApiEnv::l_forceload_block ( lua_State *  L)
staticprivate

References GET_ENV_PTR, and read_v3s16().

+ Here is the call graph for this function:

◆ l_forceload_free_block()

int ModApiEnv::l_forceload_free_block ( lua_State *  L)
staticprivate

References GET_ENV_PTR, and read_v3s16().

+ Here is the call graph for this function:

◆ l_get_connected_players()

int ModApiEnv::l_get_connected_players ( lua_State *  L)
staticprivate

References ModApiBase::getEnv(), ServerEnvironment::getPlayerCount(), ServerEnvironment::getPlayers(), ModApiBase::getScriptApiBase(), ServerActiveObject::isGone(), log_deprecated(), and ScriptApiBase::objectrefGetOrCreate().

+ Here is the call graph for this function:

◆ l_get_day_count()

int ModApiEnv::l_get_day_count ( lua_State *  L)
staticprivate

References GET_PLAIN_ENV_PTR.

◆ l_get_gametime()

int ModApiEnv::l_get_gametime ( lua_State *  L)
staticprivate

References GET_ENV_PTR.

◆ l_get_meta()

int ModApiEnv::l_get_meta ( lua_State *  L)
staticprivate

References NodeMetaRef::create(), GET_ENV_PTR, p(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_get_natural_light()

int ModApiEnv::l_get_natural_light ( lua_State *  L)
staticprivate

References GET_ENV_PTR, MapNode::param1, read_v3s16(), and time_to_daynight_ratio().

+ Here is the call graph for this function:

◆ l_get_node_boxes()

int ModApiEnv::l_get_node_boxes ( lua_State *  L)
staticprivate

References BS, GET_ENV_PTR, MapNode::getCollisionBoxes(), MapNode::getNeighbors(), MapNode::getNodeBoxes(), MapNode::getSelectionBoxes(), push_aabb3f_vector(), read_v3s16(), and readnode().

+ Here is the call graph for this function:

◆ l_get_node_level()

int ModApiEnv::l_get_node_level ( lua_State *  L)
staticprivate

References GET_PLAIN_ENV_PTR, MapNode::getLevel(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_get_node_light()

int ModApiEnv::l_get_node_light ( lua_State *  L)
staticprivate

References GET_PLAIN_ENV_PTR, MapNode::getLightBlend(), NodeDefManager::getLightingFlags(), read_v3s16(), and time_to_daynight_ratio().

+ Here is the call graph for this function:

◆ l_get_node_max_level()

int ModApiEnv::l_get_node_max_level ( lua_State *  L)
staticprivate

References GET_PLAIN_ENV_PTR, MapNode::getMaxLevel(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_get_node_raw()

int ModApiEnv::l_get_node_raw ( lua_State *  L)
staticprivate

References doubleToInt(), GET_ENV_PTR, MapNode::getContent(), MapNode::getParam1(), and MapNode::getParam2().

+ Here is the call graph for this function:

◆ l_get_node_timer()

int ModApiEnv::l_get_node_timer ( lua_State *  L)
staticprivate

References NodeTimerRef::create(), GET_ENV_PTR, p(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_get_objects_in_area()

int ModApiEnv::l_get_objects_in_area ( lua_State *  L)
staticprivate

References BS, GET_ENV_PTR, ModApiBase::getScriptApiBase(), ScriptApiBase::objectrefGetOrCreate(), and read_v3f().

+ Here is the call graph for this function:

◆ l_get_objects_inside_radius()

int ModApiEnv::l_get_objects_inside_radius ( lua_State *  L)
staticprivate

References BS, checkFloatPos(), GET_ENV_PTR, ModApiBase::getScriptApiBase(), and ScriptApiBase::objectrefGetOrCreate().

+ Here is the call graph for this function:

◆ l_get_perlin()

int ModApiEnv::l_get_perlin ( lua_State *  L)
staticprivate

References GET_ENV_PTR_NO_MAP_LOCK, params, and read_noiseparams().

+ Here is the call graph for this function:

◆ l_get_perlin_map()

int ModApiEnv::l_get_perlin_map ( lua_State *  L)
staticprivate

References GET_ENV_PTR_NO_MAP_LOCK, read_noiseparams(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_get_player_by_name()

int ModApiEnv::l_get_player_by_name ( lua_State *  L)
staticprivate

References GET_ENV_PTR, RemotePlayer::getPlayerSAO(), ModApiBase::getScriptApiBase(), ServerActiveObject::isGone(), and ScriptApiBase::objectrefGetOrCreate().

+ Here is the call graph for this function:

◆ l_get_timeofday()

int ModApiEnv::l_get_timeofday ( lua_State *  L)
staticprivate

References GET_PLAIN_ENV_PTR.

◆ l_get_translated_string()

int ModApiEnv::l_get_translated_string ( lua_State *  L)
staticprivate

References GET_ENV_PTR, ModApiBase::getServer(), Server::getTranslationLanguage(), translate_string(), utf8_to_wide(), and wide_to_utf8().

+ Here is the call graph for this function:

◆ l_get_voxel_manip()

int ModApiEnv::l_get_voxel_manip ( lua_State *  L)
staticprivate

References LuaVoxelManip::create_object().

+ Here is the call graph for this function:

◆ l_line_of_sight()

int ModApiEnv::l_line_of_sight ( lua_State *  L)
staticprivate

References checkFloatPos(), GET_PLAIN_ENV_PTR, p(), and push_v3s16().

+ Here is the call graph for this function:

◆ l_load_area()

int ModApiEnv::l_load_area ( lua_State *  L)
staticprivate

References check_v3s16(), Map::emergeBlock(), GET_ENV_PTR, getNodeBlockPos(), MAP_LOCK_REQUIRED, and sortBoxVerticies().

+ Here is the call graph for this function:

◆ l_place_node()

int ModApiEnv::l_place_node ( lua_State *  L)
staticprivate

◆ l_punch_node()

int ModApiEnv::l_punch_node ( lua_State *  L)
staticprivate

References CONTENT_IGNORE, GET_ENV_PTR, MapNode::getContent(), ObjectRef::getobject(), ScriptApiNode::node_on_punch(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_raycast()

int ModApiEnv::l_raycast ( lua_State *  L)
staticprivate

References LuaRaycast::create_object().

+ Here is the call graph for this function:

◆ l_remove_node()

int ModApiEnv::l_remove_node ( lua_State *  L)
staticprivate

References GET_ENV_PTR, and read_v3s16().

+ Here is the call graph for this function:

◆ l_set_node()

int ModApiEnv::l_set_node ( lua_State *  L)
staticprivate

References GET_ENV_PTR, read_v3s16(), and readnode().

Referenced by l_add_node().

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

◆ l_set_node_level()

int ModApiEnv::l_set_node_level ( lua_State *  L)
staticprivate

References GET_ENV_PTR, read_v3s16(), and MapNode::setLevel().

+ Here is the call graph for this function:

◆ l_set_timeofday()

int ModApiEnv::l_set_timeofday ( lua_State *  L)
staticprivate

References GET_ENV_PTR, ModApiBase::getServer(), and Server::setTimeOfDay().

+ Here is the call graph for this function:

◆ l_spawn_tree()

int ModApiEnv::l_spawn_tree ( lua_State *  L)
staticprivate

References GET_ENV_PTR, read_tree_def(), read_v3s16(), treegen::spawn_ltree(), treegen::SUCCESS, and treegen::UNBALANCED_BRACKETS.

+ Here is the call graph for this function:

◆ l_swap_node()

int ModApiEnv::l_swap_node ( lua_State *  L)
staticprivate

References GET_ENV_PTR, read_v3s16(), and readnode().

+ Here is the call graph for this function:

◆ l_transforming_liquid_add()

int ModApiEnv::l_transforming_liquid_add ( lua_State *  L)
staticprivate

References GET_ENV_PTR, and read_v3s16().

+ Here is the call graph for this function:

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