SPIGOT-7909: Always set HIDE_ENCHANTS flag to item if flag is set

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2024-10-06 18:25:07 +11:00
parent bad69bdc04
commit 54c12bdb6e

View file

@ -903,7 +903,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
void applyEnchantments(Map<Enchantment, Integer> enchantments, CraftMetaItem.Applicator tag, ItemMetaKeyType<ItemEnchantments> key, ItemFlag itemFlag) {
if (enchantments == null) {
if (enchantments == null && !hasItemFlag(itemFlag)) {
return;
}