mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-16 23:10:18 +01:00
don't decay leaves and apple when placed by player
This commit is contained in:
parent
42ef1d10d5
commit
a87b4a8e65
|
@ -299,3 +299,14 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user