mirror of
https://notabug.org/TenPlus1/bakedclay.git
synced 2024-08-20 16:04:06 +02:00
Tidied code, now using minecraft recipe to colour blocks
This commit is contained in:
parent
20dc809545
commit
174cda7018
@ -1,5 +1,6 @@
|
|||||||
Baked Clay
|
Baked Clay
|
||||||
|
|
||||||
This mod for minetest lets the player bake clay into hardened blocks and colour them with dye, stairs and slabs are also available.
|
This mod lets the player bake clay into hardened blocks and colour them with
|
||||||
|
dye (8x baked clay and 1x dye in centre), stairs and slabs are also available.
|
||||||
|
|
||||||
https://forum.minetest.net/viewtopic.php?id=8890
|
https://forum.minetest.net/viewtopic.php?id=8890
|
33
init.lua
33
init.lua
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
-- Baked Clay (0.4) by TenPlus1
|
-- Baked Clay (0.5) by TenPlus1
|
||||||
|
|
||||||
local clay = {
|
local clay = {
|
||||||
{"white", "White"},
|
{"white", "White"},
|
||||||
@ -19,30 +19,37 @@ local clay = {
|
|||||||
{"dark_green", "Dark Green"},
|
{"dark_green", "Dark Green"},
|
||||||
}
|
}
|
||||||
|
|
||||||
for n = 1, #clay do
|
for _, clay in pairs(clay) do
|
||||||
|
|
||||||
-- node definition
|
-- node definition
|
||||||
minetest.register_node("bakedclay:" .. clay[n][1], {
|
|
||||||
description = clay[n][2] .. " Baked Clay",
|
minetest.register_node("bakedclay:" .. clay[1], {
|
||||||
tiles = {"baked_clay_" .. clay[n][1] ..".png"},
|
description = clay[2] .. " Baked Clay",
|
||||||
|
tiles = {"baked_clay_" .. clay[1] ..".png"},
|
||||||
groups = {cracky = 3, bakedclay = 1},
|
groups = {cracky = 3, bakedclay = 1},
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
|
|
||||||
-- craft from dye and any baked clay
|
-- craft from dye and any baked clay
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
output = "bakedclay:" .. clay[1] .. " 8",
|
||||||
output = "bakedclay:" .. clay[n][1],
|
recipe = {
|
||||||
recipe = {"dye:" .. clay[n][1], "group:bakedclay"},
|
{"group:bakedclay", "group:bakedclay", "group:bakedclay"},
|
||||||
|
{"group:bakedclay", "dye:" .. clay[1], "group:bakedclay"},
|
||||||
|
{"group:bakedclay", "group:bakedclay", "group:bakedclay"}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- register stair and slab
|
-- register stair and slab (unless stairs redo active)
|
||||||
|
|
||||||
if stairs and not stairs.mod then
|
if stairs and not stairs.mod then
|
||||||
stairs.register_stair_and_slab("bakedclay_".. clay[n][1], "bakedclay:".. clay[n][1],
|
|
||||||
|
stairs.register_stair_and_slab("bakedclay_".. clay[1], "bakedclay:".. clay[1],
|
||||||
{cracky = 3},
|
{cracky = 3},
|
||||||
{"baked_clay_" .. clay[n][1] .. ".png"},
|
{"baked_clay_" .. clay[1] .. ".png"},
|
||||||
clay[n][2] .. " Baked Clay Stair",
|
clay[2] .. " Baked Clay Stair",
|
||||||
clay[n][2] .. " Baked Clay Slab",
|
clay[2] .. " Baked Clay Slab",
|
||||||
default.node_sound_stone_defaults())
|
default.node_sound_stone_defaults())
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user