Skip to content

Commit

Permalink
Fixed fluid pumps trying to pump fluids when the area is protected an…
Browse files Browse the repository at this point in the history
…d not replacing the source properly, closes #514
  • Loading branch information
Buuz135 committed Mar 10, 2019
1 parent 206f8a2 commit 62732ee
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 62732ee

Please sign in to comment.