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
This commit is contained in:
GJ 2013-10-22 09:57:13 -04:00
parent 7e241e3993
commit 9f33c6cef1

View File

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