Squash help entries of colorblocks

This commit is contained in:
Wuzzy 2019-03-24 08:55:42 +01:00
parent ea23f05c22
commit 8636b94c74
8 changed files with 72 additions and 6 deletions

View file

@ -1,4 +1,5 @@
mcl_core mcl_core
mcl_sounds mcl_sounds
mcl_dye mcl_dye
doc?
screwdriver? screwdriver?

View file

@ -1,5 +1,6 @@
local init = os.clock() local init = os.clock()
local S = minetest.get_translator("mcl_colorblocks") local S = minetest.get_translator("mcl_colorblocks")
local doc_mod = minetest.get_modpath("doc")
local block = {} local block = {}
@ -21,6 +22,7 @@ block.dyes = {
{"lime", S("Lime Terracotta"), S("Lime Glazed Terracotta"), S("Lime Concrete Powder"), S("Lime Concrete"), "green"}, {"lime", S("Lime Terracotta"), S("Lime Glazed Terracotta"), S("Lime Concrete Powder"), S("Lime Concrete"), "green"},
{"light_blue", S("Light Blue Terracotta"), S("Light Blue Glazed Terracotta"), S("Light Blue Concrete Powder"), S("Light Blue Concrete"), "lightblue"}, {"light_blue", S("Light Blue Terracotta"), S("Light Blue Glazed Terracotta"), S("Light Blue Concrete Powder"), S("Light Blue Concrete"), "lightblue"},
} }
local canonical_color = "yellow"
local hc_desc = S("Terracotta is a basic building material. It comes in many different colors.") 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.") local gt_desc = S("Glazed terracotta is a decorative block with a complex pattern. It can be rotated by placing it in different directions.")
@ -52,15 +54,33 @@ end
for _, row in ipairs(block.dyes) do for _, row in ipairs(block.dyes) do
local name = row[1] local name = row[1]
local is_canonical = name == canonical_color
local sdesc_hc = row[2] local sdesc_hc = row[2]
local sdesc_gt = row[3] local sdesc_gt = row[3]
local sdesc_cp = row[4] local sdesc_cp = row[4]
local sdesc_c = row[5] local sdesc_c = row[5]
local ldesc_hc, ldesc_gt, ldesc_cp, ldesc_c
local create_entry
local ename_hc, ename_gt, ename_cp, ename_c
if is_canonical then
ldesc_hc = hc_desc
ldesc_gt = gt_desc
ldesc_cp = cp_desc
ldesc_c = c_desc
ename_hc = S("Colored Terracotta")
ename_gt = S("Glazed Terracotta")
ename_cp = S("Concrete Powder")
ename_c = S("Concrete")
else
create_entry = false
end
local craft_color_group = row[6] local craft_color_group = row[6]
-- Node Definition -- Node Definition
minetest.register_node("mcl_colorblocks:hardened_clay_"..name, { minetest.register_node("mcl_colorblocks:hardened_clay_"..name, {
description = sdesc_hc, description = sdesc_hc,
_doc_items_longdesc = hc_desc, _doc_items_longdesc = ldesc_hc,
_doc_items_create_entry = create_entry,
_doc_items_entry_name = ename_hc,
tiles = {"hardened_clay_stained_"..name..".png"}, tiles = {"hardened_clay_stained_"..name..".png"},
groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1}, groups = {pickaxey=1, hardened_clay=1,building_block=1, material_stone=1},
stack_max = 64, stack_max = 64,
@ -71,7 +91,9 @@ for _, row in ipairs(block.dyes) do
minetest.register_node("mcl_colorblocks:concrete_powder_"..name, { minetest.register_node("mcl_colorblocks:concrete_powder_"..name, {
description = sdesc_cp, description = sdesc_cp,
_doc_items_longdesc = cp_desc, _doc_items_longdesc = ldesc_cp,
_doc_items_create_entry = create_entry,
_doc_items_entry_name = ename_cp,
tiles = {"mcl_colorblocks_concrete_powder_"..name..".png"}, tiles = {"mcl_colorblocks_concrete_powder_"..name..".png"},
groups = {handy=1,shovely=1, concrete_powder=1,building_block=1,falling_node=1, material_sand=1}, groups = {handy=1,shovely=1, concrete_powder=1,building_block=1,falling_node=1, material_sand=1},
stack_max = 64, stack_max = 64,
@ -109,7 +131,9 @@ for _, row in ipairs(block.dyes) do
minetest.register_node("mcl_colorblocks:concrete_"..name, { minetest.register_node("mcl_colorblocks:concrete_"..name, {
description = sdesc_c, description = sdesc_c,
_doc_items_longdesc = c_desc, _doc_items_longdesc = ldesc_c,
_doc_items_create_entry = create_entry,
_doc_items_entry_name = ename_c,
tiles = {"mcl_colorblocks_concrete_"..name..".png"}, tiles = {"mcl_colorblocks_concrete_"..name..".png"},
groups = {handy=1,pickaxey=1, concrete=1,building_block=1, material_stone=1}, groups = {handy=1,pickaxey=1, concrete=1,building_block=1, material_stone=1},
stack_max = 64, stack_max = 64,
@ -123,7 +147,9 @@ for _, row in ipairs(block.dyes) do
local texes = { tex, tex, tex.."^[transformR180", tex, tex.."^[transformR270", tex.."^[transformR90" } local texes = { tex, tex, tex.."^[transformR180", tex, tex.."^[transformR270", tex.."^[transformR90" }
minetest.register_node("mcl_colorblocks:glazed_terracotta_"..name, { minetest.register_node("mcl_colorblocks:glazed_terracotta_"..name, {
description = sdesc_gt, description = sdesc_gt,
_doc_items_longdesc = gt_desc, _doc_items_longdesc = ldesc_gt,
_doc_items_create_entry = create_entry,
_doc_items_entry_name = ename_gt,
tiles = texes, tiles = texes,
groups = {handy=1,pickaxey=1, glazed_terracotta=1,building_block=1, material_stone=1}, groups = {handy=1,pickaxey=1, glazed_terracotta=1,building_block=1, material_stone=1},
paramtype2 = "facedir", paramtype2 = "facedir",
@ -135,6 +161,13 @@ for _, row in ipairs(block.dyes) do
on_rotate = on_rotate, on_rotate = on_rotate,
}) })
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)
doc.add_entry_alias("nodes", "mcl_colorblocks:glazed_terracotta_"..canonical_color, "nodes", "mcl_colorblocks:glazed_terracotta_"..name)
doc.add_entry_alias("nodes", "mcl_colorblocks:concrete_"..canonical_color, "nodes", "mcl_colorblocks:concrete_"..name)
doc.add_entry_alias("nodes", "mcl_colorblocks:concrete_powder_"..canonical_color, "nodes", "mcl_colorblocks:concrete_powder_"..name)
end
-- Crafting recipes -- Crafting recipes
if craft_color_group then if craft_color_group then
minetest.register_craft({ minetest.register_craft({
@ -184,4 +217,3 @@ minetest.register_abm({
local time_to_load= os.clock() - init local time_to_load= os.clock() - init
print(string.format("[MOD] "..minetest.get_current_modname().." loaded in %.4f s", time_to_load)) print(string.format("[MOD] "..minetest.get_current_modname().." loaded in %.4f s", time_to_load))

View file

@ -68,4 +68,8 @@ Glazed terracotta is a decorative block with a complex pattern. It can be rotate
Concrete powder is used for creating concrete, but it can also be used as decoration itself. It comes in different colors. Concrete powder turns into concrete of the same color when it comes in contact with water.=Betonpulver wird benutzt, um Beton herzustellen, aber es kann auch selbst als Dekoration benutzt werden. Es kommt in verschiedenen Farben daher. Betonpulver verwandelt sich in Beton der selben Farbe, wenn es mit Wasser in Berührung kommt. Concrete powder is used for creating concrete, but it can also be used as decoration itself. It comes in different colors. Concrete powder turns into concrete of the same color when it comes in contact with water.=Betonpulver wird benutzt, um Beton herzustellen, aber es kann auch selbst als Dekoration benutzt werden. Es kommt in verschiedenen Farben daher. Betonpulver verwandelt sich in Beton der selben Farbe, wenn es mit Wasser in Berührung kommt.
Concrete is a decorative block which comes in many different colors. It is notable for having a very strong and clean color.=Beton ist ein dekorativer Block, der in verschiedenen Farben daherkommt. Er hat eine besonders kräftige und klare Farbe. Concrete is a decorative block which comes in many different colors. It is notable for having a very strong and clean color.=Beton ist ein dekorativer Block, der in verschiedenen Farben daherkommt. Er hat eine besonders kräftige und klare Farbe.
Terracotta=Terrakotta Terracotta=Terrakotta
Terracotta is a basic building material which comes in many different colors. This particular block is uncolored.=Terrakotta ist ein Baumaterial, welches in vielen verschiedenen Farben vorkommt. Dieser Block ist farblos. Terracotta is a basic building material which comes in many different colors. This particular block is uncolored.=Terrakotta ist ein Baumaterial, welches in vielen verschiedenen Farben vorkommt. Diese Variante ist ungefärbt.
Colored Terracotta=Gefärbte Terrakotta
Glazed Terracotta=Glasierte Terrakotta
Concrete Powder=Betonpulver
Concrete=Beton

View file

@ -69,3 +69,7 @@ Concrete powder is used for creating concrete, but it can also be used as decora
Concrete is a decorative block which comes in many different colors. It is notable for having a very strong and clean color.= Concrete is a decorative block which comes in many different colors. It is notable for having a very strong and clean color.=
Terracotta= Terracotta=
Terracotta is a basic building material which comes in many different colors. This particular block is uncolored.= Terracotta is a basic building material which comes in many different colors. This particular block is uncolored.=
Colored Terracotta=
Glazed Terracotta=
Concrete Powder=
Concrete=

View file

@ -5,3 +5,4 @@ mcl_nether
mcl_end mcl_end
mcl_colorblocks mcl_colorblocks
mcl_stairs mcl_stairs
doc?

View file

@ -1,4 +1,5 @@
local S = minetest.get_translator("mclx_stairs") local S = minetest.get_translator("mclx_stairs")
local doc_mod = minetest.get_modpath("doc")
mcl_stairs.register_stair_and_slab_simple("tree_bark", "mcl_core:tree_bark", S("Oak Bark Stairs"), S("Oak Bark Slab"), S("Double Oak Bark Slab"), "woodlike") mcl_stairs.register_stair_and_slab_simple("tree_bark", "mcl_core:tree_bark", S("Oak Bark Stairs"), S("Oak Bark Slab"), S("Double Oak Bark Slab"), "woodlike")
mcl_stairs.register_stair_and_slab_simple("acaciatree_bark", "mcl_core:acaciatree_bark", S("Acacia Bark Stairs"), S("Acacia Bark Slab"), S("Double Acacia Bark Slab"), "woodlike") mcl_stairs.register_stair_and_slab_simple("acaciatree_bark", "mcl_core:acaciatree_bark", S("Acacia Bark Stairs"), S("Acacia Bark Slab"), S("Double Acacia Bark Slab"), "woodlike")
@ -47,12 +48,29 @@ block.dyes = {
{"lime", S("Lime Concrete Stairs"), S("Lime Concrete Slab"), S("Double Lime Concrete Slab"), "green"}, {"lime", S("Lime Concrete Stairs"), S("Lime Concrete Slab"), S("Double Lime Concrete Slab"), "green"},
{"light_blue", S("Light Blue Concrete Stairs"), S("Light Blue Concrete Slab"), S("Double Light Blue Concrete Slab"), "lightblue"}, {"light_blue", S("Light Blue Concrete Stairs"), S("Light Blue Concrete Slab"), S("Double Light Blue Concrete Slab"), "lightblue"},
} }
local canonical_color = "yellow"
for i=1, #block.dyes do for i=1, #block.dyes do
local c = block.dyes[i][1] local c = block.dyes[i][1]
local is_canonical = c == canonical_color
mcl_stairs.register_stair_and_slab_simple("concrete_"..c, "mcl_colorblocks:concrete_"..c, mcl_stairs.register_stair_and_slab_simple("concrete_"..c, "mcl_colorblocks:concrete_"..c,
block.dyes[i][2], block.dyes[i][2],
block.dyes[i][3], block.dyes[i][3],
block.dyes[i][4]) block.dyes[i][4])
if doc_mod then
if not is_canonical then
doc.add_entry_alias("nodes", "mcl_stairs:slab_concrete_"..canonical_color, "nodes", "mcl_stairs:slab_concrete_"..c)
doc.add_entry_alias("nodes", "mcl_stairs:slab_concrete_"..canonical_color.."_double", "nodes", "mcl_stairs:slab_concrete_"..c.."_double")
doc.add_entry_alias("nodes", "mcl_stairs:stair_concrete_"..canonical_color, "nodes", "mcl_stairs:stair_concrete_"..c)
minetest.override_item("mcl_stairs:slab_concrete_"..c, { _doc_items_create_entry = false })
minetest.override_item("mcl_stairs:slab_concrete_"..c.."_double", { _doc_items_create_entry = false })
minetest.override_item("mcl_stairs:stair_concrete_"..c, { _doc_items_create_entry = false })
else
minetest.override_item("mcl_stairs:slab_concrete_"..c, { _doc_items_entry_name = S("Concrete Slab") })
minetest.override_item("mcl_stairs:slab_concrete_"..c.."_double", { _doc_items_entry_name = S("Double Concrete Slab") })
minetest.override_item("mcl_stairs:stair_concrete_"..c, { _doc_items_entry_name = S("Concrete Stairs") })
end
end
end end

View file

@ -77,3 +77,6 @@ Double Lime Concrete Slab=Doppelte Betonplatte
Light Blue Concrete Stairs=Hellblaue Betontreppe Light Blue Concrete Stairs=Hellblaue Betontreppe
Light Blue Concrete Slab=Hellblaue Betonplatte Light Blue Concrete Slab=Hellblaue Betonplatte
Double Light Blue Concrete Slab=Doppelte hellblaue Betonplatte Double Light Blue Concrete Slab=Doppelte hellblaue Betonplatte
Concrete Slab=Betonplatte
Double Concrete Slab=Doppelte Betonplatte
Concrete Stairs=Betontreppe

View file

@ -77,3 +77,6 @@ Double Lime Concrete Slab=
Light Blue Concrete Stairs= Light Blue Concrete Stairs=
Light Blue Concrete Slab= Light Blue Concrete Slab=
Double Light Blue Concrete Slab= Double Light Blue Concrete Slab=
Concrete Slab=
Double Concrete Slab=
Concrete Stairs=