Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
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)
 
 ~LuaVoxelManip ()
 

Static Public Member Functions

static int create_object (lua_State *L)
 
static void create (lua_State *L, MMVManip *mmvm, bool is_mapgen_vm)
 
static void * packIn (lua_State *L, int idx)
 
static void packOut (lua_State *L, void *ptr)
 
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 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.
 

Public Attributes

MMVManipvm = nullptr
 

Static Public Attributes

static const char className [] = "VoxelManip"
 

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

bool is_mapgen_vm = false
 

Static Private Attributes

static const luaL_Reg methods []
 

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.
 

Constructor & Destructor Documentation

◆ LuaVoxelManip() [1/2]

LuaVoxelManip::LuaVoxelManip ( MMVManip * mmvm,
bool is_mapgen_vm )

Referenced by create(), and create_object().

+ Here is the caller graph for this function:

◆ LuaVoxelManip() [2/2]

LuaVoxelManip::LuaVoxelManip ( Map * map)

◆ ~LuaVoxelManip()

LuaVoxelManip::~LuaVoxelManip ( )

References is_mapgen_vm, and vm.

Member Function Documentation

◆ create()

void LuaVoxelManip::create ( lua_State * L,
MMVManip * mmvm,
bool is_mapgen_vm )
static

References LuaVoxelManip(), className, and is_mapgen_vm.

Referenced by ModApiMapgen::l_get_mapgen_object(), ScriptApiMapgen::on_generated(), and packOut().

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

◆ create_object()

int LuaVoxelManip::create_object ( lua_State * L)
static

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

Referenced by ModApiEnv::l_get_voxel_manip(), and 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

References ModApiMapgen::calc_lighting(), check_v3s16(), ModApiBase::checkObject(), VoxelArea::contains(), is_mapgen_vm, log_deprecated(), VoxelManipulator::m_area, MAP_BLOCKSIZE, VoxelArea::MaxEdge, VoxelArea::MinEdge, LuaHelper::readParam(), sortBoxVerticies(), and vm.

+ Here is the call graph for this function:

◆ l_get_data()

int LuaVoxelManip::l_get_data ( lua_State * L)
staticprivate

References ModApiBase::checkObject(), CONTENT_IGNORE, MapNode::getContent(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, NO_MAP_LOCK_REQUIRED, vm, and VOXELFLAG_NO_DATA.

+ Here is the call graph for this function:

◆ l_get_emerged_area()

int LuaVoxelManip::l_get_emerged_area ( lua_State * L)
staticprivate

References ModApiBase::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 ModApiBase::checkObject(), MapNode::getParam1(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, NO_MAP_LOCK_REQUIRED, vm, and VOXELFLAG_NO_DATA.

+ 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(), ModApiBase::checkObject(), VoxelManipulator::getNodeNoExNoEmerge(), 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 ModApiBase::checkObject(), MapNode::getParam2(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, NO_MAP_LOCK_REQUIRED, vm, and VOXELFLAG_NO_DATA.

+ 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(), ModApiBase::checkObject(), ModApiBase::getEmergeThread(), getNodeBlockPos(), MMVManip::initialEmerge(), MMVManip::isOrphan(), VoxelManipulator::m_area, MAP_LOCK_REQUIRED, VoxelArea::MaxEdge, VoxelArea::MinEdge, push_v3s16(), sortBoxVerticies(), and vm.

Referenced by create_object().

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

◆ l_set_data()

int LuaVoxelManip::l_set_data ( lua_State * L)
staticprivate

References ModApiBase::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 ModApiBase::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(), ModApiBase::checkObject(), VoxelArea::contains(), getintfield_default(), is_mapgen_vm, log_deprecated(), VoxelManipulator::m_area, MAP_BLOCKSIZE, VoxelArea::MaxEdge, VoxelArea::MinEdge, ModApiMapgen::set_lighting(), sortBoxVerticies(), and vm.

+ 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(), ModApiBase::checkObject(), 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 ModApiBase::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 ModApiBase::checkObject(), ModApiMapgen::update_liquids(), 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 ModApiBase::checkObject(), is_mapgen_vm, log_deprecated(), 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(), ModApiBase::checkObject(), Map::dispatchEvent(), GET_ENV_PTR, ModApiBase::getEmergeThread(), is_mapgen_vm, MMVManip::isOrphan(), MEET_OTHER, LuaHelper::readParam(), MapEditEvent::type, and vm.

+ Here is the call graph for this function:

◆ packIn()

void * LuaVoxelManip::packIn ( lua_State * L,
int idx )
static

References ModApiBase::checkObject(), MMVManip::clone(), idx, is_mapgen_vm, and vm.

Referenced by Register().

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

◆ packOut()

void LuaVoxelManip::packOut ( lua_State * L,
void * ptr )
static

References create(), ModApiBase::getEnv(), Environment::getMap(), MMVManip::reparent(), and vm.

Referenced by Register().

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

◆ Register()

void LuaVoxelManip::Register ( lua_State * L)
static

References className, create_object(), gc_object(), methods, packIn(), packOut(), ModApiBase::registerClass(), and script_register_packer().

Referenced by ServerScripting::InitializeAsync(), EmergeScripting::InitializeModApi(), and 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"
static

Referenced by create(), create_object(), and Register().

◆ 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:18
#define luamethod(class, name)
Definition l_internal.h:16

Referenced by Register().

◆ vm


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