Clear enchantments before applying in this#applyEnchantments(ItemStack)

This commit is contained in:
Brett Bonifas 2022-03-09 09:56:41 -05:00
parent 79a820efc1
commit db7d136e4e

View File

@ -120,6 +120,10 @@ public class EnchantmentContainer implements Iterable<Map.Entry<Enchantment, Int
*/
public void applyEnchantments(final ItemStack is)
{
// Clear enchantments before applying new ones
for (Enchantment enchantment : is.getEnchantments().keySet())
is.removeEnchantment(enchantment);
is.addUnsafeEnchantments(enchantments);
}
@ -224,6 +228,7 @@ public class EnchantmentContainer implements Iterable<Map.Entry<Enchantment, Int
combined.put(entry.getKey(), entry.getValue());
}
ArmoredElytra.getInstance().getLogger().log(Level.INFO, combined.toString());
return combined;
}