Enable moss/lichen/algae spreading (#17)

This commit is contained in:
Ezhh 2017-08-23 22:56:17 +01:00 committed by GitHub
parent 06f2aa117f
commit 0fe98347ed

View File

@ -163,4 +163,28 @@ minetest.register_abm({
grow_caverealms_mushroom(pos) grow_caverealms_mushroom(pos)
end end
end, end,
}) })
-- spread moss/lichen/algae to nearby cobblestone
minetest.register_abm({
label = "Caverealms stone spread",
nodenames = {
"caverealms:stone_with_moss",
"caverealms:stone_with_lichen",
"caverealms:stone_with_algae",
},
neighbors = {"air"},
interval = 16,
chance = 50,
catch_up = false,
action = function(pos, node)
local num = minetest.find_nodes_in_area_under_air(
{x = pos.x - 1, y = pos.y - 2, z = pos.z - 1},
{x = pos.x + 1, y = pos.y + 1, z = pos.z + 1},
"default:cobble")
if #num > 0 then
minetest.set_node(num[math.random(#num)], {name = node.name})
end
end,
})