From 132529d8f41575f6280a033f03ffc4cd480cdfd9 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sun, 1 May 2022 01:53:51 +0200 Subject: [PATCH] theorically support enchantments --- mods/ITEMS/mcl_armor/leather.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mods/ITEMS/mcl_armor/leather.lua b/mods/ITEMS/mcl_armor/leather.lua index 49d1c1d8f..278b19325 100644 --- a/mods/ITEMS/mcl_armor/leather.lua +++ b/mods/ITEMS/mcl_armor/leather.lua @@ -31,13 +31,19 @@ local function calculate_color(first, last) end local function get_texture_function(texture) - --TODO: add enchantments support local function get_texture(_, itemstack) + local out local color = itemstack:get_meta():get_string("color") if color == "" or color == nil then - return texture + out = texture else - return texture.."^[multiply:"..color + out = texture.."^[multiply:"..color + end + + if mcl_enchanting.is_enchanted(itemstack) then + return out.."^"..mcl_enchanting.overlay + else + return out end end return get_texture