From 2f88529d4196151eb5da2c7a51d43e1a5558ec0e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 4 Feb 2018 07:36:47 +0100 Subject: [PATCH] Don't allow anvil repair if already at max health --- mods/ITEMS/mcl_anvils/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index 78ef218a..18c359e2 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -56,7 +56,7 @@ local function update_anvil_slots(meta) end -- Same tool twice - if input1:get_name() == input2:get_name() and def1.type == "tool" then + if input1:get_name() == input2:get_name() and def1.type == "tool" and (input1:get_wear() > 0 or input2:get_wear() > 0) then -- Add tool health together plus a small bonus -- TODO: Combine tool enchantments local new_wear = calculate_repair(input1:get_wear(), input2:get_wear(), SAME_TOOL_REPAIR_BOOST) @@ -89,7 +89,7 @@ local function update_anvil_slots(meta) elseif material:get_name() == tooldef._repair_material then has_correct_material = true end - if has_correct_material then + if has_correct_material and tool:get_wear() > 0 then local new_wear = calculate_repair(tool:get_wear(), MAX_WEAR, MATERIAL_TOOL_REPAIR_BOOST) tool:set_wear(new_wear) name_item = tool