Skip to content
Snippets Groups Projects
Commit 3611af1d authored by SmallJoker's avatar SmallJoker
Browse files

Bones: Return bones when taking the last ItemStack

parent 809e5933
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,12 @@ minetest.register_node("bones:bones", {
on_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if meta:get_inventory():is_empty("main") then
local inv = player:get_inventory()
if inv:room_for_item("main", {name = "bones:bones"}) then
inv:add_item("main", {name = "bones:bones"})
else
minetest.add_item(pos, "bones:bones")
end
minetest.remove_node(pos)
end
end,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment