1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-08 11:30:21 +01:00

Force use of old growth method for default trees

- Temporary solution to #150 until `minetest.place_schematic` is fixed
This commit is contained in:
LeMagnesium 2015-08-25 15:31:21 +02:00
parent 3c094e6d57
commit ebecdf0a8e

View File

@ -36,27 +36,27 @@ minetest.register_abm({
if node.name == "default:sapling" then if node.name == "default:sapling" then
minetest.log("action", "A sapling grows into a tree at ".. minetest.log("action", "A sapling grows into a tree at "..
minetest.pos_to_string(pos)) minetest.pos_to_string(pos))
if mapgen == "v6" then -- if mapgen == "v6" then
default.grow_tree(pos, random(1, 4) == 1) default.grow_tree(pos, random(1, 4) == 1)
else -- else
default.grow_new_apple_tree(pos) -- default.grow_new_apple_tree(pos)
end -- end
elseif node.name == "default:junglesapling" then elseif node.name == "default:junglesapling" then
minetest.log("action", "A jungle sapling grows into a tree at ".. minetest.log("action", "A jungle sapling grows into a tree at "..
minetest.pos_to_string(pos)) minetest.pos_to_string(pos))
if mapgen == "v6" then -- if mapgen == "v6" then
default.grow_jungle_tree(pos) default.grow_jungle_tree(pos)
else -- else
default.grow_new_jungle_tree(pos) -- default.grow_new_jungle_tree(pos)
end -- end
elseif node.name == "default:pine_sapling" then elseif node.name == "default:pine_sapling" then
minetest.log("action", "A pine sapling grows into a tree at ".. minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos)) minetest.pos_to_string(pos))
if mapgen == "v6" then -- if mapgen == "v6" then
default.grow_pine_tree(pos) default.grow_pine_tree(pos)
else -- else
default.grow_new_pine_tree(pos) -- default.grow_new_pine_tree(pos)
end -- end
elseif node.name == "default:acacia_sapling" then elseif node.name == "default:acacia_sapling" then
minetest.log("action", "An acacia sapling grows into a tree at ".. minetest.log("action", "An acacia sapling grows into a tree at "..
minetest.pos_to_string(pos)) minetest.pos_to_string(pos))
@ -369,7 +369,7 @@ end
function default.grow_new_jungle_tree(pos) function default.grow_new_jungle_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts" local path = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, minetest.place_schematic({x = pos.x - 2, y = pos.y, z = pos.z - 2},
path, 0, nil, false) path, 0, nil, false)
end end