#include <l_item.h>
Public Member Functions | |
const ItemStack & | getItem () const |
ItemStack & | getItem () |
Public Member Functions inherited from IntrusiveReferenceCounted | |
IntrusiveReferenceCounted ()=default | |
virtual | ~IntrusiveReferenceCounted ()=default |
void | grab () noexcept |
void | drop () noexcept |
Static Public Member Functions | |
static int | create_object (lua_State *L) |
static int | create (lua_State *L, const ItemStack &item) |
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 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 [] = "ItemStack" |
Private Member Functions | |
LuaItemStack (const ItemStack &item) | |
~LuaItemStack ()=default | |
Static Private Member Functions | |
static int | gc_object (lua_State *L) |
static int | mt_tostring (lua_State *L) |
static int | l_is_empty (lua_State *L) |
static int | l_get_name (lua_State *L) |
static int | l_set_name (lua_State *L) |
static int | l_get_count (lua_State *L) |
static int | l_set_count (lua_State *L) |
static int | l_get_wear (lua_State *L) |
static int | l_set_wear (lua_State *L) |
static int | l_get_meta (lua_State *L) |
static int | l_get_metadata (lua_State *L) |
static int | l_set_metadata (lua_State *L) |
static int | l_get_description (lua_State *L) |
static int | l_get_short_description (lua_State *L) |
static int | l_clear (lua_State *L) |
static int | l_replace (lua_State *L) |
static int | l_to_string (lua_State *L) |
static int | l_to_table (lua_State *L) |
static int | l_get_stack_max (lua_State *L) |
static int | l_get_free_space (lua_State *L) |
static int | l_is_known (lua_State *L) |
static int | l_get_definition (lua_State *L) |
static int | l_get_tool_capabilities (lua_State *L) |
static int | l_add_wear (lua_State *L) |
static int | l_add_wear_by_uses (lua_State *L) |
static int | l_get_wear_bar_params (lua_State *L) |
static int | l_add_item (lua_State *L) |
static int | l_item_fits (lua_State *L) |
static int | l_take_item (lua_State *L) |
static int | l_peek_item (lua_State *L) |
static int | l_equals (lua_State *L) |
Private Attributes | |
ItemStack | m_stack |
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. | |
|
private |
|
privatedefault |
|
static |
References LuaItemStack(), className, and NO_MAP_LOCK_REQUIRED.
Referenced by ScriptApiDetached::detached_inventory_AllowPut(), ScriptApiDetached::detached_inventory_AllowTake(), ScriptApiDetached::detached_inventory_OnPut(), ScriptApiDetached::detached_inventory_OnTake(), ScriptApiItem::item_CraftPredict(), ScriptApiItem::item_OnCraft(), ScriptApiItem::item_OnDrop(), ScriptApiItem::item_OnPlace(), ScriptApiItem::item_OnSecondaryUse(), ScriptApiItem::item_OnUse(), InvRef::l_add_item(), l_add_item(), ModApiCraft::l_get_craft_result(), InvRef::l_get_stack(), LuaLocalPlayer::l_get_wielded_item(), ObjectRef::l_get_wielded_item(), l_item_fits(), l_peek_item(), InvRef::l_remove_item(), l_take_item(), ScriptApiNodemeta::nodemeta_inventory_AllowPut(), ScriptApiNodemeta::nodemeta_inventory_AllowTake(), ScriptApiNodemeta::nodemeta_inventory_OnPut(), ScriptApiNodemeta::nodemeta_inventory_OnTake(), ScriptApiClient::on_item_use(), packOut(), push_items(), and ScriptApiPlayer::pushPutTakeArguments().
|
static |
References LuaItemStack(), className, ModApiBase::getGameDef(), NO_MAP_LOCK_REQUIRED, and read_item().
Referenced by Register().
|
staticprivate |
References IntrusiveReferenceCounted::drop().
Referenced by Register().
|
inline |
References m_stack.
Referenced by ItemStackMetaRef::clearMeta(), ItemStackMetaRef::clearToolCapabilities(), ItemStackMetaRef::clearWearBarParams(), ItemStackMetaRef::getmeta(), packIn(), read_item(), ItemStackMetaRef::setToolCapabilities(), and ItemStackMetaRef::setWearBarParams().
|
staticprivate |
References ItemStack::addItem(), ModApiBase::checkObject(), create(), ModApiBase::getGameDef(), m_stack, NO_MAP_LOCK_REQUIRED, and read_item().
|
staticprivate |
References ItemStack::addWear(), ModApiBase::checkObject(), ModApiBase::getGameDef(), m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ItemStack::addWear(), calculateResultWear(), ModApiBase::checkObject(), ModApiBase::getGameDef(), m_stack, NO_MAP_LOCK_REQUIRED, LuaHelper::readParam(), and ItemStack::wear.
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::clear(), m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), className, m_stack, and NO_MAP_LOCK_REQUIRED.
Referenced by Register().
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::count, m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), m_stack, ItemStack::name, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::getDescription(), ModApiBase::getGameDef(), m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::freeSpace(), ModApiBase::getGameDef(), m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), ItemStackMetaRef::create(), and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), SimpleMetadata::getString(), log_deprecated(), m_stack, ItemStack::metadata, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), m_stack, ItemStack::name, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), ModApiBase::getGameDef(), ItemStack::getShortDescription(), m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), ModApiBase::getGameDef(), ItemStack::getStackMax(), m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), ModApiBase::getGameDef(), ItemStack::getToolCapabilities(), m_stack, NO_MAP_LOCK_REQUIRED, and push_tool_capabilities().
|
staticprivate |
References ModApiBase::checkObject(), m_stack, NO_MAP_LOCK_REQUIRED, and ItemStack::wear.
|
staticprivate |
References ModApiBase::checkObject(), ModApiBase::getGameDef(), ItemStack::getWearBarParams(), m_stack, NO_MAP_LOCK_REQUIRED, and push_wear_bar_params().
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::empty(), m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), ModApiBase::getGameDef(), ItemStack::isKnown(), m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), create(), ModApiBase::getGameDef(), ItemStack::itemFits(), m_stack, NO_MAP_LOCK_REQUIRED, and read_item().
|
staticprivate |
References ModApiBase::checkObject(), create(), m_stack, NO_MAP_LOCK_REQUIRED, and ItemStack::peekItem().
|
staticprivate |
References ModApiBase::checkObject(), ModApiBase::getGameDef(), m_stack, NO_MAP_LOCK_REQUIRED, and read_item().
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::clear(), ItemStack::count, m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), log_deprecated(), m_stack, ItemStack::metadata, NO_MAP_LOCK_REQUIRED, and ItemStackMetadata::setString().
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::clear(), ItemStack::empty(), m_stack, ItemStack::name, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::clear(), m_stack, NO_MAP_LOCK_REQUIRED, and ItemStack::wear.
|
staticprivate |
References ModApiBase::checkObject(), create(), m_stack, NO_MAP_LOCK_REQUIRED, and ItemStack::takeItem().
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::getItemString(), m_stack, and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::count, ItemStack::empty(), SimpleMetadata::getString(), SimpleMetadata::getStrings(), m_stack, ItemStack::metadata, ItemStack::name, NO_MAP_LOCK_REQUIRED, and ItemStack::wear.
|
staticprivate |
References ModApiBase::checkObject(), ItemStack::getItemString(), and m_stack.
Referenced by Register().
|
static |
References ModApiBase::checkObject(), getItem(), and idx.
Referenced by Register().
|
static |
References create().
Referenced by Register().
|
static |
References className, create_object(), gc_object(), l_equals(), methods, mt_tostring(), packIn(), packOut(), ModApiBase::registerClass(), and script_register_packer().
Referenced by ServerScripting::InitializeAsync(), ClientScripting::InitializeModApi(), EmergeScripting::InitializeModApi(), and ServerScripting::InitializeModApi().
|
static |
Referenced by create(), create_object(), l_equals(), and Register().
|
private |
Referenced by getItem(), getItem(), l_add_item(), l_add_wear(), l_add_wear_by_uses(), l_clear(), l_equals(), l_get_count(), l_get_definition(), l_get_description(), l_get_free_space(), l_get_metadata(), l_get_name(), l_get_short_description(), l_get_stack_max(), l_get_tool_capabilities(), l_get_wear(), l_get_wear_bar_params(), l_is_empty(), l_is_known(), l_item_fits(), l_peek_item(), l_replace(), l_set_count(), l_set_metadata(), l_set_name(), l_set_wear(), l_take_item(), l_to_string(), l_to_table(), and mt_tostring().
|
staticprivate |
Referenced by Register().