aboutsummaryrefslogtreecommitdiff
path: root/stairsplus/registrations.lua
blob: 6e44ee1ba2e0734fd8f7512dde200919e5724430 (plain)
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
-- Default stairs/slabs/panels/microblocks

local default_nodes = {
	"stone",
	"cobble",
	"mossycobble",
	"brick",
	"sandstone",
	"steelblock",
	"goldblock",
	"copperblock",
	"bronzeblock",
	"diamondblock",
	"desert_stone",
	"glass",
	"tree",
	"wood",
	"jungletree",
	"junglewood",
	"obsidian",
	"obsidian_glass",
	"stonebrick",
	"desert_stonebrick",
	"sandstonebrick",
}

for _, name in pairs(default_nodes) do
	local nodename = "default:"..name
	local ndef = minetest.registered_nodes[nodename]
	local groups = {}
	for k, v in pairs(ndef.groups) do groups[k] = v end
	local drop
	if type(ndef.drop) == "string" then
		drop = ndef.drop:sub(9)
	end
	stairsplus:register_all("moreblocks", name, nodename, {
		description = ndef.description,
		drop = drop,
		groups = groups,
		sounds = ndef.sounds,
		tiles = ndef.tiles,
		sunlight_propagates = ndef.sunlight_propagates,
	})
end