agave grows 2 to a clump and only across and downwards

This commit is contained in:
TenPlus1 2018-10-30 14:25:54 +00:00
parent 5ca1bd332b
commit a0c6e6edc0

View File

@ -270,24 +270,24 @@ minetest.register_decoration({
minetest.register_abm({ minetest.register_abm({
label = "Blue Agave growth", label = "Blue Agave growth",
nodenames = {"wine:blue_agave"}, nodenames = {"wine:blue_agave"},
neighbors = {"default:desert_sand"},
interval = 17, interval = 17,
chance = 33, chance = 33,
action = function(pos, node) action = function(pos, node)
local n = minetest.find_nodes_in_area( local n = minetest.find_nodes_in_area_under_air(
{x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
{x = pos.x + 2, y = pos.y + 1, z = pos.z + 2}, {x = pos.x + 2, y = pos.y + 1, z = pos.z + 2},
{x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
{"wine:blue_agave"}) {"wine:blue_agave"})
if #n > 3 then if #n > 2 then
-- needs to have 2 neighbors or less to propagate (3 = +itself)
return return
end end
-- find desert sand with air above -- find desert sand with air above (grow across and down only)
n = minetest.find_nodes_in_area_under_air( n = minetest.find_nodes_in_area_under_air(
{x = pos.x - 1, y = pos.y - 1, z = pos.z - 1}, {x = pos.x + 1, y = pos.y - 1, z = pos.z + 1},
{x = pos.x + 1, y = pos.y + 1, z = pos.z + 1}, {x = pos.x - 1, y = pos.y - 2, z = pos.z - 1},
{"default:desert_sand"}) {"default:desert_sand"})
-- place blue agave -- place blue agave