2020-09-22 16:59:05 +02:00
|
|
|
|
|
|
|
-- Baked Clay by TenPlus1
|
|
|
|
|
|
|
|
local clay = {
|
|
|
|
{"white", "White"},
|
|
|
|
{"grey", "Grey"},
|
|
|
|
{"black", "Black"},
|
|
|
|
{"red", "Red"},
|
|
|
|
{"yellow", "Yellow"},
|
|
|
|
{"green", "Green"},
|
|
|
|
{"cyan", "Cyan"},
|
|
|
|
{"blue", "Blue"},
|
|
|
|
{"magenta", "Magenta"},
|
|
|
|
{"orange", "Orange"},
|
|
|
|
{"violet", "Violet"},
|
|
|
|
{"brown", "Brown"},
|
|
|
|
{"pink", "Pink"},
|
|
|
|
{"dark_grey", "Dark Grey"},
|
|
|
|
{"dark_green", "Dark Green"},
|
|
|
|
}
|
|
|
|
|
|
|
|
local stairs_mod = minetest.get_modpath("stairs")
|
|
|
|
local stairsplus_mod = minetest.get_modpath("moreblocks")
|
|
|
|
and minetest.global_exists("stairsplus")
|
|
|
|
|
|
|
|
for _, clay in pairs(clay) do
|
|
|
|
|
|
|
|
-- node definition
|
|
|
|
|
|
|
|
minetest.register_node("bakedclay:" .. clay[1], {
|
|
|
|
description = clay[2] .. " Baked Clay",
|
|
|
|
tiles = {"baked_clay_" .. clay[1] ..".png"},
|
|
|
|
groups = {cracky = 3, bakedclay = 1},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
-- craft from dye and any baked clay
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "bakedclay:" .. clay[1] .. " 8",
|
|
|
|
recipe = {
|
|
|
|
{"group:bakedclay", "group:bakedclay", "group:bakedclay"},
|
|
|
|
{"group:bakedclay", "dye:" .. clay[1], "group:bakedclay"},
|
|
|
|
{"group:bakedclay", "group:bakedclay", "group:bakedclay"}
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
-- register stairsplus stairs if found
|
|
|
|
if stairsplus_mod then
|
|
|
|
|
|
|
|
stairsplus:register_all("bakedclay", "baked_clay_" .. clay[1], "bakedclay:" .. clay[1], {
|
|
|
|
description = clay[2] .. " Baked Clay",
|
|
|
|
tiles = {"baked_clay_" .. clay[1] .. ".png"},
|
|
|
|
groups = {cracky = 3},
|
|
|
|
sounds = default.node_sound_stone_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
stairsplus:register_alias_all("bakedclay", clay[1], "bakedclay", "baked_clay_" .. clay[1])
|
|
|
|
minetest.register_alias("stairs:slab_bakedclay_".. clay[1], "bakedclay:slab_baked_clay_" .. clay[1])
|
|
|
|
minetest.register_alias("stairs:stair_bakedclay_".. clay[1], "bakedclay:stair_baked_clay_" .. clay[1])
|
|
|
|
|
|
|
|
-- register all stair types for stairs redo
|
|
|
|
elseif stairs_mod and stairs.mod then
|
|
|
|
|
|
|
|
stairs.register_all("bakedclay_" .. clay[1], "bakedclay:" .. clay[1],
|
|
|
|
{cracky = 3},
|
|
|
|
{"baked_clay_" .. clay[1] .. ".png"},
|
|
|
|
clay[2] .. " Baked Clay",
|
|
|
|
default.node_sound_stone_defaults())
|
|
|
|
|
|
|
|
-- register stair and slab using default stairs
|
|
|
|
elseif stairs_mod then
|
|
|
|
|
|
|
|
stairs.register_stair_and_slab("bakedclay_".. clay[1], "bakedclay:".. clay[1],
|
|
|
|
{cracky = 3},
|
|
|
|
{"baked_clay_" .. clay[1] .. ".png"},
|
|
|
|
clay[2] .. " Baked Clay Stair",
|
|
|
|
clay[2] .. " Baked Clay Slab",
|
|
|
|
default.node_sound_stone_defaults())
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
-- cook clay block into white baked clay
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
type = "cooking",
|
|
|
|
output = "bakedclay:white",
|
2020-09-22 17:06:27 +02:00
|
|
|
recipe = "default:clay_block",
|
2020-09-22 16:59:05 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- register a few extra dye colour options
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "dye:dark_grey 3",
|
|
|
|
recipe = {"dye:black", "dye:black", "dye:white"}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
2020-09-22 18:42:14 +02:00
|
|
|
output = "dye:dark_green 3",
|
|
|
|
recipe = {"dye:green", "dye:green", "dye:black"}
|
2020-09-22 16:59:05 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
2020-09-22 18:42:14 +02:00
|
|
|
output = "dye:grey 3",
|
|
|
|
recipe = {"dye:black", "dye:white", "dye:white"}
|
2020-09-22 16:59:05 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "dye:black 4",
|
|
|
|
recipe = {"default:coal_lump"}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft( {
|
|
|
|
type = "shapeless",
|
|
|
|
output = "dye:brown 4",
|
|
|
|
recipe = {"default:dry_shrub"}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- 2x2 red bakedclay makes 16x clay brick
|
|
|
|
minetest.register_craft( {
|
|
|
|
output = "default:clay_brick 16",
|
|
|
|
recipe = {
|
|
|
|
{"bakedclay:red", "bakedclay:red"},
|
|
|
|
{"bakedclay:red", "bakedclay:red"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
print ("[MOD] Baked Clay loaded")
|