summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-02-11 00:27:58 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-02-11 00:27:58 -0500
commitc745c613af79bcc216144ef50dc310169a60be4a (patch)
tree05b309eb12a55ce4d5697fa4732ddb986c63b3d9
parent966c5fc4b0c76408bc5c83e1b03bd175732485f8 (diff)
tuned leaf decay somewhat - palms need a separate ABM because they have such
wide leaves.
-rw-r--r--init.lua13
-rw-r--r--node_defs.lua5
2 files changed, 16 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 2dfd618..405e75b 100644
--- 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)")
diff --git a/node_defs.lua b/node_defs.lua
index c832b6d..a69fe53 100644
--- a/node_defs.lua
+++ b/node_defs.lua
@@ -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: