SPIGOT-5882: NPE when emptying bucket on already waterlogged blocks

This commit is contained in:
Parker Hawke 2020-06-29 11:09:50 +10:00 committed by md_5
parent 44109b726b
commit e2403a3d2c
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -59,7 +59,7 @@
if (!(this.fluidType instanceof FluidTypeFlowing)) { if (!(this.fluidType instanceof FluidTypeFlowing)) {
return false; return false;
} else { } else {
@@ -86,6 +108,16 @@ @@ -86,8 +108,18 @@
boolean flag = iblockdata.a(this.fluidType); boolean flag = iblockdata.a(this.fluidType);
boolean flag1 = iblockdata.isAir() || flag || block instanceof IFluidContainer && ((IFluidContainer) block).canPlace(world, blockposition, iblockdata, this.fluidType); boolean flag1 = iblockdata.isAir() || flag || block instanceof IFluidContainer && ((IFluidContainer) block).canPlace(world, blockposition, iblockdata, this.fluidType);
@ -74,5 +74,8 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (!flag1) { if (!flag1) {
return movingobjectpositionblock != null && this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), (MovingObjectPositionBlock) null); - return movingobjectpositionblock != null && this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), (MovingObjectPositionBlock) null);
+ return movingobjectpositionblock != null && this.a(entityhuman, world, movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection()), (MovingObjectPositionBlock) null, enumdirection, clicked, itemstack); // CraftBukkit
} else if (world.getDimensionManager().isNether() && this.fluidType.a((Tag) TagsFluid.WATER)) { } else if (world.getDimensionManager().isNether() && this.fluidType.a((Tag) TagsFluid.WATER)) {
int i = blockposition.getX();
int j = blockposition.getY();