Browse Source

Use addUnsafeEnchantment instead of addEnchantment

Since the enchantment was already present on the item, there's no need to check if it's valid. This also avoids any errors that may occur when trying to repair an item with non-standard enchants.

Fixes #1561
GJ 11 years ago
parent
commit
9f33c6cef1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java

+ 1 - 1
src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java

@@ -327,7 +327,7 @@ public class RepairManager extends SkillManager {
                 int enchantLevel = enchant.getValue();
 
                 if (ArcaneForging.arcaneForgingDowngrades && enchantLevel > 1 && getDowngradeEnchantChance() > Misc.getRandom().nextInt(activationChance)) {
-                    item.addEnchantment(enchantment, enchantLevel - 1);
+                    item.addUnsafeEnchantment(enchantment, enchantLevel - 1);
                     downgraded = true;
                 }
             }