1
0
Fork 0

Change jungle tree schematic, update jungle biome

This commit is contained in:
Wuzzy 2017-08-31 18:04:40 +02:00
parent 7fcaf68e25
commit a4363b975d
5 changed files with 42 additions and 22 deletions

View File

@ -227,7 +227,11 @@ function mcl_core.generate_tree(pos, tree_type, two_by_two)
local node local node
if tree_type == nil or tree_type == 1 then if tree_type == nil or tree_type == 1 then
mcl_core.generate_oak_tree(pos) if mg_name == "v6" then
mcl_core.generate_v6_oak_tree(pos)
else
mcl_core.generate_oak_tree(pos)
end
elseif tree_type == 2 and two_by_two then elseif tree_type == 2 and two_by_two then
mcl_core.generate_dark_oak_tree(pos) mcl_core.generate_dark_oak_tree(pos)
elseif tree_type == 3 then elseif tree_type == 3 then
@ -242,7 +246,11 @@ function mcl_core.generate_tree(pos, tree_type, two_by_two)
if two_by_two then if two_by_two then
mcl_core.generate_huge_jungle_tree(pos) mcl_core.generate_huge_jungle_tree(pos)
else else
mcl_core.generate_jungle_tree(pos) if mg_name == "v6" then
mcl_core.generate_v6_jungle_tree(pos)
else
mcl_core.generate_jungle_tree(pos)
end
end end
elseif tree_type == 6 then elseif tree_type == 6 then
mcl_core.generate_birch_tree(pos) mcl_core.generate_birch_tree(pos)
@ -250,7 +258,7 @@ function mcl_core.generate_tree(pos, tree_type, two_by_two)
end end
-- Classic oak in v6 style -- Classic oak in v6 style
local function generate_v6_oak(pos) function mcl_core.generate_v6_oak_tree(pos)
local trunk = "mcl_core:tree" local trunk = "mcl_core:tree"
local leaves = "mcl_core:leaves" local leaves = "mcl_core:leaves"
node = {name = ""} node = {name = ""}
@ -316,13 +324,9 @@ end
-- Oak -- Oak
function mcl_core.generate_oak_tree(pos) function mcl_core.generate_oak_tree(pos)
if mg_name == "v6" then local path = minetest.get_modpath("mcl_core") ..
generate_v6_oak_tree(pos) "/schematics/mcl_core_oak_classic.mts"
else minetest.place_schematic({x = pos.x - 2, y = pos.y - 1 , z = pos.z - 2}, path, "random", nil, false)
local path = minetest.get_modpath("mcl_core") ..
"/schematics/mcl_core_oak_classic.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1 , z = pos.z - 2}, path, "random", nil, false)
end
end end
-- Birch -- Birch
@ -538,7 +542,7 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
end end
-- Old jungle tree grow function from Minetest Game 0.4.15, imitating v6 jungle trees -- Old jungle tree grow function from Minetest Game 0.4.15, imitating v6 jungle trees
function mcl_core.generate_jungle_tree(pos) function mcl_core.generate_v6_jungle_tree(pos)
--[[ --[[
NOTE: Jungletree-placing code is currently duplicated in the engine NOTE: Jungletree-placing code is currently duplicated in the engine
and in games that have saplings; both are deprecated but not and in games that have saplings; both are deprecated but not
@ -584,6 +588,12 @@ function mcl_core.generate_jungle_tree(pos)
vm:update_map() vm:update_map()
end end
function mcl_core.generate_jungle_tree(pos)
local path = minetest.get_modpath("mcl_core") ..
"/schematics/mcl_core_jungle_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, path, "random", nil, false)
end
-- Generate huge jungle tree with 2×2 trunk. -- Generate huge jungle tree with 2×2 trunk.
-- With pos being the lower X and the higher Z value of the trunk. -- With pos being the lower X and the higher Z value of the trunk.
function mcl_core.generate_huge_jungle_tree(pos) function mcl_core.generate_huge_jungle_tree(pos)

View File

@ -1023,7 +1023,7 @@ local function register_decorations()
-- Oak -- Oak
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"mcl_core:dirt_with_grass"}, place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"},
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = 0.025, offset = 0.025,
@ -1044,9 +1044,9 @@ local function register_decorations()
-- Jungle tree -- Jungle tree
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt", "mcl_core:podzol"}, place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"},
sidelen = 80, sidelen = 80,
fill_ratio = 0.002, fill_ratio = 0.0025,
biomes = {"rainforest"}, biomes = {"rainforest"},
y_min = 4, y_min = 4,
y_max = mcl_vars.mg_overworld_max, y_max = mcl_vars.mg_overworld_max,
@ -1056,13 +1056,26 @@ local function register_decorations()
}) })
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt", "mcl_core:podzol"}, place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"},
sidelen = 80, sidelen = 80,
fill_ratio = 0.09, fill_ratio = 0.045,
biomes = {"rainforest", "rainforest_swamp"}, biomes = {"rainforest", "rainforest_swamp"},
y_min = 0, y_min = 1,
y_max = mcl_vars.mg_overworld_max, y_max = mcl_vars.mg_overworld_max,
schematic = minetest.get_modpath("mcl_core").."/schematics/jungle_tree.mts", schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_jungle_tree.mts",
flags = "place_center_x, place_center_z",
rotation = "random",
})
-- Oak in jungle
minetest.register_decoration({
deco_type = "schematic",
place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"},
sidelen = 80,
fill_ratio = 0.004,
biomes = {"rainforest"},
y_min = 1,
y_max = mcl_vars.mg_overworld_max,
schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_classic.mts",
flags = "place_center_x, place_center_z", flags = "place_center_x, place_center_z",
rotation = "random", rotation = "random",
}) })
@ -1348,7 +1361,7 @@ local function register_decorations()
place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"},
sidelen = 80, sidelen = 80,
noise_params = { noise_params = {
offset = 0.0096, offset = 0.0196,
scale = 0.025, scale = 0.025,
spread = {x = 250, y = 250, z = 250}, spread = {x = 250, y = 250, z = 250},
seed = 2930, seed = 2930,

View File

@ -2,8 +2,5 @@
-- Because these legacy schematics still use Minetest Game node names. -- Because these legacy schematics still use Minetest Game node names.
-- TODO: Update the offending schematics and delete this mod. -- TODO: Update the offending schematics and delete this mod.
minetest.register_alias("default:jungletree", "mcl_core:jungletree")
minetest.register_alias("default:pine_tree", "mcl_core:sprucetree") minetest.register_alias("default:pine_tree", "mcl_core:sprucetree")
minetest.register_alias("default:jungleleaves", "mcl_core:jungleleaves")
minetest.register_alias("default:pine_needles", "mcl_core:spruceleaves") minetest.register_alias("default:pine_needles", "mcl_core:spruceleaves")