From 3e5fe3e40d94c052bbbb6834bc3d9f88f2cbf152 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 18 Jul 2018 17:48:17 +1000 Subject: [PATCH] SPIGOT-4042: Fix emptying buckets onto slabs --- nms-patches/ItemBucket.patch | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/nms-patches/ItemBucket.patch b/nms-patches/ItemBucket.patch index 029b20230c..5e131a07a9 100644 --- a/nms-patches/ItemBucket.patch +++ b/nms-patches/ItemBucket.patch @@ -41,7 +41,7 @@ BlockPosition blockposition1 = this.a(iblockdata, blockposition, movingobjectposition); - if (this.a(entityhuman, world, blockposition1, movingobjectposition)) { -+ if (this.a(entityhuman, world, blockposition1, movingobjectposition, blockposition, itemstack)) { // CraftBukkit ++ if (this.a(entityhuman, world, blockposition1, movingobjectposition, movingobjectposition.direction, blockposition, itemstack)) { // CraftBukkit this.a(world, itemstack, blockposition1); if (entityhuman instanceof EntityPlayer) { CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition1, itemstack); @@ -75,21 +75,24 @@ + // CraftBukkit start public boolean a(@Nullable EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPosition movingobjectposition) { -+ return a(entityhuman, world, blockposition, movingobjectposition, null, null); ++ return a(entityhuman, world, blockposition, movingobjectposition, null, null, null); + } + -+ public boolean a(EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPosition movingobjectposition, BlockPosition clicked, ItemStack itemstack) { ++ public boolean a(EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPosition movingobjectposition, EnumDirection enumdirection, BlockPosition clicked, ItemStack itemstack) { + // CraftBukkit end if (!(this.a instanceof FluidTypeFlowing)) { return false; } else { -@@ -105,6 +129,15 @@ +@@ -103,8 +127,17 @@ + boolean flag1 = material.isReplaceable(); + if (!world.isEmpty(blockposition) && !flag && !flag1 && (!(iblockdata.getBlock() instanceof IFluidContainer) || !((IFluidContainer) iblockdata.getBlock()).a((IBlockAccess) world, blockposition, iblockdata, this.a))) { - return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null); +- return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null); ++ return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null, enumdirection, clicked, itemstack); // CraftBukkit } else { + // CraftBukkit start + if (entityhuman != null) { -+ PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, clicked.getX(), clicked.getY(), clicked.getZ(), movingobjectposition.direction, itemstack); ++ PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, clicked.getX(), clicked.getY(), clicked.getZ(), enumdirection, itemstack); + if (event.isCancelled()) { + // TODO: inventory not updated + return false;