colouredstonebricks/init.lua

57 lines
1.6 KiB
Lua
Raw Normal View History

2017-07-24 18:48:24 +02:00
local colours = {
{"black", "Black"},
{"cyan", "Cyan"},
{"brown", "Brown"},
{"dark_blue", "Dark Blue"},
{"dark_green", "Dark Green"},
{"dark_grey", "Dark Grey"},
{"dark_pink", "Dark Pink"},
{"green", "Green"},
{"grey", "Grey"},
{"orange", "Orange"},
{"pink", "Pink"},
{"purple", "Purple"},
{"red", "Red"},
{"white", "White"},
{"yellow", "Yellow"}
2014-06-12 18:56:46 +02:00
}
2017-07-24 18:48:24 +02:00
for _, row in ipairs(colours) do
2014-06-12 18:56:46 +02:00
2017-07-24 18:48:24 +02:00
local name = row[1]
local description = row[2]
2014-06-12 18:56:46 +02:00
2017-07-24 18:48:24 +02:00
minetest.register_node("colouredstonebricks:"..name, {
description = description.." Stone Brick",
tiles = {"colouredstonebricks_"..name..".png"},
2014-06-12 18:56:46 +02:00
groups = {cracky=3},
2017-08-27 21:08:26 +02:00
sounds = default.node_sound_stone_defaults(),
2014-06-12 18:56:46 +02:00
})
minetest.register_craft({
type = "shapeless",
2017-07-24 18:48:24 +02:00
output = 'colouredstonebricks:'..name,
2014-06-12 18:56:46 +02:00
recipe = {
2017-07-24 18:48:24 +02:00
'dye:'..name, 'default:stonebrick',
2014-06-12 18:56:46 +02:00
}
})
2015-12-01 21:34:38 +01:00
-- Support for stairsplus mod
2017-07-24 18:48:24 +02:00
if minetest.get_modpath("moreblocks") then
stairsplus:register_all("colouredstonebricks", name, "colouredstonebricks:"..name, {
description = description.." Stone Brick",
tiles = {"colouredstonebricks_"..name..".png"},
groups = {cracky=3},
2017-08-27 21:08:26 +02:00
sounds = default.node_sound_stone_defaults(),
2017-07-24 18:48:24 +02:00
sunlight_propagates = true,
})
end
2014-06-12 18:56:46 +02:00
end
2017-07-24 18:48:24 +02:00
-- We don't have blue, violet or magenta coloured stone bricks (yet)
--minetest.register_alias("dye:dark_blue","dye:blue")
--minetest.register_alias("dye:dark_pink","dye:magenta")
--minetest.register_alias("dye:purple","dye:violet")
minetest.log("action", "[colouredstonebricks] loaded.")