mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Remove CraftItemStack#setAmount null assignment
This creates a problem with Paper's item serialization api where deserialized items, which are internally created as a CraftItemStack, will be completely lost if #setAmount(0) is invoked (since the underlying handle is set to null), while a regular Bukkit ItemStack simply sets the amount field to zero, retaining the item's data. Vanilla treats items with zero amounts the same as items with less than zero amounts, so this code doesn't create a problem with operations on the vanilla ItemStack.
This commit is contained in:
parent
b8ad599ceb
commit
933e2e1efa
1 changed files with 1 additions and 1 deletions
|
@ -198,7 +198,7 @@ public final class CraftItemStack extends ItemStack {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.handle.setCount(amount);
|
this.handle.setCount(amount);
|
||||||
if (amount == 0) {
|
if (false && amount == 0) { // Paper - remove CraftItemStack#setAmount null assignment
|
||||||
this.handle = null;
|
this.handle = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue