mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-06 15:41:38 +01:00
Fix NPE for bucket empty result stack being null (#7354)
This commit is contained in:
parent
c8208e9482
commit
2fcdb1b8ed
@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
public class BucketItem extends Item implements DispensibleContainerItem {
|
public class BucketItem extends Item implements DispensibleContainerItem {
|
||||||
|
|
||||||
+ private static ItemStack itemLeftInHandAfterPlayerBucketEmptyEvent = null; // Paper
|
+ private static @Nullable ItemStack itemLeftInHandAfterPlayerBucketEmptyEvent = null; // Paper
|
||||||
+
|
+
|
||||||
public final Fluid content;
|
public final Fluid content;
|
||||||
|
|
||||||
@ -36,9 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
((ServerPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
|
((ServerPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
+ // Paper start
|
+ 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
|
||||||
+ itemLeftInHandAfterPlayerBucketEmptyEvent = event.getItemStack().equals(CraftItemStack.asNewCraftStack(net.minecraft.world.item.Items.BUCKET)) ? null : CraftItemStack.asNMSCopy(event.getItemStack());
|
|
||||||
+ // Paper end
|
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
if (!flag1) {
|
if (!flag1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user