fix ItemStack#removeEnchantments creating non-stackable items (#11442)
This commit is contained in:
@@ -75,8 +75,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeEnchantments() {
|
public void removeEnchantments() {
|
||||||
|
- this.handle.remove(DataComponents.ENCHANTMENTS);
|
||||||
+ if (this.handle != null) { // Paper - fix NPE
|
+ 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
|
+ } // Paper
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user