projects
/
oweals
/
minetest_game.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab84afd
)
Leaf decay drops saplings
author
Perttu Ahola
<celeron55@gmail.com>
Sat, 31 Mar 2012 11:27:40 +0000
(14:27 +0300)
committer
Perttu Ahola
<celeron55@gmail.com>
Sat, 31 Mar 2012 11:27:40 +0000
(14:27 +0300)
mods/default/leafdecay.lua
patch
|
blob
|
history
diff --git
a/mods/default/leafdecay.lua
b/mods/default/leafdecay.lua
index 0fa894a15dce6aa08fa2d4fc4904da5c24f0eeac..a3df9eb71f7d620f7139ca9224f144273e00f976 100644
(file)
--- 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