Fix HIDE_ENCHANTS flag in items without enchantments
This commit is contained in:
parent
308785a0a5
commit
ded1836741
@ -909,8 +909,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
ItemEnchantments.a list = new ItemEnchantments.a(ItemEnchantments.EMPTY);
|
||||
|
||||
for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet()) {
|
||||
list.set(CraftEnchantment.bukkitToMinecraftHolder(entry.getKey()), entry.getValue());
|
||||
if (enchantments != null) {
|
||||
for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet()) {
|
||||
list.set(CraftEnchantment.bukkitToMinecraftHolder(entry.getKey()), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
list.showInTooltip = !hasItemFlag(itemFlag);
|
||||
|
Loading…
x
Reference in New Issue
Block a user