From: Vanessa Ezekowitz Date: Sun, 13 Jul 2014 07:41:31 +0000 (-0400) Subject: Make all leaves drop as items during decay by default. X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=8581d3654eb9fc7162e5824f3d9de3d196b14139;p=zefram%2Fminetest%2Fmoretrees.git Make all leaves drop as items during decay by default. This behavior can be disabled by setting... moretrees.decay_leaves_as_items = false ...in moretrees_settings.txt in your world folder, in which case leaves will simply disappear during decay, as usual. --- diff --git a/default_settings.txt b/default_settings.txt index b67846a..2c08374 100644 --- a/default_settings.txt +++ b/default_settings.txt @@ -80,3 +80,8 @@ moretrees.firs_remove_chance = 150 moretrees.sapling_interval = 500 moretrees.sapling_chance = 20 + +-- If this variable is set to true, drop leaves out as entities during leaf +-- decay, rather than just disappearing them. + +moretrees.decay_leaves_as_items = true diff --git a/leafdecay.lua b/leafdecay.lua index 3bce131..cf6743f 100644 --- a/leafdecay.lua +++ b/leafdecay.lua @@ -4,7 +4,8 @@ local process_drops = function(pos, name) local drops = minetest.get_node_drops(name) for _,dropitem in ipairs(drops) do - if dropitem ~= name then + if dropitem ~= name + or (string.find(name, "leaves") and moretrees.decay_leaves_as_items) then local newpos = { x=pos.x + math.random() - 0.5, y=pos.y + math.random() - 0.5,