From 53d3ac0a970b311f51c97a6652bb49d550c3067e Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 7 Aug 2018 21:17:49 +1000 Subject: SPIGOT-4238: Sometimes buckets are leaky client side when empty event is cancelled --- nms-patches/ItemBucket.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nms-patches/ItemBucket.patch') 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; + } -- cgit v1.2.3