From 62732eeeec2da5bd48dc2eea26df466e38245a07 Mon Sep 17 00:00:00 2001 From: Buuz135 Date: Sun, 10 Mar 2019 15:46:27 +0100 Subject: [PATCH] Fixed fluid pumps trying to pump fluids when the area is protected and not replacing the source properly, closes #514 --- .../buuz135/industrial/tile/world/FluidPumpTile.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/buuz135/industrial/tile/world/FluidPumpTile.java b/src/main/java/com/buuz135/industrial/tile/world/FluidPumpTile.java index fc3ac86be..74702b0bd 100644 --- a/src/main/java/com/buuz135/industrial/tile/world/FluidPumpTile.java +++ b/src/main/java/com/buuz135/industrial/tile/world/FluidPumpTile.java @@ -98,10 +98,13 @@ public float work() { Fluid fluid = FluidRegistry.lookupFluidForBlock(this.world.getBlockState(peeked).getBlock()); if (fluid != null) { FluidStack stack = new FluidStack(fluid, 1000); - tank.fill(stack, true); - if (BlockRegistry.fluidPumpBlock.isReplaceFluidWithCobble()) - this.world.setBlockState(peeked, Blocks.COBBLESTONE.getDefaultState()); - else world.setBlockToAir(peeked); + if (BlockRegistry.fluidPumpBlock.isReplaceFluidWithCobble()) { + if (this.world.setBlockState(peeked, Blocks.COBBLESTONE.getDefaultState())) { + tank.fill(stack, true); + } + } else if (world.setBlockToAir(peeked)) { + tank.fill(stack, true); + } } allBlocks.poll(); return 1;