mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Fix NPE for bucket empty result stack being null (#7354)
This commit is contained in:
parent
c8208e9482
commit
2fcdb1b8ed
1 changed files with 2 additions and 4 deletions
|
@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
public class BucketItem extends Item implements DispensibleContainerItem {
|
||||
|
||||
+ private static ItemStack itemLeftInHandAfterPlayerBucketEmptyEvent = null; // Paper
|
||||
+ private static @Nullable ItemStack itemLeftInHandAfterPlayerBucketEmptyEvent = null; // Paper
|
||||
+
|
||||
public final Fluid content;
|
||||
|
||||
|
@ -36,9 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
((ServerPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
|
||||
return false;
|
||||
}
|
||||
+ // Paper start
|
||||
+ itemLeftInHandAfterPlayerBucketEmptyEvent = event.getItemStack().equals(CraftItemStack.asNewCraftStack(net.minecraft.world.item.Items.BUCKET)) ? null : CraftItemStack.asNMSCopy(event.getItemStack());
|
||||
+ // Paper end
|
||||
+ itemLeftInHandAfterPlayerBucketEmptyEvent = event.getItemStack() != null ? event.getItemStack().equals(CraftItemStack.asNewCraftStack(net.minecraft.world.item.Items.BUCKET)) ? null : CraftItemStack.asNMSCopy(event.getItemStack()) : ItemStack.EMPTY; // Paper - fix empty event result itemstack
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (!flag1) {
|
||||
|
|
Loading…
Reference in a new issue