summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-02-11 00:09:53 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-02-11 00:09:53 -0500
commit966c5fc4b0c76408bc5c83e1b03bd175732485f8 (patch)
tree63461e4f7ecbf528b0e0ffc8fed47bb178d8c439 /init.lua
parentff976f715105afc24120a33a3017e055614ce677 (diff)
added leafdecay, fixed broken birch sideways trunk recipe, made all cones +
apple fall when they have nothing to hang onto.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua21
1 files changed, 20 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index fbd2c6c..2dfd618 100644
--- a/init.lua
+++ b/init.lua
@@ -64,7 +64,7 @@ plantslib:register_generate_plant(moretrees.beech_biome, moretrees.beech_model)
local sapling_interval = 500
local sapling_chance = 20
-for i in ipairs(simple_trees) do
+for i in ipairs(moretrees.simple_trees) do
local tree_name = trees[i][1]
local tree_model = tree_name.."_model"
local tree_biome = tree_name.."_biome"
@@ -233,4 +233,23 @@ if CONIFERS_REMOVE_TREES == true then
})
end
+-- leaf decay
+
+
+local leafdecay_delay = 2
+local leafdecay_chance = 150
+local leafdecay_radius = 5
+
+minetest.register_abm({
+ nodenames = moretrees.leaves_list,
+ 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, leafdecay_radius, moretrees.trunks_list) then
+ minetest.env:remove_node(pos)
+ minetest.env:dig_node(pos)
+ end
+ end
+})
+
print("[Moretrees] Loaded (2013-01-18)")