mirror of
https://notabug.org/TenPlus1/bakedclay.git
synced 2024-08-20 23:54:04 +02:00
Tidied code
This commit is contained in:
parent
69a41534c4
commit
793c12cbc5
@ -1,5 +1,5 @@
|
|||||||
Baked Clay
|
Baked Clay
|
||||||
|
|
||||||
This mod for minetest lets player bake clay into hardened blocks and colour them with dye, stairs and slabs also available
|
This mod for minetest lets the player bake clay into hardened blocks and colour them with dye, stairs and slabs are also available.
|
||||||
|
|
||||||
https://forum.minetest.net/viewtopic.php?id=8890
|
https://forum.minetest.net/viewtopic.php?id=8890
|
82
init.lua
82
init.lua
@ -1,7 +1,7 @@
|
|||||||
--= Baked Clay (0.3) by TenPlus1
|
-- Baked Clay (0.4) by TenPlus1
|
||||||
--= Code-base taken from default wool mod
|
|
||||||
|
|
||||||
local clay = {}
|
local clay = {}
|
||||||
|
|
||||||
clay.dyes = {
|
clay.dyes = {
|
||||||
{"white", "White", "basecolor_white"},
|
{"white", "White", "basecolor_white"},
|
||||||
{"grey", "Grey", "basecolor_grey"},
|
{"grey", "Grey", "basecolor_grey"},
|
||||||
@ -27,67 +27,61 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
|
|
||||||
for _, row in ipairs(clay.dyes) do
|
for _, row in ipairs(clay.dyes) do
|
||||||
local name = row[1]
|
|
||||||
local desc = row[2]
|
-- node definition
|
||||||
local craft_color_group = row[3]
|
minetest.register_node("bakedclay:" .. row[1], {
|
||||||
-- Node Definition
|
description = row[2] .. " Baked Clay",
|
||||||
minetest.register_node("bakedclay:"..name, {
|
tiles = {"baked_clay_" .. row[1] ..".png"},
|
||||||
description = desc.." Baked Clay",
|
groups = {cracky=3, bakedclay=1},
|
||||||
tiles = {"baked_clay_"..name..".png"},
|
|
||||||
groups = {cracky=3,bakedclay=1},
|
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
})
|
})
|
||||||
if craft_color_group then
|
|
||||||
-- Crafting from dye and white clay
|
-- craft from dye and white clay
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "bakedclay:"..name,
|
output = "bakedclay:" .. row[1],
|
||||||
recipe = {"group:dye,"..craft_color_group, "group:bakedclay"},
|
recipe = {"group:dye," .. row[3], "group:bakedclay"},
|
||||||
})
|
})
|
||||||
end
|
|
||||||
-- Register Stair
|
-- register stair and slab
|
||||||
stairs.register_stair_and_slab("bakedclay_"..name, "bakedclay:"..name,
|
stairs.register_stair_and_slab("bakedclay_".. row[1], "bakedclay:".. row[1],
|
||||||
{cracky=3},
|
{cracky=3},
|
||||||
{"baked_clay_"..name..".png"},
|
{"baked_clay_" .. row[1] .. ".png"},
|
||||||
"Baked Clay "..desc.." Stair",
|
"Baked Clay " .. row[2] .. " Stair",
|
||||||
"Baked Clay "..desc.." Slab",
|
"Baked Clay " .. row[2] .. " Slab",
|
||||||
default.node_sound_stone_defaults())
|
default.node_sound_stone_defaults())
|
||||||
end
|
end
|
||||||
|
|
||||||
--= Register a few extra Dye Colour Options
|
-- register a few extra dye colour options
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "dye:dark_grey 3",
|
output = "dye:dark_grey 3",
|
||||||
recipe = {
|
recipe = {
|
||||||
"dye:black",
|
"dye:black", "dye:black", "dye:white",
|
||||||
"dye:black",
|
|
||||||
"dye:white",
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "dye:grey 3",
|
output = "dye:grey 3",
|
||||||
recipe = {
|
recipe = {
|
||||||
"dye:black",
|
"dye:black", "dye:white", "dye:white",
|
||||||
"dye:white",
|
|
||||||
"dye:white",
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "dye:green 4",
|
output = "dye:green 4",
|
||||||
recipe = {
|
recipe = {
|
||||||
"default:cactus",
|
"default:cactus",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "dye:black 4",
|
output = "dye:black 4",
|
||||||
recipe = {
|
recipe = {
|
||||||
"default:coal_lump",
|
"default:coal_lump",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user