mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
fix ItemStack#removeEnchantments creating non-stackable items (#11442)
This commit is contained in:
parent
c40eeeefec
commit
e1c46e67a5
1 changed files with 2 additions and 1 deletions
|
@ -75,8 +75,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
@Override
|
||||
public void removeEnchantments() {
|
||||
- this.handle.remove(DataComponents.ENCHANTMENTS);
|
||||
+ if (this.handle != null) { // Paper - fix NPE
|
||||
this.handle.remove(DataComponents.ENCHANTMENTS);
|
||||
+ this.handle.set(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); // Paper - set to default instead of removing the component
|
||||
+ } // Paper
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue