1
0
mirror of https://github.com/mt-mods/moretrees.git synced 2025-06-30 23:20:45 +02:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
2023-06-07 22:10:42 +02:00
13 changed files with 572 additions and 353 deletions

View File

@ -45,7 +45,28 @@ local sand_surfaces = {
-- too cold for a palm, too... well... sandy for anything else.
}
for i in ipairs(moretrees.treelist) do
function moretrees.can_grow(pos, treename)
local surfaces
if treename == "spruce"
or treename == "fir"
or treename == "cedar"
or treename == "pine" then
surfaces = conifer_surfaces
elseif string.find(treename, "palm") then
surfaces = sand_surfaces
else
surfaces = dirt_surfaces
end
if surfaces[minetest.get_node(vector.new(pos.x, pos.y-1, pos.z)).name] then
return true
else
return false
end
end
--[[ for i in ipairs(moretrees.treelist) do
local treename = moretrees.treelist[i][1]
local tree_model = treename.."_model"
local tree_biome = treename.."_biome"
@ -87,4 +108,4 @@ for i in ipairs(moretrees.treelist) do
grow_nodes = surfaces,
grow_function = grow_function,
})
end
end ]]