Enable moss/lichen/algae spreading (#17)
This commit is contained in:
parent
06f2aa117f
commit
0fe98347ed
26
plants.lua
26
plants.lua
@ -163,4 +163,28 @@ minetest.register_abm({
|
||||
grow_caverealms_mushroom(pos)
|
||||
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,
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user