illuna_aestival: add redwood sapling, fix douglasie sapling, register both to bonemeal - closes #36

master
Milan 2021-02-17 16:01:04 +01:00
parent ef4a220c6f
commit fb8eadc949
1 changed files with 18 additions and 3 deletions

View File

@ -27,7 +27,8 @@ illuna_ethereal.register_sapling = function(name, desc, texture, height)
})
end
illuna_ethereal.register_sapling(":illuna_ethereal:douglasie", "Douglasie", "douglasie_sapling", 1)
illuna_ethereal.register_sapling(":illuna_ethereal:douglasie", "Douglasie", "douglasie_sapling", 0)
illuna_ethereal.register_sapling(":ethereal:redwood", "Redwood", "redwood_sapling", 31)
illuna_ethereal.add_tree = function (pos, ofx, ofy, ofz, schem)
-- check for schematic
@ -45,9 +46,14 @@ end
local path = minetest.get_modpath("illuna_aestival").."/schematics/"
function illuna_ethereal.grow_douglasie_tree(pos)
illuna_ethereal.add_tree(pos, 5, 1, 5, path .. "douglasie.mts")
illuna_ethereal.add_tree(pos, 5, 0, 5, path .. "douglasie.mts")
end
function illuna_ethereal.grow_redwood_tree(pos)
illuna_ethereal.add_tree(pos, 8, 47, 8, path .. "redwood_tree.mts")
end
local function enough_height(pos, height)
local nod = minetest.line_of_sight(
@ -79,7 +85,11 @@ illuna_ethereal.grow_sapling = function (pos, node)
if node.name == "illuna_ethereal:douglasie_sapling"
and under == "default:dirt_with_grass" then
illuna_ethereal.grow_birch2_tree(pos)
illuna_ethereal.grow_douglasie_tree(pos)
elseif node.name == "ethereal:redwood_sapling"
and under == "ethereal:mesa_dirt" then
illuna_ethereal.grow_redwood_tree(pos)
end
end
@ -101,3 +111,8 @@ minetest.register_abm({
illuna_ethereal.grow_sapling(pos, node)
end,
})
bonemeal:add_sapling({
{ "ethereal:redwood_sapling", illuna_ethereal.grow_redwood_tree, "soil" },
{ "illuna_ethereal:douglasie_sapling", illuna_ethereal.grow_douglasie_tree, "soil" },
})