Minetest  5.4.0
ModApiEnvMod Class Reference

#include <l_env.h>

+ Inheritance diagram for ModApiEnvMod:
+ Collaboration diagram for ModApiEnvMod:

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 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 int l_deprecated_function (lua_State *L, const char *good, const char *bad, lua_CFunction func)
 A wrapper for deprecated functions. More...
 

Static Public Attributes

static struct EnumString es_ClearObjectsMode []
 

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 (lua_State *L)
 
static int l_get_node_or_nil (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_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_get_translated_string (lua_State *L)
 
static void collectNodeIds (lua_State *L, int idx, const NodeDefManager *ndef, std::vector< content_t > &filter)
 

Additional Inherited Members

- Protected Member Functions inherited from LuaHelper
template<>
bool readParam (lua_State *L, int index)
 
- Static Protected Member Functions inherited from LuaHelper
static bool isNaN (lua_State *L, int idx)
 
template<typename T >
static T readParam (lua_State *L, int index)
 Read a value using a template type T from Lua State L and index. More...
 
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 and index. More...
 

Member Function Documentation

◆ collectNodeIds()

void ModApiEnvMod::collectNodeIds ( lua_State *  L,
int  idx,
const NodeDefManager ndef,
std::vector< content_t > &  filter 
)
staticprivate

References NodeDefManager::getIds(), and idx.

Referenced by l_find_node_near(), l_find_nodes_in_area(), and l_find_nodes_in_area_under_air().

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

◆ Initialize()

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

References API_FCT.

Referenced by ServerScripting::InitializeModApi().

+ Here is the caller graph for this function:

◆ InitializeClient()

void ModApiEnvMod::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 ModApiEnvMod::l_add_entity ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_add_item()

int ModApiEnvMod::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 ModApiEnvMod::l_add_node ( lua_State *  L)
staticprivate

References l_set_node().

+ Here is the call graph for this function:

◆ l_add_node_level()

int ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::l_clear_objects ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_delete_area()

int ModApiEnvMod::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 ModApiEnvMod::l_dig_node ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_emerge_area()

◆ l_find_node_near()

int ModApiEnvMod::l_find_node_near ( lua_State *  L)
staticprivate

References collectNodeIds(), CONTAINS, GET_PLAIN_ENV_PTR, ModApiBase::getClient(), MapNode::getContent(), FacePositionCache::getFacePositions(), Map::getNode(), p(), push_v3s16(), and read_v3s16().

+ Here is the call graph for this function:

◆ l_find_nodes_in_area()

int ModApiEnvMod::l_find_nodes_in_area ( lua_State *  L)
staticprivate

References collectNodeIds(), NodeDefManager::get(), GET_PLAIN_ENV_PTR, ModApiBase::getClient(), MapNode::getContent(), Map::getNode(), idx, ContentFeatures::name, p(), push_v3s16(), read_v3s16(), and sortBoxVerticies().

+ Here is the call graph for this function:

◆ l_find_nodes_in_area_under_air()

int ModApiEnvMod::l_find_nodes_in_area_under_air ( lua_State *  L)
staticprivate

References collectNodeIds(), CONTAINS, CONTENT_AIR, GET_PLAIN_ENV_PTR, ModApiBase::getClient(), MapNode::getContent(), Map::getNode(), p(), push_v3s16(), read_v3s16(), and sortBoxVerticies().

+ Here is the call graph for this function:

◆ l_find_nodes_with_meta()

int ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::l_get_connected_players ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_get_day_count()

int ModApiEnvMod::l_get_day_count ( lua_State *  L)
staticprivate

References GET_PLAIN_ENV_PTR.

◆ l_get_gametime()

int ModApiEnvMod::l_get_gametime ( lua_State *  L)
staticprivate

References GET_ENV_PTR.

◆ l_get_meta()

int ModApiEnvMod::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 ModApiEnvMod::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()

int ModApiEnvMod::l_get_node ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_get_node_level()

int ModApiEnvMod::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 ModApiEnvMod::l_get_node_light ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_get_node_max_level()

int ModApiEnvMod::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_or_nil()

int ModApiEnvMod::l_get_node_or_nil ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_get_node_timer()

int ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::l_get_perlin_map ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_get_player_by_name()

int ModApiEnvMod::l_get_player_by_name ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_get_timeofday()

int ModApiEnvMod::l_get_timeofday ( lua_State *  L)
staticprivate

References GET_PLAIN_ENV_PTR.

◆ l_get_translated_string()

int ModApiEnvMod::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 ModApiEnvMod::l_get_voxel_manip ( lua_State *  L)
staticprivate

References GET_ENV_PTR, and read_v3s16().

+ Here is the call graph for this function:

◆ l_line_of_sight()

int ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::l_place_node ( lua_State *  L)
staticprivate

References CONTENT_IGNORE, NodeDefManager::get(), GET_ENV_PTR, MapNode::getContent(), ModApiBase::getServer(), ScriptApiItem::item_OnPlace(), ContentFeatures::name, PointedThing::node_abovesurface, PointedThing::node_undersurface, POINTEDTHING_NODE, read_v3s16(), readnode(), and PointedThing::type.

+ Here is the call graph for this function:

◆ l_punch_node()

int ModApiEnvMod::l_punch_node ( lua_State *  L)
staticprivate

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

+ Here is the call graph for this function:

◆ l_raycast()

int ModApiEnvMod::l_raycast ( lua_State *  L)
staticprivate

References LuaRaycast::create_object().

+ Here is the call graph for this function:

◆ l_remove_node()

int ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::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 ModApiEnvMod::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()

◆ l_swap_node()

int ModApiEnvMod::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 ModApiEnvMod::l_transforming_liquid_add ( lua_State *  L)
staticprivate

References GET_ENV_PTR, and read_v3s16().

+ Here is the call graph for this function:

Member Data Documentation

◆ es_ClearObjectsMode

struct EnumString ModApiEnvMod::es_ClearObjectsMode[]
static

Referenced by l_clear_objects().


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