#include <l_itemstackmeta.h>
Public Member Functions | |
ItemStackMetaRef (LuaItemStack *istack) | |
~ItemStackMetaRef () | |
Public Member Functions inherited from MetaDataRef | |
virtual | ~MetaDataRef ()=default |
Static Public Member Functions | |
static void | create (lua_State *L, LuaItemStack *istack) |
static void | Register (lua_State *L) |
Static Public Member Functions inherited from MetaDataRef | |
static MetaDataRef * | checkAnyMetadata (lua_State *L, int narg) |
Static Public Member Functions inherited from ModApiBase | |
static ScriptApiBase * | getScriptApiBase (lua_State *L) |
static Server * | getServer (lua_State *L) |
static ServerInventoryManager * | getServerInventoryMgr (lua_State *L) |
static EmergeThread * | getEmergeThread (lua_State *L) |
static IGameDef * | getGameDef (lua_State *L) |
static Environment * | getEnv (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. | |
Static Public Attributes | |
static const char | className [] = "ItemStackMetaRef" |
Private Member Functions | |
virtual IMetadata * | getmeta (bool auto_create) |
virtual void | clearMeta () |
virtual void | reportMetadataChange (const std::string *name=nullptr) |
void | setToolCapabilities (const ToolCapabilities &caps) |
void | clearToolCapabilities () |
void | setWearBarParams (const WearBarParams ¶ms) |
void | clearWearBarParams () |
Static Private Member Functions | |
static int | l_set_tool_capabilities (lua_State *L) |
static int | l_set_wear_bar_params (lua_State *L) |
Private Attributes | |
LuaItemStack * | istack |
Static Private Attributes | |
static const luaL_Reg | methods [] |
Additional Inherited Members | |
Protected Member Functions inherited from MetaDataRef | |
virtual void | handleToTable (lua_State *L, IMetadata *meta) |
virtual bool | handleFromTable (lua_State *L, int table, IMetadata *meta) |
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 MetaDataRef | |
static void | registerMetadataClass (lua_State *L, const char *name, const luaL_Reg *methods) |
static int | gc_object (lua_State *L) |
static int | l_contains (lua_State *L) |
static int | l_get (lua_State *L) |
static int | l_get_string (lua_State *L) |
static int | l_set_string (lua_State *L) |
static int | l_get_int (lua_State *L) |
static int | l_set_int (lua_State *L) |
static int | l_get_float (lua_State *L) |
static int | l_set_float (lua_State *L) |
static int | l_get_keys (lua_State *L) |
static int | l_to_table (lua_State *L) |
static int | l_from_table (lua_State *L) |
static int | l_equals (lua_State *L) |
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. | |
ItemStackMetaRef::ItemStackMetaRef | ( | LuaItemStack * | istack | ) |
References IntrusiveReferenceCounted::grab(), and istack.
Referenced by create().
ItemStackMetaRef::~ItemStackMetaRef | ( | ) |
|
privatevirtual |
Implements MetaDataRef.
References ItemStackMetadata::clear(), LuaItemStack::getItem(), istack, and ItemStack::metadata.
|
inlineprivate |
References ItemStackMetadata::clearToolCapabilities(), LuaItemStack::getItem(), istack, and ItemStack::metadata.
Referenced by l_set_tool_capabilities().
|
inlineprivate |
References ItemStackMetadata::clearWearBarParams(), LuaItemStack::getItem(), istack, and ItemStack::metadata.
Referenced by l_set_wear_bar_params().
|
static |
References ItemStackMetaRef(), className, and istack.
Referenced by LuaItemStack::l_get_meta().
|
privatevirtual |
Implements MetaDataRef.
References LuaItemStack::getItem(), istack, and ItemStack::metadata.
|
staticprivate |
References ModApiBase::checkObject(), clearToolCapabilities(), read_tool_capabilities(), and setToolCapabilities().
|
staticprivate |
References ModApiBase::checkObject(), clearWearBarParams(), read_wear_bar_params(), and setWearBarParams().
|
static |
References className, methods, and MetaDataRef::registerMetadataClass().
Referenced by ServerScripting::InitializeAsync(), ClientScripting::InitializeModApi(), EmergeScripting::InitializeModApi(), and ServerScripting::InitializeModApi().
|
privatevirtual |
Reimplemented from MetaDataRef.
|
inlineprivate |
References LuaItemStack::getItem(), istack, ItemStack::metadata, and ItemStackMetadata::setToolCapabilities().
Referenced by l_set_tool_capabilities().
|
inlineprivate |
References LuaItemStack::getItem(), istack, ItemStack::metadata, and ItemStackMetadata::setWearBarParams().
Referenced by l_set_wear_bar_params().
|
static |
Referenced by create(), and Register().
|
private |
|
staticprivate |
Referenced by Register().