mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Add core.remove_detached_inventory (#7684)
Breaks backwards compatibility for good Bump protocol version
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user