mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-25 16:38:33 +01:00
Added a Check to the Fluid Collector to prevent derps
This commit is contained in:
parent
f2086aad9e
commit
6d7e5e2b2d
1 changed files with 2 additions and 3 deletions
|
@ -66,8 +66,7 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
|
||||||
@Override
|
@Override
|
||||||
public void setValues(int[] values){
|
public void setValues(int[] values){
|
||||||
if(values[1] != -1){
|
if(values[1] != -1){
|
||||||
Fluid fluid = FluidRegistry.getFluid(values[1]);
|
this.tank.setFluid(new FluidStack(FluidRegistry.getFluid(values[1]), values[0]));
|
||||||
this.tank.setFluid(new FluidStack(fluid, values[0]));
|
|
||||||
}
|
}
|
||||||
else this.tank.setFluid(null);
|
else this.tank.setFluid(null);
|
||||||
}
|
}
|
||||||
|
@ -113,7 +112,7 @@ public class TileEntityFluidCollector extends TileEntityInventoryBase implements
|
||||||
WorldPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord);
|
WorldPos coordsBlock = WorldUtil.getCoordsFromSide(sideToManipulate, worldObj, xCoord, yCoord, zCoord);
|
||||||
if(coordsBlock != null){
|
if(coordsBlock != null){
|
||||||
Block blockToBreak = worldObj.getBlock(coordsBlock.getX(), coordsBlock.getY(), coordsBlock.getZ());
|
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(blockToBreak instanceof IFluidBlock && ((IFluidBlock)blockToBreak).getFluid() != null){
|
||||||
if(this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), false) >= FluidContainerRegistry.BUCKET_VOLUME){
|
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);
|
this.tank.fill(new FluidStack(((IFluidBlock)blockToBreak).getFluid(), FluidContainerRegistry.BUCKET_VOLUME), true);
|
||||||
|
|
Loading…
Reference in a new issue