tuned leaf decay somewhat - palms need a separate ABM because they have such
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Mon, 11 Feb 2013 05:27:58 +0000 (00:27 -0500)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Mon, 11 Feb 2013 05:27:58 +0000 (00:27 -0500)
wide leaves.

init.lua
node_defs.lua

index 2dfd61809cd03f55d637c661bb1369f1368e0c77..405e75ba4b8906a2fe460c29fbf825906cf822f5 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -235,10 +235,10 @@ end
 
 -- leaf decay
 
-
 local leafdecay_delay = 2
 local leafdecay_chance = 150
 local leafdecay_radius = 5
+local palms_leafdecay_radius = 8
 
 minetest.register_abm({
        nodenames = moretrees.leaves_list,
@@ -252,4 +252,15 @@ minetest.register_abm({
        end
 })
 
+minetest.register_abm({
+       nodenames = "moretrees:palm_leaves",
+       interval = leafdecay_delay,
+       chance = leafdecay_chance,
+       action = function(pos, node, active_object_count, active_object_count_wider)
+               if not minetest.env:find_node_near(pos, palms_leafdecay_radius, moretrees.trunks_list) then
+                       minetest.env:remove_node(pos)
+                       minetest.env:dig_node(pos)
+               end
+       end
+})
 print("[Moretrees] Loaded (2013-01-18)")
index c832b6dab9be487a29ecca71394284c41a44d941..a69fe530574873f4a75ce29bce491ff569074cb1 100644 (file)
@@ -134,8 +134,11 @@ for i in ipairs(trees) do
 
        table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_trunk")
        table.insert(moretrees.avoidnodes, "moretrees:"..treename.."_leaves")
-       table.insert(moretrees.leaves_list, "moretrees:"..treename.."_leaves")
        table.insert(moretrees.trunks_list, "moretrees:"..treename.."_trunk")
+       if treename ~= "palm" then 
+               table.insert(moretrees.leaves_list, "moretrees:"..treename.."_leaves")
+       end
+
 end
 
 -- Extra leaves for jungle trees: