1
0
mirror of https://github.com/mt-mods/moretrees.git synced 2024-12-27 03:00:24 +01:00

made birch, spruce, fir, and jungle trees spawn again

turned out to be I was using foo:bar for their function calls, which
biome_lib filters out (only group defs can use that format).  Changed
them to quoted-string "foo.bar" format.  Also, jungle trees need a
moretrees-specific copy of the default jungle trunk node so that there's
something unique to match against for the density limit.

also, made jungle trees use the same biome settings as giant tree ferns
This commit is contained in:
Vanessa Ezekowitz 2015-08-14 14:38:35 -04:00
parent 2ae8a32aa3
commit 6694b8da61
4 changed files with 34 additions and 25 deletions

View File

@ -118,18 +118,24 @@ moretrees.rubber_tree_biome = {
} }
moretrees.jungletree_biome = { moretrees.jungletree_biome = {
surface = "default:dirt_with_grass", surface = {
avoid_nodes = moretrees.avoidnodes, "default:dirt",
avoid_radius = 5, "default:dirt_with_grass",
"woodsoils:dirt_with_leaves_1",
"woodsoils:grass_with_leaves_1",
"woodsoils:grass_with_leaves_2"
},
avoid_nodes = {"moretrees:jungletree_trunk"},
max_count = 12,
avoid_radius = 3,
rarity = 85,
seed_diff = 329, seed_diff = 329,
min_elevation = -5, min_elevation = 1,
max_elevation = 10, near_nodes = {"default:jungletree"},
temp_min = 0.25, near_nodes_size = 6,
near_nodes = {"default:water_source"}, near_nodes_vertical = 2,
near_nodes_size = 20, near_nodes_count = 1,
near_nodes_count = 7, plantlife_limit = -0.9,
rarity = 10,
max_count = 10,
} }
moretrees.spruce_biome = { moretrees.spruce_biome = {
@ -180,4 +186,3 @@ moretrees.fir_biome_snow = {
delete_above = true, delete_above = true,
spawn_replace_node = true spawn_replace_node = true
} }

View File

@ -118,14 +118,13 @@ else
moretrees.spawn_rubber_tree_object = moretrees.rubber_tree_model moretrees.spawn_rubber_tree_object = moretrees.rubber_tree_model
moretrees.spawn_willow_object = moretrees.willow_model moretrees.spawn_willow_object = moretrees.willow_model
moretrees.spawn_acacia_object = moretrees.acacia_model moretrees.spawn_acacia_object = moretrees.acacia_model
moretrees.spawn_birch_object = "moretrees:grow_birch" moretrees.spawn_birch_object = "moretrees.grow_birch"
moretrees.spawn_spruce_object = "moretrees:grow_spruce" moretrees.spawn_spruce_object = "moretrees.grow_spruce"
moretrees.spawn_jungletree_object = "moretrees:grow_jungletree" moretrees.spawn_jungletree_object = "moretrees.grow_jungletree"
moretrees.spawn_fir_object = "moretrees:grow_fir" moretrees.spawn_fir_object = "moretrees.grow_fir"
moretrees.spawn_fir_snow_object = "moretrees:grow_fir_snow" moretrees.spawn_fir_snow_object = "moretrees.grow_fir_snow"
end end
if moretrees.enable_beech then if moretrees.enable_beech then
biome_lib:register_generate_plant(moretrees.beech_biome, moretrees.spawn_beech_object) biome_lib:register_generate_plant(moretrees.beech_biome, moretrees.spawn_beech_object)
end end
@ -183,7 +182,7 @@ end
-- Code to spawn a birch tree -- Code to spawn a birch tree
function moretrees:grow_birch(pos) function moretrees.grow_birch(pos)
minetest.remove_node(pos) minetest.remove_node(pos)
if math.random(1,2) == 1 then if math.random(1,2) == 1 then
minetest.spawn_tree(pos, moretrees.birch_model1) minetest.spawn_tree(pos, moretrees.birch_model1)
@ -194,7 +193,7 @@ end
-- Code to spawn a spruce tree -- Code to spawn a spruce tree
function moretrees:grow_spruce(pos) function moretrees.grow_spruce(pos)
minetest.remove_node(pos) minetest.remove_node(pos)
if math.random(1,2) == 1 then if math.random(1,2) == 1 then
minetest.spawn_tree(pos, moretrees.spruce_model1) minetest.spawn_tree(pos, moretrees.spruce_model1)
@ -219,7 +218,7 @@ moretrees.ct_rules_b1 = "[-FBf][+FBf]"
moretrees.ct_rules_a2 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A" moretrees.ct_rules_a2 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A"
moretrees.ct_rules_b2 = "[-fB][+fB]" moretrees.ct_rules_b2 = "[-fB][+fB]"
function moretrees:grow_jungletree(pos) function moretrees.grow_jungletree(pos)
local r1 = math.random(2) local r1 = math.random(2)
local r2 = math.random(3) local r2 = math.random(3)
if r1 == 1 then if r1 == 1 then
@ -259,7 +258,7 @@ end
-- code to spawn fir trees -- code to spawn fir trees
function moretrees:grow_fir(pos) function moretrees.grow_fir(pos)
if math.random(2) == 1 then if math.random(2) == 1 then
moretrees.fir_model.leaves="moretrees:fir_leaves" moretrees.fir_model.leaves="moretrees:fir_leaves"
else else
@ -286,7 +285,7 @@ end
-- same thing, but a smaller version that grows only in snow biomes -- same thing, but a smaller version that grows only in snow biomes
function moretrees:grow_fir_snow(pos) function moretrees.grow_fir_snow(pos)
if math.random(2) == 1 then if math.random(2) == 1 then
moretrees.fir_model.leaves="moretrees:fir_leaves" moretrees.fir_model.leaves="moretrees:fir_leaves"
else else

View File

@ -383,6 +383,12 @@ minetest.register_abm({
end, end,
}) })
-- To get Moretrees to generate its own jungle trees among the default mapgen
-- we need our own copy of that node, which moretrees will match against.
local jungle_tree = moretrees.clone_node("default:jungletree")
minetest.register_node("moretrees:jungletree_trunk", jungle_tree)
-- For compatibility with old nodes, recently-changed nodes, and default nodes -- For compatibility with old nodes, recently-changed nodes, and default nodes
minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk") minetest.register_alias("technic:rubber_tree_full", "moretrees:rubber_tree_trunk")
@ -411,7 +417,6 @@ minetest.register_alias("conifers:sapling", "moretrees:fir_sapling")
minetest.register_alias("moretrees:jungletree_sapling", "default:junglesapling") minetest.register_alias("moretrees:jungletree_sapling", "default:junglesapling")
minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree") minetest.register_alias("moretrees:jungletree_trunk_sideways", "moreblocks:horizontal_jungle_tree")
minetest.register_alias("moretrees:jungletree_trunk", "default:jungletree")
minetest.register_alias("moretrees:jungletree_planks", "default:junglewood") minetest.register_alias("moretrees:jungletree_planks", "default:junglewood")
minetest.register_alias("moretrees:jungletree_leaves_green", "default:jungletree_leaves") minetest.register_alias("moretrees:jungletree_leaves_green", "default:jungletree_leaves")

View File

@ -217,7 +217,7 @@ moretrees.jungletree_model={
axiom=nil, axiom=nil,
rules_a=nil, rules_a=nil,
rules_b=nil, rules_b=nil,
trunk="default:jungletree", trunk="moretrees:jungletree_trunk",
leaves="default:jungleleaves", leaves="default:jungleleaves",
leaves2=nil, leaves2=nil,
leaves2_chance=nil, leaves2_chance=nil,