mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Prevent NPE when removing enchantment with no ItemMeta (#6459)
This commit is contained in:
parent
9169cf73cc
commit
b9871610d1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user