diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 9d999b6a39..d6df8cc72a 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -502,38 +502,19 @@ end -- END of spruce tree functions -- --- Acacia tree (2 variants) +-- Acacia tree (multiple variants) function mcl_core.generate_acacia_tree(pos) - local r = math.random(1, 2) - local rot = math.random(0, 3) - local offset, path - if r == 1 then - path = minetest.get_modpath("mcl_core") .. - "/schematics/mcl_core_acacia_classic_1.mts" - if rot == 0 then - offset = { x = pos.x - 4, y = pos.y, z = pos.z - 2 } - elseif rot == 1 then - offset = { x = pos.x - 2, y = pos.y, z = pos.z - 4 } - elseif rot == 2 then - offset = { x = pos.x - 4, y = pos.y, z = pos.z - 2 } - else - offset = { x = pos.x - 2, y = pos.y, z = pos.z - 4 } - end - else - path = minetest.get_modpath("mcl_core") .. - "/schematics/mcl_core_acacia_classic_2.mts" - if rot == 0 then - offset = { x = pos.x - 2, y = pos.y, z = pos.z - 2 } - elseif rot == 1 then - offset = { x = pos.x - 2, y = pos.y, z = pos.z - 4 } - elseif rot == 2 then - offset = { x = pos.x - 4, y = pos.y, z = pos.z - 4 } - else - offset = { x = pos.x - 4, y = pos.y, z = pos.z - 2 } - end + local r = math.random(1, 7) + local offset = vector.new() + if r == 2 or r == 3 then + offset = { x = -4, y = -1, z = -4 } + elseif r == 4 or r == 6 or r == 7 then + offset = { x = -3, y = -1, z = -3 } + elseif r == 1 or r == 5 then + offset = { x = -5, y = -1, z = -5 } end - local angle = tostring(rot * 90) - minetest.place_schematic(offset, path, angle, nil, false) + local path = minetest.get_modpath("mcl_core") .. "/schematics/mcl_core_acacia_"..r..".mts" + minetest.place_schematic(vector.add(pos, offset), path, "random", nil, false) end -- Generate dark oak tree with 2×2 trunk. diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_1.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_1.mts new file mode 100644 index 0000000000..8685bc8550 Binary files /dev/null and b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_1.mts differ diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_2.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_2.mts new file mode 100644 index 0000000000..2d90ba23b0 Binary files /dev/null and b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_2.mts differ diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_3.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_3.mts new file mode 100644 index 0000000000..38831c3cf9 Binary files /dev/null and b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_3.mts differ diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_4.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_4.mts new file mode 100644 index 0000000000..d3c98b4373 Binary files /dev/null and b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_4.mts differ diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_5.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_5.mts new file mode 100644 index 0000000000..8c709f73bd Binary files /dev/null and b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_5.mts differ diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_6.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_6.mts new file mode 100644 index 0000000000..8a63cf185a Binary files /dev/null and b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_6.mts differ diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_7.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_7.mts new file mode 100644 index 0000000000..2ffc78d4c3 Binary files /dev/null and b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_7.mts differ diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_classic_1.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_classic_1.mts deleted file mode 100644 index ffe7bc16bc..0000000000 Binary files a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_classic_1.mts and /dev/null differ diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_classic_2.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_classic_2.mts deleted file mode 100644 index f4f418d794..0000000000 Binary files a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_classic_2.mts and /dev/null differ diff --git a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_simple.mts b/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_simple.mts deleted file mode 100644 index 1d2cf1fcea..0000000000 Binary files a/mods/ITEMS/mcl_core/schematics/mcl_core_acacia_simple.mts and /dev/null differ