From 01f5cc75151bbee43bb63038d0dc45a1cb6dbd77 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 9 Sep 2017 05:27:48 +0200 Subject: [PATCH] Add mega spruces to sapling growth --- mods/ITEMS/mcl_core/functions.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 35bb65da33..9d999b6a39 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -483,9 +483,21 @@ mcl_core.generate_spruce_tree = function(pos) end mcl_core.generate_huge_spruce_tree = function(pos) - local r = math.random(1, 3) - local path = minetest.get_modpath("mcl_core") .. "/schematics/mcl_core_spruce_huge_"..r..".mts" - minetest.place_schematic({ x = pos.x - 4, y = pos.y - 1, z = pos.z - 5 }, path, "0", nil, false) + local r1 = math.random(1, 2) + local r2 = math.random(1, 3) + local path + local offset = { x = -4, y = -1, z = -5 } + if r1 <= 2 then + -- Mega Spruce Taiga (full canopy) + path = minetest.get_modpath("mcl_core") .. "/schematics/mcl_core_spruce_huge_"..r2..".mts" + else + -- Mega Taiga (leaves only at top) + if r2 == 1 or r2 == 3 then + offset = { x = -3, y = -1, z = -4} + end + path = minetest.get_modpath("mcl_core") .. "/schematics/mcl_core_spruce_huge_up_"..r2..".mts" + end + minetest.place_schematic(vector.add(pos, offset), path, "0", nil, false) end -- END of spruce tree functions --