mirror of
https://github.com/mt-mods/moretrees.git
synced 2024-11-05 18:00:34 +01:00
6da6bda95e
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.
52 lines
1.5 KiB
Lua
52 lines
1.5 KiB
Lua
-- 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"
|
|
})
|