mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-27 06:31:57 +01:00
SPIGOT-4238: Sometimes buckets are leaky client side when empty event is cancelled
This commit is contained in:
parent
200b239819
commit
53d3ac0a97
1 changed files with 2 additions and 1 deletions
|
@ -88,7 +88,7 @@
|
||||||
if (!(this.a instanceof FluidTypeFlowing)) {
|
if (!(this.a instanceof FluidTypeFlowing)) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
@@ -103,8 +127,17 @@
|
@@ -103,8 +127,18 @@
|
||||||
boolean flag1 = material.isReplaceable();
|
boolean flag1 = material.isReplaceable();
|
||||||
|
|
||||||
if (!world.isEmpty(blockposition) && !flag && !flag1 && (!(iblockdata.getBlock() instanceof IFluidContainer) || !((IFluidContainer) iblockdata.getBlock()).a((IBlockAccess) world, blockposition, iblockdata, this.a))) {
|
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) {
|
+ if (entityhuman != null) {
|
||||||
+ PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, clicked.getX(), clicked.getY(), clicked.getZ(), enumdirection, itemstack);
|
+ PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, clicked.getX(), clicked.getY(), clicked.getZ(), enumdirection, itemstack);
|
||||||
+ if (event.isCancelled()) {
|
+ if (event.isCancelled()) {
|
||||||
|
+ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity
|
||||||
+ // TODO: inventory not updated
|
+ // TODO: inventory not updated
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
|
|
Loading…
Add table
Reference in a new issue