Skip to content
Snippets Groups Projects
Commit 3a55e190 authored by MT-Modder's avatar MT-Modder Committed by paramat
Browse files

Control leaf decay with sneak.

As requested by @paramat.
Leaves are preserved by default and only decay when using place + sneak.
parent ea2a7d3b
No related branches found
No related tags found
No related merge requests found
......@@ -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({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment