1
0
mirror of https://codeberg.org/tenplus1/bakedclay.git synced 2025-07-17 15:40:19 +02:00

Compare commits

10 Commits

13 changed files with 146 additions and 311 deletions

View File

@ -8,8 +8,6 @@ https://forum.minetest.net/viewtopic.php?id=8890
Changelog:
- 1.2 - Add 'stairsplus_clay_compatibility' setting.
- 1.1 - Remove 0.4.x compatibility to better support 5.x mods
- 1.0 - Re-Added glazed terracotta blocks when you cook baked clay in furnace (thanks Amara2_MK), added support for sofar's flowerpot mod, missing glazed textures re-coloured by firefox.
- 0.9 - Baked clay now works in the technic cnc machine
- 0.8 - Cooking clay block in furnace gives natural baked clay which you can dye
@ -25,5 +23,3 @@ Lucky Blocks: 10
Note: Under settings you will find 'colored_clay_compatibility' switch that when enabled will register aliases for the older colored clay mod and it's stairplus stairs.
You will also find the 'stairsplus_clay_compatibility' setting that is enabled by default for older worlds that switched from default stairs mod to stairsplus. It can be disabled for brand new worlds only using stairsplus mod though.

6
depends.txt Normal file
View File

@ -0,0 +1,6 @@
default
stairs
moreblocks?
lucky_block?
technic_cnc?
flowerpot?

1
description.txt Normal file
View File

@ -0,0 +1 @@
Adds the ability to bake clay into blocks and colour them with dye.

View File

@ -1,26 +1,19 @@
-- translation support
local S = core.get_translator("bakedclay")
-- new flowers
local flowers = {
{"delphinium", S("Blue Delphinium"),
{"delphinium", "Blue Delphinium",
{-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_cyan = 1}},
{"thistle", S("Thistle"),
{"thistle", "Thistle",
{-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_magenta = 1}},
{"lazarus", S("Lazarus Bell"),
{"lazarus", "Lazarus Bell",
{-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_pink = 1}},
{"mannagrass", S("Reed Mannagrass"),
{"mannagrass", "Reed Mannagrass",
{-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_dark_green = 1}}
}
-- helper function
-- register some new flowers to fill in missing dye colours
-- flower registration (borrowed from default game)
local function add_simple_flower(name, desc, box, f_groups)
f_groups.snappy = 3
@ -28,7 +21,7 @@ local function add_simple_flower(name, desc, box, f_groups)
f_groups.flora = 1
f_groups.attached_node = 1
core.register_node("bakedclay:" .. name, {
minetest.register_node("bakedclay:" .. name, {
description = desc,
drawtype = "plantlike",
waving = 1,
@ -39,21 +32,19 @@ local function add_simple_flower(name, desc, box, f_groups)
paramtype = "light",
walkable = false,
buildable_to = true,
stack_max = 99,
groups = f_groups,
sounds = default.node_sound_leaves_defaults(),
selection_box = {type = "fixed", fixed = box}
})
end
-- register new flowers to fill in missing dye colours
for _,item in pairs(flowers) do
add_simple_flower(unpack(item))
end
-- add new flowers to mapgen
core.register_decoration({
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
@ -65,11 +56,12 @@ core.register_decoration({
octaves = 3,
persist = 0.6
},
y_min = 10, y_max = 90,
y_min = 10,
y_max = 90,
decoration = "bakedclay:delphinium"
})
core.register_decoration({
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
sidelen = 16,
@ -81,11 +73,12 @@ core.register_decoration({
octaves = 3,
persist = 0.6
},
y_min = 15, y_max = 90,
y_min = 15,
y_max = 90,
decoration = "bakedclay:thistle"
})
core.register_decoration({
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"},
sidelen = 16,
@ -97,12 +90,14 @@ core.register_decoration({
octaves = 3,
persist = 0.6
},
y_min = 1, y_max = 90,
y_min = 1,
y_max = 90,
decoration = "bakedclay:lazarus",
spawn_by = "default:jungletree", num_spawn_by = 1
spawn_by = "default:jungletree",
num_spawn_by = 1
})
core.register_decoration({
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass", "default:sand"},
sidelen = 16,
@ -114,16 +109,9 @@ core.register_decoration({
octaves = 3,
persist = 0.6
},
y_min = 1, y_max = 15,
y_min = 1,
y_max = 15,
decoration = "bakedclay:mannagrass",
spawn_by = "group:water", num_spawn_by = 1
spawn_by = "group:water",
num_spawn_by = 1
})
-- flowerpot mod support
if core.get_modpath("flowerpot") then
flowerpot.register_node("bakedclay:delphinium")
flowerpot.register_node("bakedclay:thistle")
flowerpot.register_node("bakedclay:lazarus")
flowerpot.register_node("bakedclay:mannagrass")
end

165
init.lua
View File

@ -1,55 +1,44 @@
-- translation support
local S = core.get_translator("bakedclay")
-- list of clay colours
-- Baked Clay by TenPlus1
local clay = {
{"natural", S("Natural")},
{"white", S("White")},
{"grey", S("Grey")},
{"black", S("Black")},
{"red", S("Red")},
{"yellow", S("Yellow")},
{"green", S("Green")},
{"cyan", S("Cyan")},
{"blue", S("Blue")},
{"magenta", S("Magenta")},
{"orange", S("Orange")},
{"violet", S("Violet")},
{"brown", S("Brown")},
{"pink", S("Pink")},
{"dark_grey", S("Dark Grey")},
{"dark_green", S("Dark Green")}
{"natural", "Natural"},
{"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"}
}
-- check mod support
local techcnc_mod = core.get_modpath("technic_cnc")
local stairs_mod = core.get_modpath("stairs")
local stairsplus_mod = core.get_modpath("moreblocks") and core.global_exists("stairsplus")
local stairsplus_compat = core.settings:get_bool("stairsplus_clay_compatibility") ~= false
-- scroll through colours
local techcnc_mod = minetest.get_modpath("technic_cnc")
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
-- register node
core.register_node("bakedclay:" .. clay[1], {
description = clay[2] .. " " .. S("Baked Clay"),
-- node
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(),
is_ground_content = false
sounds = default.node_sound_stone_defaults()
})
-- register craft recipe
-- craft recipe
if clay[1] ~= "natural" then
core.register_craft({
minetest.register_craft({
output = "bakedclay:" .. clay[1] .. " 8",
recipe = {
{"group:bakedclay", "group:bakedclay", "group:bakedclay"},
@ -60,75 +49,64 @@ for _, clay in pairs(clay) do
end
-- stairs plus
if stairsplus_mod then
stairsplus:register_all("bakedclay", "baked_clay_" .. clay[1],
"bakedclay:" .. clay[1], {
description = clay[2] .. " " .. S("Baked Clay"),
description = clay[2] .. " Baked Clay",
tiles = {"baked_clay_" .. clay[1] .. ".png"},
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults()
})
if stairsplus_compat then
stairsplus:register_alias_all("bakedclay", clay[1],
"bakedclay", "baked_clay_" .. clay[1])
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])
core.register_alias("stairs:slab_bakedclay_".. clay[1],
"bakedclay:slab_baked_clay_" .. clay[1])
core.register_alias("stairs:stair_bakedclay_".. clay[1],
"bakedclay:stair_baked_clay_" .. clay[1])
end
minetest.register_alias("stairs:stair_bakedclay_".. clay[1],
"bakedclay:stair_baked_clay_" .. clay[1])
-- 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] .. " " .. S("Baked Clay"),
clay[2] .. " Baked Clay",
default.node_sound_stone_defaults())
-- 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] .. " " .. S("Baked Clay Stair"),
clay[2] .. " " .. S("Baked Clay Slab"),
clay[2] .. " Baked Clay Stair",
clay[2] .. " Baked Clay Slab",
default.node_sound_stone_defaults())
end
-- register bakedclay for use in technic_cnc mod after all mods loaded
-- register bakedclay for use in technic_cnc mod
if techcnc_mod then
core.register_on_mods_loaded(function()
technic_cnc.register_all("bakedclay:" .. clay[1],
{cracky = 3, not_in_creative_inventory = 1},
{"baked_clay_" .. clay[1] .. ".png"},
clay[2] .. " Baked Clay")
end)
technic_cnc.register_all("bakedclay:" .. clay[1],
{cracky = 3, not_in_creative_inventory = 1},
{"baked_clay_" .. clay[1] .. ".png"},
clay[2] .. " Baked Clay")
end
end
-- Terracotta blocks
for _, clay in pairs(clay) do
if clay[1] ~= "natural" then
local texture = "baked_clay_terracotta_" .. clay[1] ..".png"
core.register_node("bakedclay:terracotta_" .. clay[1], {
description = clay[2] .. " " .. S("Glazed Terracotta"),
minetest.register_node("bakedclay:terracotta_" .. clay[1], {
description = clay[2] .. " Glazed Terracotta",
tiles = {
texture .. "",
texture .. "",
@ -140,11 +118,10 @@ for _, clay in pairs(clay) do
paramtype2 = "facedir",
groups = {cracky = 3, terracotta = 1},
sounds = default.node_sound_stone_defaults(),
is_ground_content = false,
on_place = core.rotate_node
on_place = minetest.rotate_node
})
core.register_craft({
minetest.register_craft({
type = "cooking",
output = "bakedclay:terracotta_" .. clay[1],
recipe = "bakedclay:" .. clay[1]
@ -152,39 +129,17 @@ for _, clay in pairs(clay) do
end
end
core.register_alias("bakedclay:terracotta_light_blue", "bakedclay:terracotta_cyan")
minetest.register_alias("bakedclay:terracotta_light_blue", "bakedclay:terracotta_cyan")
-- cook clay block into natural baked clay
core.register_craft({
-- cook clay block into white baked clay
minetest.register_craft({
type = "cooking",
output = "bakedclay:natural",
recipe = "default:clay"
})
-- register a few extra dye colour options
core.register_craft({ output = "dye:green 4", recipe = {{"default:cactus"}} })
core.register_craft({ output = "dye:brown 4", recipe = {{"default:dry_shrub"}} })
-- only add light grey recipe if unifieddye mod isnt present (conflict)
if not core.get_modpath("unifieddyes") then
core.register_craft( {
output = "dye:dark_grey 3",
recipe = {{"dye:black", "dye:black", "dye:white"}}
})
core.register_craft( {
output = "dye:grey 3",
recipe = {{"dye:black", "dye:white", "dye:white"}}
})
end
-- 2x2 red baked clay makes 16x clay brick
core.register_craft( {
minetest.register_craft( {
output = "default:clay_brick 16",
recipe = {
{"bakedclay:red", "bakedclay:red"},
@ -193,8 +148,7 @@ core.register_craft( {
})
-- colored clay compatibility
if core.settings:get_bool("colored_clay_compatibility") == true then
if minetest.settings:get_bool("colored_clay_compatibility") == true then
local cc = {
{"black", "black"},
@ -221,7 +175,7 @@ if core.settings:get_bool("colored_clay_compatibility") == true then
local nod1 = "colored_clay:" .. cc[n][1]
local nod2 = "bakedclay:" .. cc[n][2]
core.register_alias(nod1, nod2)
minetest.register_alias(nod1, nod2)
if stairsplus_mod then
stairsplus:register_alias_all("colored_clay", cc[n][1], "bakedclay", cc[n][2])
@ -229,17 +183,22 @@ if core.settings:get_bool("colored_clay_compatibility") == true then
end
end
-- get mod path
-- flowerpot mod
if minetest.get_modpath("flowerpot") then
flowerpot.register_node("bakedclay:delphinium")
flowerpot.register_node("bakedclay:thistle")
flowerpot.register_node("bakedclay:lazarus")
flowerpot.register_node("bakedclay:mannagrass")
end
local path = core.get_modpath("bakedclay")
-- get mod path
local path = minetest.get_modpath("bakedclay")
-- add new flowers
dofile(path .. "/flowers.lua")
-- add lucky blocks if mod present
if core.get_modpath("lucky_block") then
if minetest.get_modpath("lucky_block") then
dofile(path .. "/lucky_block.lua")
end

View File

@ -21,16 +21,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Textures by TenPlus1 (CC0) unless listed below
Textures by Amara2_MK (Creative Commons)
https://www.curseforge.com/minecraft/texture-packs/glazed-terracotta-revamp
baked_clay_terracotta*.png
Missing gray, light gray, black and green textures re-coloured by Firefox.
Textures by Timbits (CC-BY-SA 3.0)
baked_clay_lazarus.png
baked_clay_delphinium.png
baked_clay_mannagrass.png
baked_clay_thistle.png

View File

@ -1,25 +0,0 @@
# textdomain: bakedclay
Blue Delphinium=Delfinio Azul
Thistle=Cardo
Lazarus Bell=Campana Lázaro
Reed Mannagrass=Césped de caña
Natural=Natural
White=Blanco
Grey=Gris
Black=Negro
Red=Rojo
Yellow=Amarillo
Green=Verde
Cyan=Celeste
Blue=Azul
Magenta=Magenta
Orange=Naranja
Violet=Violeta
Brown=Cáfe
Pink=Rosa
Dark Grey=Gris Oscuro
Dark Green=Verde Oscuro
Baked Clay=Barro Cocido
Baked Clay Stair=Escalera de Barro Cocido
Baked Clay Slab=Losa de Barro Cocido
Glazed Terracotta=Terracota esmaltada.

View File

@ -1,25 +0,0 @@
# textdomain: bakedclay
Blue Delphinium=Kék szarkaláb
Thistle=Bogáncs
Lazarus Bell=Kockásliliom
Reed Mannagrass=Vízi harmatkása
Natural=Természetes
White=Fehér
Grey=Szürke
Black=Fekete
Red=Piros
Yellow=Sárga
Green=Zöld
Cyan=Cián
Blue=Kék
Magenta=Bíbor
Orange=Narancssárga
Violet=Lila
Brown=Barna
Pink=Rózsaszín
Dark Grey=Sötétszürke
Dark Green=Sötétzöld
Baked Clay=égetett agyag
Baked Clay Stair=égetett agyag lépcső
Baked Clay Slab=égetett agyag lap
Glazed Terracotta=zománcmázas terrakotta

View File

@ -1,27 +0,0 @@
# textdomain: bakedclay
Adds the ability to bake clay into blocks and colour them with dye.=Додає можливість випалювати глину в блоки та фарбувати їх барвниками.
Bake clay blocks and colour with dye, also has Terracotta designs.=Випалюйте глиняні блоки та фарбуйте їх барвниками, а також виготовляйте теракотові візерунки.
Blue Delphinium=Синій дельфініум
Thistle=Будяк
Lazarus Bell=Дзвіночок Лазаря
Reed Mannagrass=Лепешняк великий
Natural=Натуральна
White=Біла
Grey=Сіра
Black=Чорна
Red=Червона
Yellow=Жовта
Green=Зелена
Cyan=Блакитна
Blue=Синя
Magenta=Пурпурна
Orange=Помаранчева
Violet=Фіолетова
Brown=Коричнева
Pink=Рожева
Dark Grey=Темно-сіра
Dark Green=Темно-зелена
Baked Clay=Випалена глина
Baked Clay Stair=випалена глина (сходи)
Baked Clay Slab=випалена глина (плита)
Glazed Terracotta=Глазурована теракота

View File

@ -1,25 +0,0 @@
# textdomain: bakedclay
Blue Delphinium=
Thistle=
Lazarus Bell=
Reed Mannagrass=
Natural=
White=
Grey=
Black=
Red=
Yellow=
Green=
Cyan=
Blue=
Magenta=
Orange=
Violet=
Brown=
Pink=
Dark Grey=
Dark Green=
Baked Clay=
Baked Clay Stair=
Baked Clay Slab=
Glazed Terracotta=

View File

@ -1,65 +1,64 @@
-- helpers
local p = "bakedclay:"
local p2 = "bakedclay:terracotta_"
-- add lucky blocks
lucky_block:add_blocks({
{"dro", {"bakedclay:"}, 10, true},
{"fal", {
p .. "black", p .. "blue", p .. "brown", p .. "cyan", p .. "dark_green",
p .. "dark_grey", p .. "green", p .. "grey", p .. "magenta", p .. "orange",
p .. "pink", p .. "red", p .. "violet", p .. "white", p .. "yellow", p .. "natural"
p.."black", p.."blue", p.."brown", p.."cyan", p.."dark_green",
p.."dark_grey", p.."green", p.."grey", p.."magenta", p.."orange",
p.."pink", p.."red", p.."violet", p.."white", p.."yellow", p.."natural"
}, 0},
{"fal", {
p .. "black", p .. "blue", p .. "brown", p .. "cyan", p .. "dark_green",
p .. "dark_grey", p .. "green", p .. "grey", p .. "magenta", p .. "orange",
p .. "pink", p .. "red", p .. "violet", p .. "white", p .. "yellow", p .. "natural"
p.."black", p.."blue", p.."brown", p.."cyan", p.."dark_green",
p.."dark_grey", p.."green", p.."grey", p.."magenta", p.."orange",
p.."pink", p.."red", p.."violet", p.."white", p.."yellow", p.."natural"
}, 0, true},
{"dro", {p .. "delphinium"}, 5},
{"dro", {p .. "lazarus"}, 5},
{"dro", {p .. "mannagrass"}, 5},
{"dro", {p .. "thistle"}, 6},
{"dro", {p.."delphinium"}, 5},
{"dro", {p.."lazarus"}, 5},
{"dro", {p.."mannagrass"}, 5},
{"dro", {p.."thistle"}, 6},
{"flo", 5, {
p .. "natural", p .. "black", p .. "blue", p .. "brown", p .. "cyan",
p .. "dark_green", p .. "dark_grey", p .. "green", p .. "grey", p .. "magenta",
p .. "orange", p .. "pink", p .. "red", p .. "violet", p .. "white", p .. "yellow"
p.."natural", p.."black", p.."blue", p.."brown", p.."cyan",
p.."dark_green", p.."dark_grey", p.."green", p.."grey", p.."magenta",
p.."orange", p.."pink", p.."red", p.."violet", p.."white", p.."yellow"
}, 2},
{"nod", "default:chest", 0, {
{name = p .. "natural", max = 20},
{name = p .. "black", max = 20},
{name = p .. "blue", max = 20},
{name = p .. "brown", max = 20},
{name = p .. "cyan", max = 20},
{name = p .. "dark_green", max = 20},
{name = p .. "dark_grey", max = 20},
{name = p .. "green", max = 20},
{name = p .. "grey", max = 20},
{name = p .. "magenta", max = 20},
{name = p .. "orange", max = 20},
{name = p .. "pink", max = 20},
{name = p .. "red", max = 20},
{name = p .. "violet", max = 20},
{name = p .. "white", max = 20},
{name = p .. "yellow", max = 20}
}},
{"nod", "default:chest", 0, {
{name = p2 .. "black", max = 20},
{name = p2 .. "blue", max = 20},
{name = p2 .. "brown", max = 20},
{name = p2 .. "cyan", max = 20},
{name = p2 .. "dark_green", max = 20},
{name = p2 .. "dark_grey", max = 20},
{name = p2 .. "green", max = 20},
{name = p2 .. "grey", max = 20},
{name = p2 .. "magenta", max = 20},
{name = p2 .. "orange", max = 20},
{name = p2 .. "pink", max = 20},
{name = p2 .. "red", max = 20},
{name = p2 .. "violet", max = 20},
{name = p2 .. "white", max = 20},
{name = p2 .. "yellow", max = 20}
{name = p.."natural", max = 30},
{name = p.."black", max = 30},
{name = p.."blue", max = 30},
{name = p.."brown", max = 30},
{name = p.."cyan", max = 30},
{name = p.."dark_green", max = 30},
{name = p.."dark_grey", max = 30},
{name = p.."green", max = 30},
{name = p.."grey", max = 30},
{name = p.."magenta", max = 30},
{name = p.."orange", max = 30},
{name = p.."pink", max = 30},
{name = p.."red", max = 30},
{name = p.."violet", max = 30},
{name = p.."white", max = 30},
{name = p.."yellow", max = 30}
}}
})
p = "bakedclay:terracotta_"
lucky_block:add_blocks({
{"nod", "default:chest", 0, {
{name = p.."black", max = 20},
{name = p.."blue", max = 20},
{name = p.."brown", max = 20},
{name = p.."cyan", max = 20},
{name = p.."dark_green", max = 20},
{name = p.."dark_grey", max = 20},
{name = p.."green", max = 20},
{name = p.."grey", max = 20},
{name = p.."magenta", max = 20},
{name = p.."orange", max = 20},
{name = p.."pink", max = 20},
{name = p.."red", max = 20},
{name = p.."violet", max = 20},
{name = p.."white", max = 20},
{name = p.."yellow", max = 20}
}}
})

View File

@ -1,5 +1,4 @@
name = bakedclay
description = Bake clay blocks and colour with dye, also has Terracotta designs.
depends = default
optional_depends = stairs, moreblocks, lucky_block, flowerpot
min_minetest_version = 5.0
optional_depends = stairs, moreblocks, lucky_block, technic_cnc, flowerpot
description = Adds the ability to bake clay into blocks and colour them with dye.

View File

@ -1,5 +1,2 @@
# Registers compatibility aliases with the older colored_clay mod
colored_clay_compatibility (Colored Clay Compatibility) bool false
# Registers compatibility aliases in older worlds for StairsPlus mod
stairsplus_clay_compatibility (StairsPlus Stair Compatibility) bool true