ソースを参照

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 年 前
コミット
9f33c6cef1

+ 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;
                 }
             }