flora only spreads on same dirt type it's placed
This commit is contained in:
parent
9eb042c417
commit
b35e024008
17
dirt.lua
17
dirt.lua
@ -126,18 +126,23 @@ local flower_spread = function(pos, node)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
pos.y = pos.y - 1
|
||||||
|
|
||||||
|
local under = minetest.get_node(pos)
|
||||||
|
|
||||||
|
-- make sure we have soil underneath
|
||||||
|
if minetest.get_item_group(under.name, "soil") == 0
|
||||||
|
or under.name == "default:desert_sand" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local seedling = minetest.find_nodes_in_area_under_air(
|
local seedling = minetest.find_nodes_in_area_under_air(
|
||||||
pos0, pos1, {"group:soil"})
|
pos0, pos1, {under.name})
|
||||||
|
|
||||||
if #seedling > 0 then
|
if #seedling > 0 then
|
||||||
|
|
||||||
pos = seedling[math.random(#seedling)]
|
pos = seedling[math.random(#seedling)]
|
||||||
|
|
||||||
-- default farming has desert sand as soil, so dont spread on this
|
|
||||||
if minetest.get_node(pos).name == "default:desert_sand" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
pos.y = pos.y + 1
|
pos.y = pos.y + 1
|
||||||
|
|
||||||
if (minetest.get_node_light(pos) or 0) < 13 then
|
if (minetest.get_node_light(pos) or 0) < 13 then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user