From 9f33c6cef188912838096302e2bf140320c252be Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 22 Oct 2013 09:57:13 -0400 Subject: [PATCH] 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 --- .../java/com/gmail/nossr50/skills/repair/RepairManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java index d1db4d746..0818eddd2 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/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; } }