Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Control leaf decay with sneak.
As requested by @paramat.
Leaves are preserved by default and only decay when using place + sneak.
  • Loading branch information
MT-Modder authored and paramat committed Feb 23, 2016
1 parent ea2a7d3 commit 3a55e19
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mods/default/functions.lua
Expand Up @@ -257,9 +257,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 not 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({
Expand Down

0 comments on commit 3a55e19

Please sign in to comment.