generate podzol under huge spruce trees
parent
0c03d420b8
commit
a83a2e9aba
|
@ -620,6 +620,30 @@ function mcl_core.generate_spruce_tree(pos)
|
|||
minetest.place_schematic({ x = pos.x - 3, y = pos.y - 1, z = pos.z - 3 }, path, "0", nil, false)
|
||||
end
|
||||
|
||||
local function find_necorner(p)
|
||||
local n=minetest.get_node_or_nil(vector.offset(p,0,1,1))
|
||||
local e=minetest.get_node_or_nil(vector.offset(p,1,1,0))
|
||||
if n and n.name == "mcl_core:sprucetree" then
|
||||
p=vector.offset(p,0,0,1)
|
||||
end
|
||||
if e and e.name == "mcl_core:sprucetree" then
|
||||
p=vector.offset(p,1,0,0)
|
||||
end
|
||||
return p
|
||||
end
|
||||
|
||||
local function generate_spruce_podzol(ps)
|
||||
local pos=find_necorner(ps)
|
||||
local pos1=vector.offset(pos,-6,-6,-6)
|
||||
local pos2=vector.offset(pos,6,6,6)
|
||||
local nn=minetest.find_nodes_in_area_under_air(pos1, pos2, {"group:dirt"})
|
||||
for k,v in pairs(nn) do
|
||||
if math.random(vector.distance(pos,v)) < 4 and not (math.abs(pos.x-v.x) == 6 and math.abs(pos.z-v.z) == 6) then --leave out the corners
|
||||
minetest.set_node(v,{name="mcl_core:podzol"})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function mcl_core.generate_huge_spruce_tree(pos)
|
||||
local r1 = math.random(1, 2)
|
||||
local r2 = math.random(1, 4)
|
||||
|
@ -636,6 +660,7 @@ function mcl_core.generate_huge_spruce_tree(pos)
|
|||
path = modpath.."/schematics/mcl_core_spruce_huge_up_"..r2..".mts"
|
||||
end
|
||||
minetest.place_schematic(vector.add(pos, offset), path, "0", nil, false)
|
||||
generate_spruce_podzol(pos)
|
||||
end
|
||||
|
||||
-- END of spruce tree functions --
|
||||
|
@ -1673,4 +1698,3 @@ function mcl_core.after_snow_destruct(pos)
|
|||
local node = minetest.get_node(npos)
|
||||
mcl_core.clear_snow_dirt(npos, node)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue