net.minecraftforge.liquids
Class LiquidTank

java.lang.Object
  extended by net.minecraftforge.liquids.LiquidTank
All Implemented Interfaces:
ILiquidTank

public class LiquidTank
extends Object
implements ILiquidTank

Reference implementation of ILiquidTank. Use this or implement your own.


Constructor Summary
LiquidTank(int capacity)
           
LiquidTank(int liquidId, int quantity, int capacity)
           
LiquidTank(int liquidId, int quantity, int capacity, TileEntity tile)
           
LiquidTank(LiquidStack liquid, int capacity)
           
LiquidTank(LiquidStack liquid, int capacity, TileEntity tile)
           
 
Method Summary
 LiquidStack drain(int maxDrain, boolean doDrain)
           
 int fill(LiquidStack resource, boolean doFill)
           
 int getCapacity()
           
 LiquidStack getLiquid()
           
 int getTankPressure()
          Positive values indicate a positive liquid pressure (liquid wants to leave this tank) Negative values indicate a negative liquid pressure (liquid wants to fill this tank) Zero indicates no pressure
 void setCapacity(int capacity)
           
 void setLiquid(LiquidStack liquid)
           
 void setTankPressure(int pressure)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LiquidTank

public LiquidTank(int capacity)

LiquidTank

public LiquidTank(int liquidId,
                  int quantity,
                  int capacity)

LiquidTank

public LiquidTank(int liquidId,
                  int quantity,
                  int capacity,
                  TileEntity tile)

LiquidTank

public LiquidTank(LiquidStack liquid,
                  int capacity)

LiquidTank

public LiquidTank(LiquidStack liquid,
                  int capacity,
                  TileEntity tile)
Method Detail

getLiquid

public LiquidStack getLiquid()
Specified by:
getLiquid in interface ILiquidTank
Returns:
LiquidStack representing the liquid contained in the tank, null if empty.

getCapacity

public int getCapacity()
Specified by:
getCapacity in interface ILiquidTank
Returns:
capacity of this tank

setLiquid

public void setLiquid(LiquidStack liquid)

setCapacity

public void setCapacity(int capacity)

fill

public int fill(LiquidStack resource,
                boolean doFill)
Specified by:
fill in interface ILiquidTank
Returns:
Amount of liquid used for filling.

drain

public LiquidStack drain(int maxDrain,
                         boolean doDrain)
Specified by:
drain in interface ILiquidTank
Returns:
Null if nothing was drained, otherwise a LiquidStack containing the drained.

getTankPressure

public int getTankPressure()
Description copied from interface: ILiquidTank
Positive values indicate a positive liquid pressure (liquid wants to leave this tank) Negative values indicate a negative liquid pressure (liquid wants to fill this tank) Zero indicates no pressure

Specified by:
getTankPressure in interface ILiquidTank
Returns:
a number indicating tank pressure

setTankPressure

public void setTankPressure(int pressure)