#include <l_inventory.h>
Public Member Functions | |
InvRef (const InventoryLocation &loc) | |
~InvRef ()=default | |
Static Public Member Functions | |
static void | create (lua_State *L, const InventoryLocation &loc) |
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 [] = "InvRef" |
Static Private Member Functions | |
static Inventory * | getinv (lua_State *L, InvRef *ref) |
static InventoryList * | getlist (lua_State *L, InvRef *ref, const char *listname) |
static void | reportInventoryChange (lua_State *L, InvRef *ref) |
static int | gc_object (lua_State *L) |
static int | l_is_empty (lua_State *L) |
static int | l_get_size (lua_State *L) |
static int | l_get_width (lua_State *L) |
static int | l_set_size (lua_State *L) |
static int | l_set_width (lua_State *L) |
static int | l_get_stack (lua_State *L) |
static int | l_set_stack (lua_State *L) |
static int | l_get_list (lua_State *L) |
static int | l_set_list (lua_State *L) |
static int | l_get_lists (lua_State *L) |
static int | l_set_lists (lua_State *L) |
static int | l_add_item (lua_State *L) |
static int | l_room_for_item (lua_State *L) |
static int | l_contains_item (lua_State *L) |
static int | l_remove_item (lua_State *L) |
static int | l_get_location (lua_State *L) |
Private Attributes | |
InventoryLocation | m_loc |
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. | |
InvRef::InvRef | ( | const InventoryLocation & | loc | ) |
|
default |
|
static |
References InvRef(), className, and NO_MAP_LOCK_REQUIRED.
Referenced by ScriptApiDetached::detached_inventory_AllowMove(), ScriptApiDetached::detached_inventory_AllowPut(), ScriptApiDetached::detached_inventory_AllowTake(), ScriptApiDetached::detached_inventory_OnMove(), ScriptApiDetached::detached_inventory_OnPut(), ScriptApiDetached::detached_inventory_OnTake(), ScriptApiItem::item_CraftPredict(), ScriptApiItem::item_OnCraft(), ModApiInventory::l_create_detached_inventory_raw(), ModApiInventory::l_get_inventory(), NodeMetaRef::l_get_inventory(), ObjectRef::l_get_inventory(), ScriptApiPlayer::pushMoveArguments(), and ScriptApiPlayer::pushPutTakeArguments().
|
staticprivate |
References ServerInventoryManager::getInventory(), ModApiBase::getServerInventoryMgr(), and m_loc.
Referenced by getlist(), l_get_list(), l_get_lists(), l_set_list(), l_set_lists(), l_set_size(), and l_set_width().
|
staticprivate |
References getinv(), Inventory::getList(), and NO_MAP_LOCK_REQUIRED.
Referenced by l_add_item(), l_contains_item(), l_get_size(), l_get_stack(), l_get_width(), l_is_empty(), l_remove_item(), l_room_for_item(), and l_set_stack().
|
staticprivate |
References InventoryList::addItem(), ModApiBase::checkObject(), ItemStack::count, LuaItemStack::create(), getlist(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, read_item(), and reportInventoryChange().
|
staticprivate |
References ModApiBase::checkObject(), InventoryList::containsItem(), getlist(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, read_item(), and LuaHelper::readParam().
|
staticprivate |
References ModApiBase::checkObject(), getinv(), Inventory::getList(), NO_MAP_LOCK_REQUIRED, and push_inventory_list().
|
staticprivate |
References ModApiBase::checkObject(), getinv(), NO_MAP_LOCK_REQUIRED, and push_inventory_lists().
|
staticprivate |
References ModApiBase::checkObject(), InventoryLocation::CURRENT_PLAYER, InventoryLocation::DETACHED, m_loc, InventoryLocation::name, NO_MAP_LOCK_REQUIRED, InventoryLocation::NODEMETA, InventoryLocation::p, InventoryLocation::PLAYER, push_v3s16(), InventoryLocation::type, and InventoryLocation::UNDEFINED.
|
staticprivate |
References ModApiBase::checkObject(), getlist(), InventoryList::getSize(), and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), LuaItemStack::create(), InventoryList::getItem(), getlist(), InventoryList::getSize(), and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), getlist(), InventoryList::getWidth(), and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), getlist(), InventoryList::getUsedSlots(), and NO_MAP_LOCK_REQUIRED.
|
staticprivate |
References ModApiBase::checkObject(), LuaItemStack::create(), ItemStack::empty(), getlist(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, read_item(), InventoryList::removeItem(), and reportInventoryChange().
|
staticprivate |
References ModApiBase::checkObject(), getlist(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, read_item(), and InventoryList::roomForItem().
|
staticprivate |
References ModApiBase::checkObject(), getinv(), Inventory::getList(), ModApiBase::getServer(), InventoryList::getSize(), NO_MAP_LOCK_REQUIRED, read_inventory_list(), and reportInventoryChange().
|
staticprivate |
References ModApiBase::checkObject(), Inventory::clear(), getinv(), ModApiBase::getServer(), NO_MAP_LOCK_REQUIRED, and read_inventory_list().
|
staticprivate |
References Inventory::addList(), ModApiBase::checkObject(), Inventory::deleteList(), getinv(), Inventory::getList(), NO_MAP_LOCK_REQUIRED, reportInventoryChange(), and InventoryList::setSize().
|
staticprivate |
References InventoryList::changeItem(), ModApiBase::checkObject(), getlist(), ModApiBase::getServer(), InventoryList::getSize(), NO_MAP_LOCK_REQUIRED, read_item(), and reportInventoryChange().
|
staticprivate |
References ModApiBase::checkObject(), getinv(), Inventory::getList(), NO_MAP_LOCK_REQUIRED, reportInventoryChange(), and InventoryList::setWidth().
|
static |
References className, gc_object(), methods, and ModApiBase::registerClass().
Referenced by ServerScripting::InitializeModApi().
|
staticprivate |
References ModApiBase::getServerInventoryMgr(), m_loc, and ServerInventoryManager::setInventoryModified().
Referenced by l_add_item(), l_remove_item(), l_set_list(), l_set_size(), l_set_stack(), and l_set_width().
|
static |
Referenced by create(), and Register().
|
private |
Referenced by getinv(), l_get_location(), and reportInventoryChange().
|
staticprivate |
Referenced by Register().