From 4e3cf9e04b7d5bbc61df4f98b19aadf0fe45c34d Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Sun, 31 Dec 2023 00:07:16 +0100 Subject: [PATCH 1/3] Added colored end rod variants --- mods/ITEMS/mcl_end/building.lua | 71 +++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index 7a3cdfd1d..3c7edb50f 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -59,16 +59,18 @@ minetest.register_node("mcl_end:purpur_pillar", { _mcl_hardness = 1.5, }) -minetest.register_node("mcl_end:end_rod", { +local end_rod_name = "mcl_end:end_rod" +local end_rod_side_tex = "mcl_end_end_rod_side.png" +local end_rod_def = { description = S("End Rod"), _doc_items_longdesc = S("End rods are decorative light sources."), tiles = { "mcl_end_end_rod_top.png", "mcl_end_end_rod_bottom.png", - "mcl_end_end_rod_side.png", - "mcl_end_end_rod_side.png", - "mcl_end_end_rod_side.png", - "mcl_end_end_rod_side.png", + end_rod_side_tex, + end_rod_side_tex, + end_rod_side_tex, + end_rod_side_tex, }, drawtype = "nodebox", is_ground_content = false, @@ -76,7 +78,7 @@ minetest.register_node("mcl_end:end_rod", { paramtype2 = "facedir", light_source = minetest.LIGHT_MAX, sunlight_propagates = true, - groups = { dig_immediate=3, deco_block=1, destroy_by_lava_flow=1, }, + groups = { dig_immediate=3, deco_block=1, destroy_by_lava_flow=1, end_rod=1 }, node_box = { type = "fixed", fixed = { @@ -132,7 +134,62 @@ minetest.register_node("mcl_end:end_rod", { sounds = mcl_sounds.node_sound_glass_defaults(), _mcl_blast_resistance = 0, -}) +} +minetest.register_node(end_rod_name, end_rod_def) + +-- register colored end_rods +local colored_end_rods = { + {"white", S("White End Rod"), "white"}, + {"grey", S("Grey End Rod"), "dark_grey"}, + {"silver", S("Light Grey End Rod"), "grey"}, + {"black", S("Black End Rod"), "black"}, + {"red", S("Red End Rod"), "red"}, + {"yellow", S("Yellow End Rod"), "yellow"}, + {"green", S("Green End Rod"), "dark_green"}, + {"cyan", S("Cyan End Rod"), "cyan"}, + {"blue", S("Blue End Rod"), "blue"}, + {"magenta", S("Magenta End Rod"), "magenta"}, + {"orange", S("Orange End Rod"), "orange"}, + {"purple", S("Purple End Rod"), "violet"}, + {"brown", S("Brown End Rod"), "brown"}, + {"pink", S("Pink End Rod"), "pink"}, + {"lime", S("Lime End Rod"), "green"}, + {"lightblue", S("Light Blue End Rod"), "lightblue"}, +} +local top_mask = "^[mask:mobs_mc_empty.png\\^[fill\\:2x2\\:7,7\\:white" +local side_mask = "^[mask:mobs_mc_empty.png\\^[fill\\:16x15\\:0,0\\:white" +for num, row in ipairs(colored_end_rods) do + local name = row[1] + local desc = row[2] + local dye = row[3] + local def = table.copy(end_rod_def) + def.description = desc + def._doc_items_longdesc = nil + def._doc_items_create_entry = false + if name == "pink" then + def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. top_mask .. "^[multiply:" .. name .. "^[hsl:0:300)" + elseif num > 4 then + def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. top_mask .. "^[multiply:" .. name .. "^[hsl:0:300^[opacity:120)" + else + def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. top_mask .. "^[multiply:" .. name .. "^[hsl:0:-100^[opacity:170)" + end + for i=3, 6 do + if name == "pink" then + def.tiles[i] = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:300)" + elseif num > 4 then + def.tiles[i] = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:300^[opacity:120)" + else + def.tiles[i] = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:-100^[opacity:170)" + end + end + minetest.register_node(end_rod_name.."_"..name, def) + minetest.register_craft({ + type = "shapeless", + output = end_rod_name.."_"..name, + recipe = {"group:end_rod", "mcl_dye:"..dye} + }) +end + minetest.register_node("mcl_end:dragon_egg", { description = S("Dragon Egg"), From 24eca01c3fa5200e1562d6d95bb3677cdf6cb357 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Sun, 31 Dec 2023 00:20:15 +0100 Subject: [PATCH 2/3] Added translations for colored end rods --- mods/ITEMS/mcl_end/locale/mcl_end.de.tr | 16 ++++++++++++++++ mods/ITEMS/mcl_end/locale/mcl_end.pl.tr | 16 ++++++++++++++++ mods/ITEMS/mcl_end/locale/template.txt | 16 ++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/mods/ITEMS/mcl_end/locale/mcl_end.de.tr b/mods/ITEMS/mcl_end/locale/mcl_end.de.tr index 69a3408bb..9fb4c6b88 100644 --- a/mods/ITEMS/mcl_end/locale/mcl_end.de.tr +++ b/mods/ITEMS/mcl_end/locale/mcl_end.de.tr @@ -5,6 +5,22 @@ Purpur Block=Purpurblock Purpur Pillar=Purpursäule End Rod=Endstab End rods are decorative light sources.=Endstäbe sind dekorative Lichtquellen. +White End Rod=Weißer Endstab +Grey End Rod=Grauer Endstab +Light Grey End Rod=Hellgrauer Endstab +Black End Rod=Schwarzer Endstab +Red End Rod=Roter Endstab +Yellow End Rod=Gelber Endstab +Green End Rod=Grüner Endstab +Cyan End Rod=Türkiser Endstab +Blue End Rod=Blauer Endstab +Magenta End Rod=Magenta Endstab +Orange End Rod=Orange Endstab +Purple End Rod=Violetter Endstab +Brown End Rod=Brauner Endstab +Pink End Rod=Rosa Endstab +Lime End Rod=Lindgrüner Endstab +Light Blue End Rod=Hellblauer Endstab Dragon Egg=Drachenei A dragon egg is a decorative item which can be placed.=Ein Drahenei ist ein dekorativer, platzierbarer Gegenstand. Chorus Flower=Chorusblume diff --git a/mods/ITEMS/mcl_end/locale/mcl_end.pl.tr b/mods/ITEMS/mcl_end/locale/mcl_end.pl.tr index e6526b265..e159f738b 100644 --- a/mods/ITEMS/mcl_end/locale/mcl_end.pl.tr +++ b/mods/ITEMS/mcl_end/locale/mcl_end.pl.tr @@ -5,6 +5,22 @@ Purpur Block=Blok purpury Purpur Pillar=Filar purpury End Rod=Różdżka Kresu End rods are decorative light sources.=Różdżki Kresu są dekoracyjnymi źródłami światła. +White End Rod=Biała Różdżka Kresu +Grey End Rod=Szara Różdżka Kresu +Light Grey End Rod=Jasnoszara Różdżka Kresu +Black End Rod=Czarna Różdżka Kresu +Red End Rod=Czerwona Różdżka Kresu +Yellow End Rod=Żółta Różdżka Kresu +Green End Rod=Zielona Różdżka Kresu +Cyan End Rod=Błękitna Różdżka Kresu +Blue End Rod=Niebieska Różdżka Kresu +Magenta End Rod=Karmazynowa Różdżka Kresu +Orange End Rod=Pomarańczowa Różdżka Kresu +Purple End Rod=Fioletowa Różdżka Kresu +Brown End Rod=Brązowa Różdżka Kresu +Pink End Rod=Różowa Różdżka Kresu +Lime End Rod=Jasnozielona Różdżka Kresu +Light Blue End Rod=Jasnoniebieska Różdżka Kresu Dragon Egg=Jajo smoka A dragon egg is a decorative item which can be placed.=Jajo smoka jest przedmiotem dekoracyjnym, który można postawić. Chorus Flower=Kwiat refrenusu diff --git a/mods/ITEMS/mcl_end/locale/template.txt b/mods/ITEMS/mcl_end/locale/template.txt index 08c7de07b..4040b3756 100644 --- a/mods/ITEMS/mcl_end/locale/template.txt +++ b/mods/ITEMS/mcl_end/locale/template.txt @@ -5,6 +5,22 @@ Purpur Block= Purpur Pillar= End Rod= End rods are decorative light sources.= +White End Rod= +Grey End Rod= +Light Grey End Rod= +Black End Rod= +Red End Rod= +Yellow End Rod= +Green End Rod= +Cyan End Rod= +Blue End Rod= +Magenta End Rod= +Orange End Rod= +Purple End Rod= +Brown End Rod= +Pink End Rod= +Lime End Rod= +Light Blue End Rod= Dragon Egg= A dragon egg is a decorative item which can be placed.= Chorus Flower= From 882531b9fc0f23bc089b05818cc96fd9a77ddae4 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 1 Jan 2024 02:53:20 +0100 Subject: [PATCH 3/3] Refactored end rod coloring code --- mods/ITEMS/mcl_end/building.lua | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mods/ITEMS/mcl_end/building.lua b/mods/ITEMS/mcl_end/building.lua index 3c7edb50f..7baa22c0f 100644 --- a/mods/ITEMS/mcl_end/building.lua +++ b/mods/ITEMS/mcl_end/building.lua @@ -166,22 +166,18 @@ for num, row in ipairs(colored_end_rods) do def.description = desc def._doc_items_longdesc = nil def._doc_items_create_entry = false + local side_tex if name == "pink" then def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. top_mask .. "^[multiply:" .. name .. "^[hsl:0:300)" + side_tex = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:300)" elseif num > 4 then def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. top_mask .. "^[multiply:" .. name .. "^[hsl:0:300^[opacity:120)" + side_tex = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:300^[opacity:120)" else def.tiles[1] = def.tiles[1] .. "^(" .. def.tiles[1] .. top_mask .. "^[multiply:" .. name .. "^[hsl:0:-100^[opacity:170)" + side_tex = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:-100^[opacity:170)" end - for i=3, 6 do - if name == "pink" then - def.tiles[i] = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:300)" - elseif num > 4 then - def.tiles[i] = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:300^[opacity:120)" - else - def.tiles[i] = end_rod_side_tex .. "^(" .. end_rod_side_tex .. side_mask .. "^[multiply:" .. name .. "^[hsl:0:-100^[opacity:170)" - end - end + for i=3, 6 do def.tiles[i] = side_tex end minetest.register_node(end_rod_name.."_"..name, def) minetest.register_craft({ type = "shapeless",