summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemBucket.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-07 21:17:49 +1000
committermd_5 <git@md-5.net>2018-08-07 21:17:49 +1000
commit53d3ac0a970b311f51c97a6652bb49d550c3067e (patch)
treef212b74acbbacc1d5e2c1ef99bae8250eac24424 /nms-patches/ItemBucket.patch
parent200b239819d6d57e4f031bc1e2a41cf4962ea5f1 (diff)
downloadcraftbukkit-53d3ac0a970b311f51c97a6652bb49d550c3067e.tar
craftbukkit-53d3ac0a970b311f51c97a6652bb49d550c3067e.tar.gz
craftbukkit-53d3ac0a970b311f51c97a6652bb49d550c3067e.tar.lz
craftbukkit-53d3ac0a970b311f51c97a6652bb49d550c3067e.tar.xz
craftbukkit-53d3ac0a970b311f51c97a6652bb49d550c3067e.zip
SPIGOT-4238: Sometimes buckets are leaky client side when empty event is cancelled
Diffstat (limited to 'nms-patches/ItemBucket.patch')
-rw-r--r--nms-patches/ItemBucket.patch3
1 files changed, 2 insertions, 1 deletions
diff --git a/nms-patches/ItemBucket.patch b/nms-patches/ItemBucket.patch
index 5f3c3d5b..10d01e46 100644
--- a/nms-patches/ItemBucket.patch
+++ b/nms-patches/ItemBucket.patch
@@ -88,7 +88,7 @@
if (!(this.a instanceof FluidTypeFlowing)) {
return false;
} else {
-@@ -103,8 +127,17 @@
+@@ -103,8 +127,18 @@
boolean flag1 = material.isReplaceable();
if (!world.isEmpty(blockposition) && !flag && !flag1 && (!(iblockdata.getBlock() instanceof IFluidContainer) || !((IFluidContainer) iblockdata.getBlock()).a((IBlockAccess) world, blockposition, iblockdata, this.a))) {
@@ -99,6 +99,7 @@
+ if (entityhuman != null) {
+ PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, clicked.getX(), clicked.getY(), clicked.getZ(), enumdirection, itemstack);
+ if (event.isCancelled()) {
++ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity
+ // TODO: inventory not updated
+ return false;
+ }