From: Perttu Ahola Date: Sat, 31 Mar 2012 11:27:40 +0000 (+0300) Subject: Leaf decay drops saplings X-Git-Tag: 0.4.dev-20120408~15 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fe315ac1eb71ddbd9d6ab365880b7bd9a87bc95a;p=oweals%2Fminetest_game.git Leaf decay drops saplings --- diff --git a/mods/default/leafdecay.lua b/mods/default/leafdecay.lua index 0fa894a1..a3df9eb7 100644 --- a/mods/default/leafdecay.lua +++ b/mods/default/leafdecay.lua @@ -69,6 +69,19 @@ minetest.register_abm({ end end if not do_preserve then + -- Drop stuff other than the node itself + itemstacks = minetest.get_node_drops(n0.name) + for _, itemname in ipairs(itemstacks) do + if itemname ~= n0.name then + local p_drop = { + x = p0.x - 0.5 + math.random(), + y = p0.y - 0.5 + math.random(), + z = p0.z - 0.5 + math.random(), + } + minetest.env:add_item(p_drop, itemname) + end + end + -- Remove node minetest.env:remove_node(p0) end end