Control whether leaves decay after placed in-game.

Hold shift while placing to preserve leaves, otherwise they'll decay like normal.
Original PR: https://github.com/minetest/minetest_game/pull/454
This commit is contained in:
MT-Modder 2016-02-13 16:03:13 -05:00
parent 04f01bc57f
commit 74c252a08f

View file

@ -270,9 +270,11 @@ minetest.register_globalstep(function(dtime)
end)
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
local node = minetest.get_node(pos)
node.param2 = 1
minetest.set_node(pos, node)
if placer and placer:get_player_control().sneak then
local node = minetest.get_node(pos)
node.param2 = 1
minetest.set_node(pos, node)
end
end
minetest.register_abm({