Make all leaves drop as items during decay by default.
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Sun, 13 Jul 2014 07:41:31 +0000 (03:41 -0400)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Sun, 13 Jul 2014 07:41:31 +0000 (03:41 -0400)
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.

default_settings.txt
leafdecay.lua

index b67846a62a916f3831e3bdcd12d7be349fce0d36..2c08374266385d03f480d397fdca4ab72ee243b1 100644 (file)
@@ -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
index 3bce131524a13fc46186f4a661e57088c218c0aa..cf6743faf07eb6d2df24f85038490ba939c7c85c 100644 (file)
@@ -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,