Always disable leafdecay for player-placed leaves, even when 'sneaking'
authorAlex Yst <github.com.+@y.st>
Sat, 28 Sep 2019 20:10:26 +0000 (13:10 -0700)
committerParamat <paramat@users.noreply.github.com>
Sat, 28 Sep 2019 20:10:26 +0000 (21:10 +0100)
Avoids player-placed leaves decaying when building while sneaking, which is common.

mods/default/functions.lua

index 9d6c593728a795c825b1489a751f29e825b7c404..91f8bb3912b6693ba52b9148cf5b2a6327aaaef1 100644 (file)
@@ -414,7 +414,7 @@ end
 -- Prevent decay of placed leaves
 
 default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
-       if placer and placer:is_player() and not placer:get_player_control().sneak then
+       if placer and placer:is_player() then
                local node = minetest.get_node(pos)
                node.param2 = 1
                minetest.set_node(pos, node)