forked from minetest-mods/item_drop
Make items (that are close to the player) dissapear after the time, that is specified by remove_items in minetest.conf
This commit is contained in:
parent
56a1d32476
commit
f77e83e657
7
init.lua
7
init.lua
|
@ -85,6 +85,13 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
z = -z
|
||||
end
|
||||
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
|
||||
|
||||
-- FIXME this doesnt work for deactiveted objects
|
||||
if minetest.setting_get("remove_items") and tonumber(minetest.setting_get("remove_items")) then
|
||||
minetest.after(tonumber(minetest.setting_get("remove_items")), function(obj)
|
||||
obj:remove()
|
||||
end, obj)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user