forked from mtcontrib/bakedclay
Code tidy and tweak
This commit is contained in:
parent
780b2915c6
commit
cd981adf28
42
init.lua
42
init.lua
@ -19,18 +19,12 @@ local clay = {
|
|||||||
{"dark_green", "Dark Green"},
|
{"dark_green", "Dark Green"},
|
||||||
}
|
}
|
||||||
|
|
||||||
minetest.register_craft({
|
for n = 1, #clay do
|
||||||
type = "cooking",
|
|
||||||
output = "bakedclay:white",
|
|
||||||
recipe = "default:clay",
|
|
||||||
})
|
|
||||||
|
|
||||||
for _, row in pairs(clay) do
|
|
||||||
|
|
||||||
-- node definition
|
-- node definition
|
||||||
minetest.register_node("bakedclay:" .. row[1], {
|
minetest.register_node("bakedclay:" .. clay[n][1], {
|
||||||
description = row[2] .. " Baked Clay",
|
description = clay[n][2] .. " Baked Clay",
|
||||||
tiles = {"baked_clay_" .. row[1] ..".png"},
|
tiles = {"baked_clay_" .. clay[n][1] ..".png"},
|
||||||
groups = {cracky = 3, bakedclay = 1},
|
groups = {cracky = 3, bakedclay = 1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
@ -38,21 +32,29 @@ for _, row in pairs(clay) do
|
|||||||
-- craft from dye and any baked clay
|
-- craft from dye and any baked clay
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "bakedclay:" .. row[1],
|
output = "bakedclay:" .. clay[n][1],
|
||||||
recipe = {"dye:" .. row[1], "group:bakedclay"},
|
recipe = {"dye:" .. clay[n][1], "group:bakedclay"},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- register stair and slab
|
-- register stair and slab
|
||||||
if stairs and not stairs.mod then
|
if stairs and not stairs.mod then
|
||||||
stairs.register_stair_and_slab("bakedclay_".. row[1], "bakedclay:".. row[1],
|
stairs.register_stair_and_slab("bakedclay_".. clay[n][1], "bakedclay:".. clay[n][1],
|
||||||
{cracky = 3},
|
{cracky = 3},
|
||||||
{"baked_clay_" .. row[1] .. ".png"},
|
{"baked_clay_" .. clay[n][1] .. ".png"},
|
||||||
"Baked Clay " .. row[2] .. " Stair",
|
clay[n][2] .. " Baked Clay Stair",
|
||||||
"Baked Clay " .. row[2] .. " Slab",
|
clay[n][2] .. " Baked Clay Slab",
|
||||||
default.node_sound_stone_defaults())
|
default.node_sound_stone_defaults())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- cook clay block into white baked clay
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "cooking",
|
||||||
|
output = "bakedclay:white",
|
||||||
|
recipe = "default:clay",
|
||||||
|
})
|
||||||
|
|
||||||
-- register a few extra dye colour options
|
-- register a few extra dye colour options
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
@ -86,3 +88,11 @@ minetest.register_craft( {
|
|||||||
"default:coal_lump",
|
"default:coal_lump",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
type = "shapeless",
|
||||||
|
output = "dye:brown 4",
|
||||||
|
recipe = {
|
||||||
|
"default:dry_shrub",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user