1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
local cave_nodes = { -- Default stairs/slabs/panels/microblocks:
"caverealms:glow_crystal",
"caverealms:glow_emerald",
"caverealms:glow_mese",
"caverealms:glow_ore",
"caverealms:glow_emerald_ore",
"caverealms:glow_ruby",
"caverealms:glow_amethyst",
"caverealms:glow_ruby_ore",
"caverealms:salt_crystal",
"caverealms:stone_with_salt",
"caverealms:glow_obsidian",
"caverealms:glow_obsidian_glass",
}
for _, name in pairs(cave_nodes) do
local nodename = "caverealms:"..name
local a,b = string.find(name, ":")
if b then
nodename = name
name = string.sub(name, b+1)
end
local ndef = minetest.registered_nodes[nodename]
if ndef then
local drop
if type(ndef.drop) == "string" then
drop = ndef.drop:sub((b or 8)+1)
end
local tiles = ndef.tiles
if #ndef.tiles > 1 and ndef.drawtype:find("glass") then
tiles = { ndef.tiles[1] }
end
stairsplus:register_all("caverealms", name, nodename, {
description = ndef.description,
drop = drop,
groups = ndef.groups,
sounds = ndef.sounds,
tiles = tiles,
sunlight_propagates = true,
light_source = ndef.light_source
})
end
end
|