From d8f3a5ee7f061c5632eaed106dfdc8d40ed87b1f Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 5 Sep 2017 08:18:00 +0200 Subject: [PATCH] Add large oak trees --- mods/ITEMS/mcl_core/functions.lua | 22 +++++++++- ...oon_small.mts => mcl_core_oak_balloon.mts} | Bin .../schematics/mcl_core_oak_large_1.mts | Bin 0 -> 218 bytes .../schematics/mcl_core_oak_large_2.mts | Bin 0 -> 309 bytes mods/ITEMS/mcl_core/schematics/oak_large.mts | Bin 0 -> 218 bytes mods/ITEMS/mcl_core/schematics/oak_large2.mts | Bin 0 -> 309 bytes mods/MAPGEN/mcl_biomes/init.lua | 38 ++++++++++++++++++ 7 files changed, 58 insertions(+), 2 deletions(-) rename mods/ITEMS/mcl_core/schematics/{mcl_core_oak_balloon_small.mts => mcl_core_oak_balloon.mts} (100%) create mode 100644 mods/ITEMS/mcl_core/schematics/mcl_core_oak_large_1.mts create mode 100644 mods/ITEMS/mcl_core/schematics/mcl_core_oak_large_2.mts create mode 100644 mods/ITEMS/mcl_core/schematics/oak_large.mts create mode 100644 mods/ITEMS/mcl_core/schematics/oak_large2.mts diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 4503c3c61..b5f801b88 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -330,13 +330,31 @@ end function mcl_core.generate_oak_tree(pos) local r = math.random(1, 12) local path + local offset + -- Balloon oak if r == 1 then - path = minetest.get_modpath("mcl_core") .. "/schematics/mcl_core_oak_balloon_small.mts" + local s = math.random(1, 12) + if s == 1 then + -- Small balloon oak + path = minetest.get_modpath("mcl_core") .. "/schematics/mcl_core_oak_balloon.mts" + offset = { x = -2, y = -1, z = -2 } + else + -- Large balloon oak + local t = math.random(1, 2) + path = minetest.get_modpath("mcl_core") .. "/schematics/mcl_core_oak_large_"..t..".mts" + if t == 1 then + offset = { x = -3, y = -1, z = -3 } + elseif t == 2 then + offset = { x = -4, y = -1, z = -4 } + end + end + -- Classic oak else path = minetest.get_modpath("mcl_core") .. "/schematics/mcl_core_oak_classic.mts" + offset = { x = -2, y = -1, z = -2 } end - minetest.place_schematic({x = pos.x - 2, y = pos.y - 1 , z = pos.z - 2}, path, "random", nil, false) + minetest.place_schematic(vector.add(pos, offset), path, "random", nil, false) end -- Birch diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_oak_balloon_small.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_oak_balloon.mts similarity index 100% rename from mods/ITEMS/mcl_core/schematics/mcl_core_oak_balloon_small.mts rename to mods/ITEMS/mcl_core/schematics/mcl_core_oak_balloon.mts diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_oak_large_1.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_oak_large_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..5da925f1be6b5344a8ba538d8773d695111c9484 GIT binary patch literal 218 zcmeYb3HD`RVPI$AWniyI1`Ny$%!!#r4E(vtIq}K)MX6RfsflH&#SFY~fs&%s)QUN8 zgBJVBgD>t>eE4`$^-0UE`;}jX#HoI@o)aP^ zY1IBcZOJE%39@oevm%dMm9ig?&`Y>xH*Jg8x7NRZ%AAbi-sYs$OSS&xefRO+{?_v4 z7f*?Ni(6rRZRJ1pOztmdx8{AeILY`@zER`1ijbf2*{qcetInA1y35EI#;>q>O}nV_ z?H5JIGdle$6&J8rGoM-6qkg_?OS9Gny+wW;v#UF_4{Al&ujvi>mg;}FX69X^yXXIL yCbUk@zqy0q$DGL0x4Z7{6bXLv_rjdD?taDRFWk3|`M=lS$H!;O1IA01d)NWOdyfwQ literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_core/schematics/oak_large.mts b/mods/ITEMS/mcl_core/schematics/oak_large.mts new file mode 100644 index 0000000000000000000000000000000000000000..5da925f1be6b5344a8ba538d8773d695111c9484 GIT binary patch literal 218 zcmeYb3HD`RVPI$AWniyI1`Ny$%!!#r4E(vtIq}K)MX6RfsflH&#SFY~fs&%s)QUN8 zgBJVBgD>t>eE4`$^-0UE`;}jX#HoI@o)aP^ zY1IBcZOJE%39@oevm%dMm9ig?&`Y>xH*Jg8x7NRZ%AAbi-sYs$OSS&xefRO+{?_v4 z7f*?Ni(6rRZRJ1pOztmdx8{AeILY`@zER`1ijbf2*{qcetInA1y35EI#;>q>O}nV_ z?H5JIGdle$6&J8rGoM-6qkg_?OS9Gny+wW;v#UF_4{Al&ujvi>mg;}FX69X^yXXIL yCbUk@zqy0q$DGL0x4Z7{6bXLv_rjdD?taDRFWk3|`M=lS$H!;O1IA01d)NWOdyfwQ literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 4722ca0e5..8c94aa8be 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -1040,6 +1040,44 @@ local function register_decorations() }) -- Oak + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, + sidelen = 80, + noise_params = { + offset = 0.00075, + scale = 0.0011, + spread = {x = 250, y = 250, z = 250}, + seed = 3, + octaves = 3, + persist = 0.66 + }, + biomes = {"deciduous_forest"}, + y_min = 1, + y_max = mcl_vars.mg_overworld_max, + schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_large_1.mts", + flags = "place_center_x, place_center_z", + rotation = "random", + }) + minetest.register_decoration({ + deco_type = "schematic", + place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, + sidelen = 80, + noise_params = { + offset = 0.00075, + scale = 0.0011, + spread = {x = 250, y = 250, z = 250}, + seed = 3, + octaves = 3, + persist = 0.66 + }, + biomes = {"deciduous_forest"}, + y_min = 1, + y_max = mcl_vars.mg_overworld_max, + schematic = minetest.get_modpath("mcl_core").."/schematics/mcl_core_oak_large_2.mts", + flags = "place_center_x, place_center_z", + rotation = "random", + }) minetest.register_decoration({ deco_type = "schematic", place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"},