From 6da6bda95e57ebf217b943fd134823d95a6e6465 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Mon, 11 Feb 2013 22:07:40 -0500 Subject: made leaves depend on the trunks they spawn with to avoid decaying rather than just any trunk being enough to stop just any leaves from decaying. Re-tuned the leaf decay interval/chance values accordingly. Changed a few variables to avoid possible conflicts. Added a setting to allow one to disable the new leaf decay code. Moved sapling growth code into its own file. Minor changes to comments here and there. Got rid of simple trees list (made the code do various checks in realtime instead, since it's just startup code anyway). Fixed messed-up crafting for jungle trees; condensed most of the crafting code into main craft registry loop. Mostly fixed broken aliases of default jungletrees. --- saplings.lua | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 saplings.lua (limited to 'saplings.lua') diff --git a/saplings.lua b/saplings.lua new file mode 100644 index 0000000..5d0af28 --- /dev/null +++ b/saplings.lua @@ -0,0 +1,51 @@ +-- sapling growth + +for i in ipairs(moretrees.treelist) do + local treename = moretrees.treelist[i][1] + local tree_model = treename.."_model" + local tree_biome = treename.."_biome" + + if treename ~= "birch" and treename ~= "spruce" and treename ~= "fir" and treename ~= "jungletree" then + + plantslib:dbg(dump(moretrees[tree_biome].surface)) + plantslib:grow_plants({ + grow_delay = moretrees.sapling_interval, + grow_chance = moretrees.sapling_chance, + grow_plant = "moretrees:"..treename.."_sapling", + grow_nodes = moretrees[tree_biome].surface, + grow_function = moretrees[tree_model], + }) + end +end + +plantslib:grow_plants({ + grow_delay = moretrees.sapling_interval, + grow_chance = moretrees.sapling_chance, + grow_plant = "moretrees:birch_sapling", + grow_nodes = moretrees.birch_biome.surface, + grow_function = "moretrees:grow_birch" +}) + +plantslib:grow_plants({ + grow_delay = moretrees.sapling_interval, + grow_chance = moretrees.sapling_chance, + grow_plant = "moretrees:spruce_sapling", + grow_nodes = moretrees.spruce_biome.surface, + grow_function = "moretrees:grow_spruce" +}) + +plantslib:grow_plants({ + grow_delay = moretrees.sapling_interval, + grow_chance = moretrees.sapling_chance, + grow_plant = "moretrees:fir_sapling", + grow_nodes = moretrees.fir_biome.surface, + grow_function = "moretrees:grow_fir" +}) + +plantslib:grow_plants({ + grow_delay = moretrees.sapling_interval, + grow_chance = moretrees.sapling_chance, + grow_plant = "moretrees:jungletree_sapling", + grow_nodes = moretrees.jungletree_biome.surface, + grow_function = "moretrees:grow_jungletree" +}) -- cgit v1.2.3