mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 02:22:12 +01:00
Fix HIDE_ENCHANTS flag in items without enchantments
By: Doc <nachito94@msn.com>
This commit is contained in:
parent
f77cb8d6c2
commit
7be855108f
1 changed files with 4 additions and 2 deletions
|
@ -909,9 +909,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||||
|
|
||||||
ItemEnchantments.a list = new ItemEnchantments.a(ItemEnchantments.EMPTY);
|
ItemEnchantments.a list = new ItemEnchantments.a(ItemEnchantments.EMPTY);
|
||||||
|
|
||||||
|
if (enchantments != null) {
|
||||||
for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet()) {
|
for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet()) {
|
||||||
list.set(CraftEnchantment.bukkitToMinecraftHolder(entry.getKey()), entry.getValue());
|
list.set(CraftEnchantment.bukkitToMinecraftHolder(entry.getKey()), entry.getValue());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
list.showInTooltip = !hasItemFlag(itemFlag);
|
list.showInTooltip = !hasItemFlag(itemFlag);
|
||||||
tag.put(key, list.toImmutable());
|
tag.put(key, list.toImmutable());
|
||||||
|
|
Loading…
Reference in a new issue