mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
Skip invalid enchants in CraftMetaItem
This commit is contained in:
parent
c19c2932bf
commit
28d993ccec
@ -358,7 +358,10 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
|||||||
int id = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_ID.NBT);
|
int id = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_ID.NBT);
|
||||||
int level = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_LVL.NBT);
|
int level = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_LVL.NBT);
|
||||||
|
|
||||||
enchantments.put(Enchantment.getById(id), level);
|
Enchantment enchant = Enchantment.getById(id);
|
||||||
|
if (enchant != null) {
|
||||||
|
enchantments.put(enchant, level);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return enchantments;
|
return enchantments;
|
||||||
|
Loading…
Reference in New Issue
Block a user