From a4363b975d80246bc1c9c8493c23db3cfdbc6de5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 31 Aug 2017 18:04:40 +0200 Subject: [PATCH] Change jungle tree schematic, update jungle biome --- mods/ITEMS/mcl_core/functions.lua | 32 ++++++++++++------ .../ITEMS/mcl_core/schematics/jungle_tree.mts | Bin 255 -> 0 bytes .../schematics/mcl_core_jungle_tree.mts | Bin 0 -> 134 bytes mods/MAPGEN/mcl_biomes/init.lua | 29 +++++++++++----- mods/MISC/mcl_temp_schematic_aliases/init.lua | 3 -- 5 files changed, 42 insertions(+), 22 deletions(-) delete mode 100644 mods/ITEMS/mcl_core/schematics/jungle_tree.mts create mode 100644 mods/ITEMS/mcl_core/schematics/mcl_core_jungle_tree.mts diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 8a1b813414..6d0636030f 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -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 - 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 mcl_core.generate_dark_oak_tree(pos) 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 mcl_core.generate_huge_jungle_tree(pos) 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 elseif tree_type == 6 then mcl_core.generate_birch_tree(pos) @@ -250,7 +258,7 @@ function mcl_core.generate_tree(pos, tree_type, two_by_two) 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,13 +324,9 @@ 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 + 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 -- Birch @@ -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) diff --git a/mods/ITEMS/mcl_core/schematics/jungle_tree.mts b/mods/ITEMS/mcl_core/schematics/jungle_tree.mts deleted file mode 100644 index 01a1b11a05f8bc1032b1188ae803281349871fa4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 255 zcmeYb3HD`RVPIttWMHj_f_NYRGZ~l}m=iOL7(`N1(-KQ_O02R<^U`xtb5aw_Qi~ac zP(@3MQd2ADyba3bJFLKwyECKzfS|=J_vBLv!V|B`r=6T+8|-lU_~)aKe=zw)evUo! z`82bgoAr#QWG>C%3+vN=rSWXq^x~b|=M&Ewj4Te{H{7&mMdtdqdA`2WeXQr3zbp3r zu3VqKc~9kCufMz#HWd5EbX0U+WUiaJ>B^KDR?C}bNK9P8w`y*-b((2w_iRI{RjGG0 pZe8=SR^GI%s5x}m)LF^bFU!uNv4@cSDEd^0AiMKn@4_ literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 2d8f389c03..e356820cac 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -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, diff --git a/mods/MISC/mcl_temp_schematic_aliases/init.lua b/mods/MISC/mcl_temp_schematic_aliases/init.lua index 910c25aa37..9ec7e8153c 100644 --- a/mods/MISC/mcl_temp_schematic_aliases/init.lua +++ b/mods/MISC/mcl_temp_schematic_aliases/init.lua @@ -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")