-- 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,
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)")
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: