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

#include <l_env.h>

+ Inheritance diagram for ModApiEnvBase:
+ Collaboration diagram for ModApiEnvBase:

Static Protected Member Functions

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

static const EnumString es_ClearObjectsMode []
 
static const EnumString es_BlockStatusType []
 

Additional Inherited Members

- 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.
 
- 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.
 

Member Function Documentation

◆ checkArea()

void ModApiEnvBase::checkArea ( v3s16 minp,
v3s16 maxp 
)
staticprotected

References CLAMP, and VoxelArea::getVolume().

Referenced by ModApiEnv::l_find_nodes_in_area(), ModApiEnvVM::l_find_nodes_in_area(), ModApiEnv::l_find_nodes_in_area_under_air(), and ModApiEnvVM::l_find_nodes_in_area_under_air().

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

◆ collectNodeIds()

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

References NodeDefManager::getIds(), and idx.

Referenced by ModApiEnv::l_find_node_near(), ModApiEnvVM::l_find_node_near(), ModApiEnv::l_find_nodes_in_area(), ModApiEnvVM::l_find_nodes_in_area(), ModApiEnv::l_find_nodes_in_area_under_air(), and ModApiEnvVM::l_find_nodes_in_area_under_air().

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

◆ findNodeNear()

template<typename F >
int ModApiEnvBase::findNodeNear ( lua_State *  L,
v3s16  pos,
int  radius,
const std::vector< content_t > &  filter,
int  start_radius,
F &&  getNode 
)
staticprotected

References CONTAINS, FacePositionCache::getFacePositions(), p(), and push_v3s16().

Referenced by ModApiEnv::l_find_node_near(), and ModApiEnvVM::l_find_node_near().

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

◆ findNodesInArea()

template<typename F >
int ModApiEnvBase::findNodesInArea ( lua_State *  L,
const NodeDefManager ndef,
const std::vector< content_t > &  filter,
bool  grouped,
F &&  iterate 
)
staticprotected

References NodeDefManager::get(), MapNode::getContent(), idx, ContentFeatures::name, p(), and push_v3s16().

Referenced by ModApiEnv::l_find_nodes_in_area(), and ModApiEnvVM::l_find_nodes_in_area().

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

◆ findNodesInAreaUnderAir()

template<typename F >
int ModApiEnvBase::findNodesInAreaUnderAir ( lua_State *  L,
v3s16  minp,
v3s16  maxp,
const std::vector< content_t > &  filter,
F &&  getNode 
)
staticprotected

References CONTAINS, CONTENT_AIR, p(), and push_v3s16().

Referenced by ModApiEnv::l_find_nodes_in_area_under_air(), and ModApiEnvVM::l_find_nodes_in_area_under_air().

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

Member Data Documentation

◆ es_BlockStatusType

const EnumString ModApiEnvBase::es_BlockStatusType
staticprotected
Initial value:
=
{
{0, NULL},
}
@ BS_EMERGING
Definition: serverenvironment.h:370
@ BS_ACTIVE
Definition: serverenvironment.h:372
@ BS_LOADED
Definition: serverenvironment.h:371
@ BS_UNKNOWN
Definition: serverenvironment.h:369

Referenced by ModApiEnv::l_compare_block_status().

◆ es_ClearObjectsMode

const EnumString ModApiEnvBase::es_ClearObjectsMode
staticprotected
Initial value:
=
{
{0, NULL},
}
@ CLEAR_OBJECTS_MODE_QUICK
Definition: serverenvironment.h:216
@ CLEAR_OBJECTS_MODE_FULL
Definition: serverenvironment.h:212

Referenced by ModApiEnv::l_clear_objects().


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