13
0
geforkt von Mirrors/Paper

Prevent NPE when removing enchantment with no ItemMeta (#6459)

Dieser Commit ist enthalten in:
Jake Potrebic 2021-08-22 08:13:51 -07:00
Ursprung 9169cf73cc
Commit b9871610d1

Datei anzeigen

@ -183,6 +183,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- }
+ // Paper start - replace entire method
+ final ItemMeta itemMeta = this.getItemMeta();
+ if (itemMeta == null) return 0;
+ int level = itemMeta.getEnchantLevel(ench);
+ if (level > 0) {
+ itemMeta.removeEnchant(ench);