Minetest  5.4.0
LuaVoxelManip Class Reference

#include <l_vmanip.h>

+ Inheritance diagram for LuaVoxelManip:
+ Collaboration diagram for LuaVoxelManip:

Public Member Functions

 LuaVoxelManip (MMVManip *mmvm, bool is_mapgen_vm)
 
 LuaVoxelManip (Map *map, v3s16 p1, v3s16 p2)
 
 LuaVoxelManip (Map *map)
 
 ~LuaVoxelManip ()
 

Static Public Member Functions

static int create_object (lua_State *L)
 
static LuaVoxelManipcheckobject (lua_State *L, int narg)
 
static void Register (lua_State *L)
 
- 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...
 

Public Attributes

MMVManipvm = nullptr
 

Static Private Member Functions

static int gc_object (lua_State *L)
 
static int l_read_from_map (lua_State *L)
 
static int l_get_data (lua_State *L)
 
static int l_set_data (lua_State *L)
 
static int l_write_to_map (lua_State *L)
 
static int l_get_node_at (lua_State *L)
 
static int l_set_node_at (lua_State *L)
 
static int l_update_map (lua_State *L)
 
static int l_update_liquids (lua_State *L)
 
static int l_calc_lighting (lua_State *L)
 
static int l_set_lighting (lua_State *L)
 
static int l_get_light_data (lua_State *L)
 
static int l_set_light_data (lua_State *L)
 
static int l_get_param2_data (lua_State *L)
 
static int l_set_param2_data (lua_State *L)
 
static int l_was_modified (lua_State *L)
 
static int l_get_emerged_area (lua_State *L)
 

Private Attributes

std::map< v3s16, MapBlock * > modified_blocks
 
bool is_mapgen_vm = false
 

Static Private Attributes

static const char className [] = "VoxelManip"
 
static const luaL_Reg methods []
 

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

Constructor & Destructor Documentation

◆ LuaVoxelManip() [1/3]

LuaVoxelManip::LuaVoxelManip ( MMVManip mmvm,
bool  is_mapgen_vm 
)

Referenced by create_object().

+ Here is the caller graph for this function:

◆ LuaVoxelManip() [2/3]

LuaVoxelManip::LuaVoxelManip ( Map map,
v3s16  p1,
v3s16  p2 
)

References getNodeBlockPos(), MMVManip::initialEmerge(), sortBoxVerticies(), and vm.

+ Here is the call graph for this function:

◆ LuaVoxelManip() [3/3]

LuaVoxelManip::LuaVoxelManip ( Map map)

◆ ~LuaVoxelManip()

LuaVoxelManip::~LuaVoxelManip ( )

References is_mapgen_vm, and vm.

Member Function Documentation

◆ checkobject()

LuaVoxelManip * LuaVoxelManip::checkobject ( lua_State *  L,
int  narg 
)
static

◆ create_object()

int LuaVoxelManip::create_object ( lua_State *  L)
static

References LuaVoxelManip(), check_v3s16(), className, and GET_ENV_PTR.

Referenced by Register().

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

◆ gc_object()

int LuaVoxelManip::gc_object ( lua_State *  L)
staticprivate

Referenced by Register().

+ Here is the caller graph for this function:

◆ l_calc_lighting()

int LuaVoxelManip::l_calc_lighting ( lua_State *  L)
staticprivate

◆ l_get_data()

int LuaVoxelManip::l_get_data ( lua_State *  L)
staticprivate

References checkobject(), MapNode::getContent(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, NO_MAP_LOCK_REQUIRED, and vm.

+ Here is the call graph for this function:

◆ l_get_emerged_area()

int LuaVoxelManip::l_get_emerged_area ( lua_State *  L)
staticprivate

References checkobject(), VoxelManipulator::m_area, VoxelArea::MaxEdge, VoxelArea::MinEdge, NO_MAP_LOCK_REQUIRED, push_v3s16(), and vm.

+ Here is the call graph for this function:

◆ l_get_light_data()

int LuaVoxelManip::l_get_light_data ( lua_State *  L)
staticprivate

References checkobject(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, NO_MAP_LOCK_REQUIRED, MapNode::param1, and vm.

+ Here is the call graph for this function:

◆ l_get_node_at()

int LuaVoxelManip::l_get_node_at ( lua_State *  L)
staticprivate

References check_v3s16(), checkobject(), Server::getNodeDefManager(), VoxelManipulator::getNodeNoExNoEmerge(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, pushnode(), and vm.

+ Here is the call graph for this function:

◆ l_get_param2_data()

int LuaVoxelManip::l_get_param2_data ( lua_State *  L)
staticprivate

References checkobject(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, NO_MAP_LOCK_REQUIRED, MapNode::param2, and vm.

+ Here is the call graph for this function:

◆ l_read_from_map()

int LuaVoxelManip::l_read_from_map ( lua_State *  L)
staticprivate

References check_v3s16(), checkobject(), getNodeBlockPos(), MMVManip::initialEmerge(), VoxelManipulator::m_area, MAP_LOCK_REQUIRED, VoxelArea::MaxEdge, VoxelArea::MinEdge, push_v3s16(), sortBoxVerticies(), and vm.

+ Here is the call graph for this function:

◆ l_set_data()

int LuaVoxelManip::l_set_data ( lua_State *  L)
staticprivate

References checkobject(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, NO_MAP_LOCK_REQUIRED, MapNode::setContent(), and vm.

+ Here is the call graph for this function:

◆ l_set_light_data()

int LuaVoxelManip::l_set_light_data ( lua_State *  L)
staticprivate

References checkobject(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, NO_MAP_LOCK_REQUIRED, MapNode::param1, and vm.

+ Here is the call graph for this function:

◆ l_set_lighting()

int LuaVoxelManip::l_set_lighting ( lua_State *  L)
staticprivate

References check_v3s16(), checkobject(), VoxelArea::contains(), getintfield_default(), is_mapgen_vm, VoxelManipulator::m_area, MAP_BLOCKSIZE, VoxelArea::MaxEdge, VoxelArea::MinEdge, NO_MAP_LOCK_REQUIRED, Mapgen::setLighting(), sortBoxVerticies(), Mapgen::vm, vm, and warningstream.

+ Here is the call graph for this function:

◆ l_set_node_at()

int LuaVoxelManip::l_set_node_at ( lua_State *  L)
staticprivate

References check_v3s16(), checkobject(), Server::getNodeDefManager(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, readnode(), VoxelManipulator::setNodeNoEmerge(), and vm.

+ Here is the call graph for this function:

◆ l_set_param2_data()

int LuaVoxelManip::l_set_param2_data ( lua_State *  L)
staticprivate

References checkobject(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, NO_MAP_LOCK_REQUIRED, MapNode::param2, and vm.

+ Here is the call graph for this function:

◆ l_update_liquids()

int LuaVoxelManip::l_update_liquids ( lua_State *  L)
staticprivate

References checkobject(), GET_ENV_PTR, Server::getNodeDefManager(), ModApiBase::getServer(), VoxelManipulator::m_area, Map::m_transforming_liquid, VoxelArea::MaxEdge, VoxelArea::MinEdge, Mapgen::ndef, Mapgen::updateLiquid(), Mapgen::vm, and vm.

+ Here is the call graph for this function:

◆ l_update_map()

int LuaVoxelManip::l_update_map ( lua_State *  L)
staticprivate

◆ l_was_modified()

int LuaVoxelManip::l_was_modified ( lua_State *  L)
staticprivate

References checkobject(), MMVManip::m_is_dirty, NO_MAP_LOCK_REQUIRED, and vm.

+ Here is the call graph for this function:

◆ l_write_to_map()

int LuaVoxelManip::l_write_to_map ( lua_State *  L)
staticprivate

References voxalgo::blit_back_with_light(), MMVManip::blitBackAll(), checkobject(), Map::dispatchEvent(), GET_ENV_PTR, is_mapgen_vm, MAP_LOCK_REQUIRED, MEET_OTHER, modified_blocks, MapEditEvent::type, and vm.

+ Here is the call graph for this function:

◆ Register()

void LuaVoxelManip::Register ( lua_State *  L)
static

References className, create_object(), gc_object(), and methods.

Referenced by ServerScripting::InitializeModApi().

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

Member Data Documentation

◆ className

const char LuaVoxelManip::className = "VoxelManip"
staticprivate

◆ is_mapgen_vm

bool LuaVoxelManip::is_mapgen_vm = false
private

◆ methods

const luaL_Reg LuaVoxelManip::methods
staticprivate
Initial value:
= {
luamethod(LuaVoxelManip, read_from_map),
luamethod(LuaVoxelManip, get_node_at),
luamethod(LuaVoxelManip, set_node_at),
luamethod(LuaVoxelManip, write_to_map),
luamethod(LuaVoxelManip, update_map),
luamethod(LuaVoxelManip, update_liquids),
luamethod(LuaVoxelManip, calc_lighting),
luamethod(LuaVoxelManip, set_lighting),
luamethod(LuaVoxelManip, get_light_data),
luamethod(LuaVoxelManip, set_light_data),
luamethod(LuaVoxelManip, get_param2_data),
luamethod(LuaVoxelManip, set_param2_data),
luamethod(LuaVoxelManip, was_modified),
luamethod(LuaVoxelManip, get_emerged_area),
{0,0}
}
Definition: l_vmanip.h:34
#define luamethod(class, name)
Definition: l_internal.h:31

Referenced by Register().

◆ modified_blocks

std::map<v3s16, MapBlock *> LuaVoxelManip::modified_blocks
private

Referenced by l_write_to_map().

◆ vm


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