From 882531b9fc0f23bc089b05818cc96fd9a77ddae4 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Mon, 1 Jan 2024 02:53:20 +0100 Subject: [PATCH] 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",