Skip to content

Commit 3a55e19

Browse files
MT-Modderparamat
MT-Modder
authored andcommittedFeb 23, 2016
Control leaf decay with sneak.
As requested by @paramat. Leaves are preserved by default and only decay when using place + sneak.
1 parent ea2a7d3 commit 3a55e19

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎mods/default/functions.lua

+5-3
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,11 @@ minetest.register_globalstep(function(dtime)
257257
end)
258258

259259
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
260-
local node = minetest.get_node(pos)
261-
node.param2 = 1
262-
minetest.set_node(pos, node)
260+
if placer and not placer:get_player_control().sneak then
261+
local node = minetest.get_node(pos)
262+
node.param2 = 1
263+
minetest.set_node(pos, node)
264+
end
263265
end
264266

265267
minetest.register_abm({

0 commit comments

Comments
 (0)
Please sign in to comment.