From 4db9b3076dd368939ef016d77c638bfa997752a4 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Thu, 24 Jan 2013 23:22:46 -0500 Subject: Modified tree generation and sapling growth calls to comply with new plantlife API In addition to that, there have been numerous other, smaller changes: * Tweaked palm tree model to add coconuts * Tweaked size of all "fruit" items (really just cones). Rotated their images in inventory and wield. * Changed descriptions of sideways trunks to "Sideways Xxxx Trunk" * Tweaked names of jungle tree leaves to be Jungle Tree Leaves (Xxxx) * Moved jungletree trunk, sideways trunk, sapling into nodedef loop * Renamed trunks and trunk tops to bear "_trunk" and "_trunk_top" in their filenames. * Added copies of default jungle tree trunks and tops, with naming similar to the above change. * Re-arranged init.lua to put all leaves/needles definitions in one place. * Deleted some outdated textures. * combined leaves definitions back into main loop with an exception for jungletrees (if that one is called for, it is skipped, because leaves for those trees are explicitly defined later) * Made all leaves drop saplings when dug, 1/20 chance. * Added leafdecay radii to main tree table but disabled the use of it. To be implemented in the future. Disabled leaf decay for firs. --- init.lua | 63 +++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 22 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index a05297e..94af930 100644 --- a/init.lua +++ b/init.lua @@ -59,10 +59,10 @@ minetest.register_alias("mapgen_leaves", "air") plantslib:register_generate_plant(moretrees.beech_biome, moretrees.beech_model) ]]-- --- sapling growth setup +-- sapling growth -local sapling_interval = 500 -local sapling_chance = 10 +local sapling_interval = 1 +local sapling_chance = 1 for i in ipairs(simple_trees) do local tree_name = trees[i][1] @@ -71,27 +71,46 @@ for i in ipairs(simple_trees) do plantslib:dbg(dump(moretrees[tree_biome].surface)) - plantslib:grow_plants( - sapling_interval, - sapling_chance, - "moretrees:"..tree_name.."_sapling", - nil, - nil, - moretrees[tree_biome].surface, - nil, - nil, - nil, - nil, - nil, - moretrees[tree_model], - nil - ) + plantslib:grow_plants({ + grow_delay = sapling_interval, + grow_chance = sapling_chance, + grow_plant = "moretrees:"..tree_name.."_sapling", + grow_nodes = moretrees[tree_biome].surface, + grow_function = moretrees[tree_model], + }) 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,"moretrees:fir_sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_fir",nil) -plantslib:grow_plants(sapling_interval,sapling_chance,"moretrees:jungletree_sapling",nil,nil,nil,nil,nil,nil,nil,nil,"moretrees:grow_jungletree",nil) +plantslib:grow_plants({ + grow_delay = sapling_interval, + grow_chance = sapling_chance, + grow_plant = "moretrees:birch_sapling", + grow_nodes = moretrees.birch_biome.surface, + grow_function = "moretrees:grow_birch" +}) + +plantslib:grow_plants({ + grow_delay = sapling_interval, + grow_chance = sapling_chance, + grow_plant = "moretrees:spruce_sapling", + grow_nodes = moretrees.spruce_biome.surface, + grow_function = "moretrees:grow_spruce" +}) + +plantslib:grow_plants({ + grow_delay = sapling_interval, + grow_chance = sapling_chance, + grow_plant = "moretrees:fir_sapling", + grow_nodes = moretrees.fir_biome.surface, + grow_function = "moretrees:grow_fir" +}) + +plantslib:grow_plants({ + grow_delay = sapling_interval, + grow_chance = sapling_chance, + grow_plant = "moretrees:jungletree_sapling", + grow_nodes = moretrees.jungletree_biome.surface, + grow_function = "moretrees:grow_jungletree" +}) -- Code to spawn a birch tree -- cgit v1.2.3