diff --git a/mods/ITEMS/mcl_armor/leather.lua b/mods/ITEMS/mcl_armor/leather.lua index 093e817ba..d651fd632 100644 --- a/mods/ITEMS/mcl_armor/leather.lua +++ b/mods/ITEMS/mcl_armor/leather.lua @@ -1,8 +1,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) -local colorize_value = 125 -local modifier = "[colorize::"..colorize_value +local modifier = "^[colorize:%s:".. 175 -local str = string +local string = string local longdesc = S("This is a piece of equippable armor which reduces the amount of damage you receive.") local usage = S("To equip it, put it on the corresponding armor slot in your inventory menu.") @@ -43,7 +42,7 @@ local function get_texture_function(texture) if color == "" or color == nil then return texture else - return texture.."[colorize:"..color..":"..colorize_value + return texture .. string.format(modifier, color) end end return get_texture @@ -66,10 +65,10 @@ mcl_armor.register_set({ feet = 1, }, textures = { - head = get_texture_function("mcl_armor_helmet_leather.png"), - torso = get_texture_function("mcl_armor_chestplate_leather.png"), - legs = get_texture_function("mcl_armor_leggings_leather.png"), - feet = get_texture_function("mcl_armor_boots_leather.png"), + head = get_texture_function("mcl_armor_helmet_leather_colored.png"), + torso = get_texture_function("mcl_armor_chestplate_leather_colored.png"), + legs = get_texture_function("mcl_armor_leggings_leather_colored.png"), + feet = get_texture_function("mcl_armor_boots_leather_colored.png"), }, repair_material = "mcl_mobitems:leather", }) @@ -82,7 +81,23 @@ minetest.register_chatcommand("colort", { if player then local item = player:get_wielded_item() item:get_meta():set_string("color", "#951d1d") + player:set_wielded_item(item) mcl_armor.update(player) end end, -}) \ No newline at end of file +}) + +minetest.register_craft({ + type = "shapeless", + output = "mcl_armor:leggings_leather_colored", + recipe = { + "mcl_armor:leggings_leather", + "mcl_dye:blue", + }, +}) + +minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) + if itemstack:get_name() == "mcl_armor:leggings_leather_colored" then + return itemstack:get_meta():set_string("color", "#2a2c94") + end +end) \ No newline at end of file diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_leggings_leather_colored.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_leggings_leather_colored.png index 41d49c373..2cd78db56 100644 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_leggings_leather_colored.png and b/mods/ITEMS/mcl_armor/textures/mcl_armor_inv_leggings_leather_colored.png differ diff --git a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_leather_colored.png b/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_leather_colored.png index deededca4..a0f2cf05b 100644 Binary files a/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_leather_colored.png and b/mods/ITEMS/mcl_armor/textures/mcl_armor_leggings_leather_colored.png differ