13
0
geforkt von Mirrors/Paper

fix ItemStack#removeEnchantments creating non-stackable items (#11442)

Dieser Commit ist enthalten in:
Jake Potrebic 2024-09-27 10:58:11 -07:00
Ursprung c40eeeefec
Commit e1c46e67a5

Datei anzeigen

@ -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
}