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
if tree_type == nil or tree_type == 1 then
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
mcl_core.generate_dark_oak_tree(pos)
elseif tree_type == 3 then
@ -241,16 +245,20 @@ function mcl_core.generate_tree(pos, tree_type, two_by_two)
elseif tree_type == 5 then
if two_by_two then
mcl_core.generate_huge_jungle_tree(pos)
else
if mg_name == "v6" then
mcl_core.generate_v6_jungle_tree(pos)
else
mcl_core.generate_jungle_tree(pos)
end
end
elseif tree_type == 6 then
mcl_core.generate_birch_tree(pos)
end
end
-- 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 leaves = "mcl_core:leaves"
node = {name = ""}
@ -316,14 +324,10 @@ end
-- Oak
function mcl_core.generate_oak_tree(pos)
if mg_name == "v6" then
generate_v6_oak_tree(pos)
else
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
-- Birch
function mcl_core.generate_birch_tree(pos)
@ -538,7 +542,7 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
end
-- 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
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()
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.
-- With pos being the lower X and the higher Z value of the trunk.
function mcl_core.generate_huge_jungle_tree(pos)

View File

@ -1023,7 +1023,7 @@ local function register_decorations()
-- Oak
minetest.register_decoration({
deco_type = "schematic",
place_on = {"mcl_core:dirt_with_grass"},
place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"},
sidelen = 16,
noise_params = {
offset = 0.025,
@ -1044,9 +1044,9 @@ local function register_decorations()
-- Jungle tree
minetest.register_decoration({
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,
fill_ratio = 0.002,
fill_ratio = 0.0025,
biomes = {"rainforest"},
y_min = 4,
y_max = mcl_vars.mg_overworld_max,
@ -1056,13 +1056,26 @@ local function register_decorations()
})
minetest.register_decoration({
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,
fill_ratio = 0.09,
fill_ratio = 0.045,
biomes = {"rainforest", "rainforest_swamp"},
y_min = 0,
y_min = 1,
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",
rotation = "random",
})
@ -1348,7 +1361,7 @@ local function register_decorations()
place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"},
sidelen = 80,
noise_params = {
offset = 0.0096,
offset = 0.0196,
scale = 0.025,
spread = {x = 250, y = 250, z = 250},
seed = 2930,

View File

@ -2,8 +2,5 @@
-- Because these legacy schematics still use Minetest Game node names.
-- 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:jungleleaves", "mcl_core:jungleleaves")
minetest.register_alias("default:pine_needles", "mcl_core:spruceleaves")