Terracotta migration

This commit is contained in:
JoseDouglas26 2024-06-14 20:36:26 -03:00
parent 0ecf5e2200
commit 38c5e9b05c
3 changed files with 45 additions and 123 deletions

View File

@ -1,92 +0,0 @@
local S = minetest.get_translator(minetest.get_current_modname())
local doc_mod = minetest.get_modpath("doc")
local block = {}
block.dyes = {
{ "white", S("White Terracotta"), "white" },
{ "grey", S("Grey Terracotta"), "dark_grey" },
{ "silver", S("Light Grey Terracotta"), "grey" },
{ "black", S("Black Terracotta"), "black" },
{ "red", S("Red Terracotta"), "red" },
{ "yellow", S("Yellow Terracotta"), "yellow" },
{ "green", S("Green Terracotta"), "dark_green"},
{ "cyan", S("Cyan Terracotta"), "cyan" },
{ "blue", S("Blue Terracotta"), "blue" },
{ "magenta", S("Magenta Terracotta"), "magenta" },
{ "orange", S("Orange Terracotta"), "orange" },
{ "purple", S("Purple Terracotta"), "violet" },
{ "brown", S("Brown Terracotta"), "brown" },
{ "pink", S("Pink Terracotta"), "pink" },
{ "lime", S("Lime Terracotta"), "green" },
{ "light_blue", S("Light Blue Terracotta"), "lightblue" },
}
local canonical_color = "yellow"
local hc_desc = S("Terracotta is a basic building material. It comes in many different colors.")
local gt_desc = S("Glazed terracotta is a decorative block with a complex pattern. It can be rotated by placing it in different directions.")
minetest.register_node("mcl_colorblocks:hardened_clay", {
description = S("Terracotta"),
_doc_items_longdesc = S("Terracotta is a basic building material which comes in many different colors. This particular block is uncolored."),
tiles = {"hardened_clay.png"},
stack_max = 64,
groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1},
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 4.2,
_mcl_hardness = 1.25,
})
minetest.register_craft({
type = "cooking",
output = "mcl_colorblocks:hardened_clay",
recipe = "mcl_core:clay",
cooktime = 10,
})
for _, row in ipairs(block.dyes) do
local name = row[1]
local is_canonical = name == canonical_color
local sdesc_hc = row[2]
local ldesc_hc
local create_entry
local ename_hc
if is_canonical then
ldesc_hc = hc_desc
ldesc_gt = gt_desc
ename_hc = S("Colored Terracotta")
ename_gt = S("Glazed Terracotta")
else
create_entry = false
end
local craft_color_group = row[7]
-- Node Definition
minetest.register_node("mcl_colorblocks:hardened_clay_"..name, {
description = sdesc_hc,
_doc_items_longdesc = ldesc_hc,
_doc_items_create_entry = create_entry,
_doc_items_entry_name = ename_hc,
tiles = {"hardened_clay_stained_"..name..".png"},
groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1},
stack_max = 64,
sounds = mcl_sounds.node_sound_stone_defaults(),
_mcl_blast_resistance = 4.2,
_mcl_hardness = 1.25,
})
if not is_canonical and doc_mod then
doc.add_entry_alias("nodes", "mcl_colorblocks:hardened_clay_"..canonical_color, "nodes", "mcl_colorblocks:hardened_clay_"..name)
end
-- Crafting recipes
if craft_color_group then
minetest.register_craft({
output = "mcl_colorblocks:hardened_clay_"..name.." 8",
recipe = {
{"mcl_colorblocks:hardened_clay", "mcl_colorblocks:hardened_clay", "mcl_colorblocks:hardened_clay"},
{"mcl_colorblocks:hardened_clay", "mcl_dye:"..craft_color_group, "mcl_colorblocks:hardened_clay"},
{"mcl_colorblocks:hardened_clay", "mcl_colorblocks:hardened_clay", "mcl_colorblocks:hardened_clay"},
},
})
end
end

View File

@ -1099,12 +1099,12 @@ local function register_biomes()
-- followed by terracotta with colorful (but imperfect) strata
minetest.register_biome({
name = "Mesa",
node_top = "mcl_colorblocks:hardened_clay",
node_top = "blocks:terracotta",
depth_top = 1,
node_filler = "mcl_colorblocks:hardened_clay",
node_filler = "blocks:terracotta",
node_riverbed = "mcl_core:redsand",
depth_riverbed = 1,
node_stone = "mcl_colorblocks:hardened_clay",
node_stone = "blocks:terracotta",
y_min = 11,
y_max = mcl_vars.mg_overworld_max,
humidity_point = 0,
@ -1122,11 +1122,11 @@ local function register_biomes()
name = "Mesa_sandlevel",
node_top = "mcl_core:redsand",
depth_top = 1,
node_filler = "mcl_colorblocks:hardened_clay_orange",
node_filler = "blocks:orange_terracotta",
depth_filler = 3,
node_riverbed = "mcl_core:redsand",
depth_riverbed = 1,
node_stone = "mcl_colorblocks:hardened_clay_orange",
node_stone = "blocks:orange_terracotta",
y_min = -4,
y_max = 10,
humidity_point = 0,
@ -1164,12 +1164,12 @@ local function register_biomes()
-- Mesa Bryce: Variant of Mesa, but with perfect strata and a much smaller red sand desert
minetest.register_biome({
name = "MesaBryce",
node_top = "mcl_colorblocks:hardened_clay",
node_top = "blocks:terracotta",
depth_top = 1,
node_filler = "mcl_colorblocks:hardened_clay",
node_riverbed = "mcl_colorblocks:hardened_clay",
node_filler = "blocks:terracotta",
node_riverbed = "blocks:terracotta",
depth_riverbed = 1,
node_stone = "mcl_colorblocks:hardened_clay",
node_stone = "blocks:terracotta",
y_min = 4,
y_max = mcl_vars.mg_overworld_max,
humidity_point = -5,
@ -1186,11 +1186,11 @@ local function register_biomes()
name = "MesaBryce_sandlevel",
node_top = "mcl_core:redsand",
depth_top = 1,
node_filler = "mcl_colorblocks:hardened_clay_orange",
node_filler = "blocks:orange_terracotta",
depth_filler = 3,
node_riverbed = "mcl_colorblocks:hardened_clay",
node_riverbed = "blocks:terracotta",
depth_riverbed = 1,
node_stone = "mcl_colorblocks:hardened_clay_orange",
node_stone = "blocks:orange_terracotta",
y_min = -4,
y_max = 3,
humidity_point = -5,
@ -1229,12 +1229,12 @@ local function register_biomes()
-- Identical to Mesa below Y=30. At Y=30 and above there is a "dry" oak forest
minetest.register_biome({
name = "MesaPlateauF",
node_top = "mcl_colorblocks:hardened_clay",
node_top = "blocks:terracotta",
depth_top = 1,
node_filler = "mcl_colorblocks:hardened_clay",
node_filler = "blocks:terracotta",
node_riverbed = "mcl_core:redsand",
depth_riverbed = 1,
node_stone = "mcl_colorblocks:hardened_clay",
node_stone = "blocks:terracotta",
y_min = 11,
y_max = 29,
humidity_point = 0,
@ -1259,7 +1259,7 @@ local function register_biomes()
depth_filler = 1,
node_riverbed = "mcl_core:redsand",
depth_riverbed = 1,
node_stone = "mcl_colorblocks:hardened_clay",
node_stone = "blocks:terracotta",
y_min = 30,
y_max = mcl_vars.mg_overworld_max,
humidity_point = 0,
@ -1276,11 +1276,11 @@ local function register_biomes()
name = "MesaPlateauF_sandlevel",
node_top = "mcl_core:redsand",
depth_top = 2,
node_filler = "mcl_colorblocks:hardened_clay_orange",
node_filler = "blocks:orange_terracotta",
depth_filler = 3,
node_riverbed = "mcl_core:redsand",
depth_riverbed = 1,
node_stone = "mcl_colorblocks:hardened_clay_orange",
node_stone = "blocks:orange_terracotta",
y_min = -5,
y_max = 10,
humidity_point = 0,
@ -1321,12 +1321,12 @@ local function register_biomes()
-- red sand as ores, red sandstone at sandlevel
minetest.register_biome({
name = "MesaPlateauFM",
node_top = "mcl_colorblocks:hardened_clay",
node_top = "blocks:terracotta",
depth_top = 1,
node_filler = "mcl_colorblocks:hardened_clay",
node_filler = "blocks:terracotta",
node_riverbed = "mcl_core:redsand",
depth_riverbed = 2,
node_stone = "mcl_colorblocks:hardened_clay",
node_stone = "blocks:terracotta",
y_min = 12,
y_max = 29,
humidity_point = -5,
@ -1349,7 +1349,7 @@ local function register_biomes()
depth_filler = 2,
node_riverbed = "mcl_core:redsand",
depth_riverbed = 1,
node_stone = "mcl_colorblocks:hardened_clay",
node_stone = "blocks:terracotta",
y_min = 30,
y_max = mcl_vars.mg_overworld_max,
humidity_point = -5,
@ -1366,11 +1366,11 @@ local function register_biomes()
name = "MesaPlateauFM_sandlevel",
node_top = "mcl_core:redsand",
depth_top = 3,
node_filler = "mcl_colorblocks:hardened_clay_orange",
node_filler = "blocks:orange_terracotta",
depth_filler = 3,
node_riverbed = "mcl_core:redsand",
depth_riverbed = 2,
node_stone = "mcl_colorblocks:hardened_clay",
node_stone = "blocks:terracotta",
-- red sand has wider reach than in other mesa biomes
y_min = -7,
y_max = 11,
@ -2776,7 +2776,7 @@ local function register_biomelike_ores()
minetest.register_ore({
ore_type = "blob",
ore = "mcl_core:redsandstone",
wherein = {"mcl_colorblocks:hardened_clay_orange"},
wherein = {"blocks:orange_terracotta"},
clust_scarcity = 300,
clust_size = 8,
y_min = mcl_vars.mg_overworld_min,
@ -2882,10 +2882,10 @@ local function register_biomelike_ores()
-- Full, perfect stratum
minetest.register_ore({
ore_type = "stratum",
ore = "mcl_colorblocks:hardened_clay_" .. color,
ore = "blocks:"..color.."_terracotta",
-- Only paint uncolored so the biome can choose
-- a color in advance.
wherein = {"mcl_colorblocks:hardened_clay"},
wherein = {"blocks:terracotta"},
y_min = y_min,
y_max = y_max,
biomes = perfect_biomes,
@ -2894,8 +2894,8 @@ local function register_biomelike_ores()
-- Slightly eroded stratum, only minor imperfections
minetest.register_ore({
ore_type = "stratum",
ore = "mcl_colorblocks:hardened_clay_" .. color,
wherein = {"mcl_colorblocks:hardened_clay"},
ore = "blocks:"..color.."_terracotta",
wherein = {"blocks:terracotta"},
y_min = y_min,
y_max = y_max,
biomes = {"Mesa", "MesaPlateauF"},
@ -2919,8 +2919,8 @@ local function register_biomelike_ores()
-- Very eroded stratum, most of the color is gone
minetest.register_ore({
ore_type = "stratum",
ore = "mcl_colorblocks:hardened_clay_" .. color,
wherein = {"mcl_colorblocks:hardened_clay"},
ore = "blocks:"..color.."_terracotta",
wherein = {"blocks:terracotta"},
y_min = y_min,
y_max = y_max,
biomes = {"MesaPlateauFM"},

View File

@ -1,3 +1,12 @@
local common_defs = {
terracotta = {
_mcl_blast_resistance = 4.2,
_mcl_hardness = 1.25,
groups = {colored_blocks = 1, pickaxey = 1},
sounds = mcl_sounds.node_sound_stone_defaults()
}
}
local blocks = {
["andesite"] = {
_mcl_blast_resistance = 6,
@ -63,6 +72,7 @@ local blocks = {
groups = {natural_blocks = 1, pickaxey = 1, stonecuttable = 1},
sounds = mcl_sounds.node_sound_stone_defaults()
},
["terracotta"] = table.copy(common_defs.terracotta),
["tuff"] = {
_mcl_blast_resistance = 6,
_mcl_hardness = 1.5,
@ -74,3 +84,7 @@ local blocks = {
for identifier, definitions in pairs(blocks) do
voxelibre.register_block(identifier, definitions)
end
for _, color in pairs(voxelibre.colors) do
voxelibre.register_block(color.."_terracotta", table.copy(common_defs.terracotta))
end