forked from minetest/minetest_game
Moss growth ABM: Add inner and outer cobble stairs, simplify code
This commit is contained in:
parent
b20725026e
commit
0291c6b210
|
@ -541,23 +541,26 @@ minetest.register_abm({
|
||||||
-- Moss growth on cobble near water
|
-- Moss growth on cobble near water
|
||||||
--
|
--
|
||||||
|
|
||||||
|
local moss_correspondences = {
|
||||||
|
["default:cobble"] = "default:mossycobble",
|
||||||
|
["stairs:slab_cobble"] = "stairs:slab_mossycobble",
|
||||||
|
["stairs:stair_cobble"] = "stairs:stair_mossycobble",
|
||||||
|
["stairs:stair_inner_cobble"] = "stairs:stair_inner_mossycobble",
|
||||||
|
["stairs:stair_outer_cobble"] = "stairs:stair_outer_mossycobble",
|
||||||
|
["walls:cobble"] = "walls:mossycobble",
|
||||||
|
}
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label = "Moss growth",
|
label = "Moss growth",
|
||||||
nodenames = {"default:cobble", "stairs:slab_cobble", "stairs:stair_cobble", "walls:cobble"},
|
nodenames = {"default:cobble", "stairs:slab_cobble", "stairs:stair_cobble",
|
||||||
|
"stairs:stair_inner_cobble", "stairs:stair_outer_cobble",
|
||||||
|
"walls:cobble"},
|
||||||
neighbors = {"group:water"},
|
neighbors = {"group:water"},
|
||||||
interval = 16,
|
interval = 16,
|
||||||
chance = 200,
|
chance = 200,
|
||||||
catch_up = false,
|
catch_up = false,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
if node.name == "default:cobble" then
|
node.name = moss_correspondences[node.name]
|
||||||
minetest.set_node(pos, {name = "default:mossycobble"})
|
minetest.set_node(pos, node)
|
||||||
elseif node.name == "stairs:slab_cobble" then
|
|
||||||
minetest.set_node(pos, {name = "stairs:slab_mossycobble", param2 = node.param2})
|
|
||||||
elseif node.name == "stairs:stair_cobble" then
|
|
||||||
minetest.set_node(pos, {name = "stairs:stair_mossycobble", param2 = node.param2})
|
|
||||||
elseif node.name == "walls:cobble" then
|
|
||||||
minetest.set_node(pos, {name = "walls:mossycobble", param2 = node.param2})
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user