summaryrefslogtreecommitdiff
path: root/sandstone_cobble.lua
blob: 06407723bb06c161f7ff0336c644f1310156dc13 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
local cobble_table = {
	{name = "sandstone", desc = "Sandstone"},
	{name = "desert_sandstone", desc = "Desert Sandstone"},
	{name = "silver_sandstone", desc = "Silver Sandstone"},
}

for _,node in ipairs(cobble_table) do
	
	minetest.register_node("minetest_errata:" .. node.name .. "_cobble", {
		description = node.desc .. " Cobble",
		tiles = {"minetest_errata_" .. node.name .. "_cobble.png"},
		groups = {cracky = 3, [minetest_errata.prefix .. "sandstone"] = 1},
		is_ground_content = false,
		sounds = default.node_sound_stone_defaults(),
	})

	minetest.register_craft({
		output = "minetest_errata:" .. node.name .. "_cobble 2",
		recipe = { { "default:" .. node.name, "default:" .. node.name } },
	})

	minetest.register_craft({
		type = "cooking",
		output = "default:" .. node.name,
		recipe = "minetest_errata:" .. node.name .. "_cobble",
	})

	-- Derivative blocks

	if stairs and stairs.mod and stairs.mod == "redo" then
		
		stairs.register_all(node.name .. "_cobble", "minetest_errata:" .. node.name .. "_cobble",
			{cracky = 3},
			{"minetest_errata_" .. node.name .. "_cobble.png"},
			node.desc .. " Cobble Stair",
			node.desc .. " Cobble Slab",
			default.node_sound_wood_defaults())
		
	elseif minetest.global_exists("stairsplus") then
		
		stairsplus:register_all("minetest_errata", node.name .. "_cobble", "minetest_errata:" .. node.name .. "_cobble", {
			description = node.desc .. " Cobble",
			tiles = {"minetest_errata_" .. node.name .. "_cobble.png"},
			groups = {cracky = 3},
			sounds = default.node_sound_wood_defaults(),
		})
		
	else
		
		stairs.register_stair_and_slab(node.name .. "_cobble", "minetest_errata:" .. node.name .. "_cobble",
			{cracky = 3},
			{"minetest_errata_" .. node.name .. "_cobble.png"},
			node.desc .. " Cobble Stair",
			node.desc .. " Cobble Slab",
			default.node_sound_wood_defaults())
		
	end
	
	
	-- Walls
	walls.register("minetest_errata:wall_" .. node.name .. "_cobble", 
			node.desc .. " Cobble Wall", 
			"minetest_errata_" .. node.name .. "_cobble.png", 
			"minetest_errata:" .. node.name .. "_cobble",
			default.node_sound_stone_defaults()
		)
	
	-- procedurally-generated arcs
	if minetest.get_modpath("pkarcs") then
		pkarcs.register_node("minetest_errata:" .. node.name .. "_cobble")
	end
	
end