summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-01-20 13:38:23 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-01-20 13:38:23 -0500
commitd37d847fddf6c6274dbbc9fa916c8ab533026b57 (patch)
tree24717fcc7e587b6e2d4c45e6f3a4ad816c5d20ff /init.lua
parent0125bc13b9f51b72f4bc28eec1e1cfca321ccc49 (diff)
Added sapling spawning, tuned rarity of some of the trees.
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/init.lua b/init.lua
index bdbcc7a..2efb3c5 100644
--- a/init.lua
+++ b/init.lua
@@ -34,6 +34,8 @@ dofile(minetest.get_modpath("moretrees").."/node_defs.lua")
dofile(minetest.get_modpath("moretrees").."/tree_models.lua")
dofile(minetest.get_modpath("moretrees").."/biome_defs.lua")
+-- tree spawning setup
+
plantslib:register_generate_plant(moretrees.apple_tree_biome, moretrees.apple_tree_model)
plantslib:register_generate_plant(moretrees.oak_biome, moretrees.oak_model)
plantslib:register_generate_plant(moretrees.sequoia_biome, moretrees.sequoia_model)
@@ -57,6 +59,37 @@ minetest.register_alias("mapgen_leaves", "air")
plantslib:register_generate_plant(moretrees.beech_biome, moretrees.beech_model)
]]--
+-- sapling growth setup
+
+local sapling_interval = 1
+local sapling_chance = 1
+for i in ipairs(simple_trees) do
+ local tree_name = trees[i][1]
+ local tree_model = tree_name.."_model"
+ print(dump(moretrees[tree_model]))
+
+ plantslib:grow_plants(
+ sapling_interval,
+ sapling_chance,
+ "moretrees:"..tree_name.."_sapling",
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ nil,
+ moretrees[tree_model],
+ nil
+ )
+end
+
+plantslib:grow_plants(sapling_interval,sapling_chance,"moretrees:birch_sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_birch",nil)
+plantslib:grow_plants(sapling_interval,sapling_chance,"moretrees:spruce_sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_spruce",nil)
+plantslib:grow_plants(sapling_interval,sapling_chance,"conifers:sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_conifer",nil)
+plantslib:grow_plants(sapling_interval,sapling_chance,"jungletree:sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_jungletree",nil)
+
-- Code to spawn a birch tree
function moretrees:grow_birch(pos)