1
0
mirror of https://github.com/mt-mods/moretrees.git synced 2024-12-25 02:00:23 +01:00

Added sapling spawning, tuned rarity of some of the trees.

This commit is contained in:
Vanessa Ezekowitz 2013-01-20 13:38:23 -05:00
parent 0125bc13b9
commit d37d847fdd
3 changed files with 41 additions and 6 deletions

View File

@ -47,13 +47,13 @@ moretrees.palm_biome = {
moretrees.apple_tree_biome = { moretrees.apple_tree_biome = {
surface = "default:dirt_with_grass", surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes, avoid_nodes = moretrees.avoidnodes,
avoid_radius = 15, avoid_radius = 10,
seed_diff = 331, seed_diff = 331,
min_elevation = 1, min_elevation = 1,
max_elevation = 10, max_elevation = 10,
temp_min = 0.1, temp_min = 0.1,
temp_max = -0.15, temp_max = -0.15,
rarity = 50, rarity = 75,
} }
moretrees.oak_biome = { moretrees.oak_biome = {
@ -117,20 +117,20 @@ moretrees.pine_biome = {
moretrees.willow_biome = { moretrees.willow_biome = {
surface = "default:dirt_with_grass", surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes, avoid_nodes = moretrees.avoidnodes,
avoid_radius = 20, avoid_radius = 10,
seed_diff = 337, seed_diff = 337,
min_elevation = -5, min_elevation = -5,
max_elevation = 5, max_elevation = 5,
near_nodes = {"default:water_source"}, near_nodes = {"default:water_source"},
near_nodes_size = 15, near_nodes_size = 15,
near_nodes_count = 5, near_nodes_count = 5,
rarity = 50, rarity = 75,
} }
moretrees.rubber_tree_biome = { moretrees.rubber_tree_biome = {
surface = "default:dirt_with_grass", surface = "default:dirt_with_grass",
avoid_nodes = moretrees.avoidnodes, avoid_nodes = moretrees.avoidnodes,
avoid_radius = 20, avoid_radius = 10,
seed_diff = 338, seed_diff = 338,
min_elevation = -5, min_elevation = -5,
max_elevation = 5, max_elevation = 5,
@ -138,7 +138,7 @@ moretrees.rubber_tree_biome = {
near_nodes_size = 15, near_nodes_size = 15,
near_nodes_count = 10, near_nodes_count = 10,
temp_min = -0.15, temp_min = -0.15,
rarity = 50, rarity = 75,
} }

View File

@ -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").."/tree_models.lua")
dofile(minetest.get_modpath("moretrees").."/biome_defs.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.apple_tree_biome, moretrees.apple_tree_model)
plantslib:register_generate_plant(moretrees.oak_biome, moretrees.oak_model) plantslib:register_generate_plant(moretrees.oak_biome, moretrees.oak_model)
plantslib:register_generate_plant(moretrees.sequoia_biome, moretrees.sequoia_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) 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 -- Code to spawn a birch tree
function moretrees:grow_birch(pos) function moretrees:grow_birch(pos)

View File

@ -37,6 +37,8 @@ trees = {
{"rubber_tree", "Rubber Tree", nil, nil, nil }, {"rubber_tree", "Rubber Tree", nil, nil, nil },
} }
simple_trees = { "beech", "apple_tree", "oak", "sequoia", "palm", "pine", "willow", "rubber_tree"}
moretrees.avoidnodes = {} moretrees.avoidnodes = {}
table.insert(moretrees.avoidnodes, "default:jungletree") table.insert(moretrees.avoidnodes, "default:jungletree")