Przeglądaj źródła

Fixed bug where repairing an mcMMO ability-buffed item with mcMMO repair
could take the enchant but leave the lore tag

GJ 12 lat temu
rodzic
commit
cf82ae4c66

+ 1 - 0
Changelog.txt

@@ -11,6 +11,7 @@ Version 1.4.01-dev
  = Fixed bug where trying to use /mctop or /xplock with the Smelting child skill caused NPEs
  = Fixed bug where /mctop and /mcrank wouldn't show overall power levels for servers using Flatfile
  = Fixed bug where Smelting would throw consistent errors due to offline players
+ = Fixed bug where repairing an mcMMO ability-buffed item with mcMMO repair could take the enchant but leave the lore tag
 
 Version 1.4.00
  + Added new Child Skill - Smelting!

+ 4 - 0
src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java

@@ -15,6 +15,7 @@ import com.gmail.nossr50.events.skills.repair.McMMOPlayerRepairCheckEvent;
 import com.gmail.nossr50.locale.LocaleLoader;
 import com.gmail.nossr50.util.Permissions;
 import com.gmail.nossr50.util.StringUtils;
+import com.gmail.nossr50.util.skills.SkillUtils;
 
 public class SimpleRepairManager implements RepairManager {
     private HashMap<Integer, Repairable> repairables;
@@ -108,6 +109,9 @@ public class SimpleRepairManager implements RepairManager {
             return;
         }
 
+        // Clear ability buffs before trying to repair.
+        SkillUtils.removeAbilityBuff(item);
+
         // Lets get down to business,
         // To defeat, the huns.
         int baseRepairAmount = repairable.getBaseRepairDurability(); // Did they send me daughters?