mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add core.remove_detached_inventory (#7684)
Breaks backwards compatibility for good Bump protocol version
This commit is contained in:
parent
d6f2a1c4b8
commit
0a5e77132a
8 changed files with 101 additions and 35 deletions
|
@ -536,8 +536,18 @@ int ModApiInventory::l_create_detached_inventory_raw(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
// remove_detached_inventory_raw(name)
|
||||
int ModApiInventory::l_remove_detached_inventory_raw(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
const std::string &name = luaL_checkstring(L, 1);
|
||||
lua_pushboolean(L, getServer(L)->removeDetachedInventory(name));
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ModApiInventory::Initialize(lua_State *L, int top)
|
||||
{
|
||||
API_FCT(create_detached_inventory_raw);
|
||||
API_FCT(remove_detached_inventory_raw);
|
||||
API_FCT(get_inventory);
|
||||
}
|
||||
|
|
|
@ -120,6 +120,8 @@ class ModApiInventory : public ModApiBase {
|
|||
private:
|
||||
static int l_create_detached_inventory_raw(lua_State *L);
|
||||
|
||||
static int l_remove_detached_inventory_raw(lua_State *L);
|
||||
|
||||
static int l_get_inventory(lua_State *L);
|
||||
|
||||
public:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue