Luanti 5.16.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)
template<typename T>
static void registerClass (lua_State *L, 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_initialize (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)
static int l_close (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 )

References is_mapgen_vm, and vm.

Referenced by create(), create_object(), gc_object(), l_calc_lighting(), l_close(), l_get_data(), l_get_emerged_area(), l_get_light_data(), l_get_node_at(), l_get_param2_data(), l_initialize(), l_read_from_map(), l_set_data(), l_set_light_data(), l_set_lighting(), l_set_node_at(), l_set_param2_data(), l_update_liquids(), l_was_modified(), l_write_to_map(), and packIn().

Here is the caller graph for this function:

◆ LuaVoxelManip() [2/2]

LuaVoxelManip::LuaVoxelManip ( Map * map)

References vm.

◆ ~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

References LuaVoxelManip().

Referenced by Register().

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

◆ l_calc_lighting()

int LuaVoxelManip::l_calc_lighting ( lua_State * L)
staticprivate

References LuaVoxelManip(), ModApiMapgen::calc_lighting(), check_v3s16(), ModApiBase::checkObject(), is_mapgen_vm, log_deprecated(), MAP_BLOCKSIZE, LuaHelper::readParam(), sortBoxVerticies(), and vm.

Here is the call graph for this function:

◆ l_close()

int LuaVoxelManip::l_close ( lua_State * L)
staticprivate

References LuaVoxelManip(), ModApiBase::checkObject(), VoxelManipulator::clear(), is_mapgen_vm, NO_MAP_LOCK_REQUIRED, and vm.

Here is the call graph for this function:

◆ l_get_data()

int LuaVoxelManip::l_get_data ( lua_State * L)
staticprivate

References LuaVoxelManip(), ModApiBase::checkObject(), CONTENT_IGNORE, 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 LuaVoxelManip(), 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 LuaVoxelManip(), ModApiBase::checkObject(), 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 LuaVoxelManip(), 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 LuaVoxelManip(), ModApiBase::checkObject(), NO_MAP_LOCK_REQUIRED, vm, and VOXELFLAG_NO_DATA.

Here is the call graph for this function:

◆ l_initialize()

int LuaVoxelManip::l_initialize ( lua_State * L)
staticprivate

References LuaVoxelManip(), check_v3s16(), ModApiBase::checkObject(), getNodeBlockPos(), VoxelArea::hasEmptyExtent(), is_mapgen_vm, MAP_BLOCKSIZE, MAP_LOCK_REQUIRED, push_v3s16(), readnode(), sortBoxVerticies(), 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 LuaVoxelManip(), check_v3s16(), ModApiBase::checkObject(), ModApiBase::getEmergeThread(), getNodeBlockPos(), MAP_LOCK_REQUIRED, 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 LuaVoxelManip(), ModApiBase::checkObject(), NO_MAP_LOCK_REQUIRED, vm, and VOXELFLAG_NO_DATA.

Here is the call graph for this function:

◆ l_set_light_data()

int LuaVoxelManip::l_set_light_data ( lua_State * L)
staticprivate

References LuaVoxelManip(), ModApiBase::checkObject(), NO_MAP_LOCK_REQUIRED, and vm.

Here is the call graph for this function:

◆ l_set_lighting()

int LuaVoxelManip::l_set_lighting ( lua_State * L)
staticprivate

References LuaVoxelManip(), check_v3s16(), ModApiBase::checkObject(), getintfield_default(), is_mapgen_vm, log_deprecated(), MAP_BLOCKSIZE, 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 LuaVoxelManip(), 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 LuaVoxelManip(), ModApiBase::checkObject(), NO_MAP_LOCK_REQUIRED, and vm.

Here is the call graph for this function:

◆ l_update_liquids()

int LuaVoxelManip::l_update_liquids ( lua_State * L)
staticprivate

References LuaVoxelManip(), 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 LuaVoxelManip(), ModApiBase::checkObject(), is_mapgen_vm, log_deprecated(), 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 LuaVoxelManip(), 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 LuaVoxelManip(), 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(), 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

◆ methods

const luaL_Reg LuaVoxelManip::methods
staticprivate
Initial value:
= {
luamethod(LuaVoxelManip, read_from_map),
luamethod(LuaVoxelManip, initialize),
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}
}
LuaVoxelManip(MMVManip *mmvm, bool is_mapgen_vm)
Definition l_vmanip.cpp:393
#define luamethod(class, name)
Definition l_internal.h:16

Referenced by Register().

◆ vm


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