1
0
Fork 0
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:
SmallJoker 2018-10-10 20:48:58 +02:00 committed by GitHub
parent d6f2a1c4b8
commit 0a5e77132a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 101 additions and 35 deletions

View file

@ -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);
}

View file

@ -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: