don't decay leaves and apple when placed by player

This commit is contained in:
BlockMen 2013-05-21 17:34:42 +03:00
parent 42ef1d10d5
commit a87b4a8e65
1 changed files with 11 additions and 0 deletions

View File

@ -299,3 +299,14 @@ minetest.register_abm({
end
end
})
--leaves and apple do not decay when placed by player
minetest.register_on_placenode(function(pos, newnode, placer, oldnode)
if placer:is_player() then
local d = minetest.registered_nodes[newnode.name].groups.leafdecay
if d or not d == 0 then
newnode.param2 = 1
minetest.env:set_node(pos, newnode)
end
end
end)