From 6d7e5e2b2dea3bb2af74a19716aaba61301e9b06 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 8 Jul 2015 20:02:09 +0200 Subject: [PATCH] Added a Check to the Fluid Collector to prevent derps --- .../actuallyadditions/tile/TileEntityFluidCollector.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java index 5bc8a5a7c..cce643630 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityFluidCollector.java @@ -66,8 +66,7 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements @Override public void setValues(int[] values){ if(values[1] != -1){ - Fluid fluid = FluidRegistry.getFluid(values[1]); - this.tank.setFluid(new FluidStack(fluid, values[0])); + this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0])); } else this.tank.setFluid(null); } @@ -113,7 +112,7 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements WorldPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord); if(coordsBlock != null){ Block blockToBreak = worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()); - if(!this.isPlacer && blockToBreak != null && worldObj.getBlockMetadata(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()) == 0){ + if(!this.isPlacer && blockToBreak != null && worldObj.getBlockMetadata(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ()) == 0 && FluidContainerRegistry.BUCKET_VOLUME <= this.tank.getCapacity()-this.tank.getFluidAmount()){ if(blockToBreak instanceof IFluidBlock && ((IFluidBlock)blockToBreak).getFluid() != null){ if(this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){ this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), true);