projects
/
oweals
/
minetest_game.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea2a7d3
)
Control leaf decay with sneak.
author
MT-Modder
<MT-Modder@users.noreply.github.com>
Mon, 22 Feb 2016 23:28:43 +0000
(18:28 -0500)
committer
paramat
<mat.gregory@virginmedia.com>
Tue, 23 Feb 2016 20:35:08 +0000
(20:35 +0000)
As requested by @paramat.
Leaves are preserved by default and only decay when using place + sneak.
mods/default/functions.lua
patch
|
blob
|
history
diff --git
a/mods/default/functions.lua
b/mods/default/functions.lua
index 3afaec880cb4511c8ed55b0640017c052d57aa6e..29506c40b8d5ad6aae4c87d278ccdc33e1e78cb2 100644
(file)
--- a/
mods/default/functions.lua
+++ b/
mods/default/functions.lua
@@
-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({