mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01: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:
parent
7e241e3993
commit
9f33c6cef1
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user