mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-25 10:14:43 +02:00
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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user