forked from minetest/minetest_game
Control leaf decay with sneak.
As requested by @paramat. Leaves are preserved by default and only decay when using place + sneak.
This commit is contained in:
parent
ea2a7d3b1f
commit
3a55e19055
@ -257,9 +257,11 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
|
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
|
||||||
local node = minetest.get_node(pos)
|
if placer and not placer:get_player_control().sneak then
|
||||||
node.param2 = 1
|
local node = minetest.get_node(pos)
|
||||||
minetest.set_node(pos, node)
|
node.param2 = 1
|
||||||
|
minetest.set_node(pos, node)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
|
Loading…
Reference in New Issue
Block a user