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(LiquidStack liquid, int capacity)
           
 
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)
          This method should not be used to interact with a foreign tank.
 void setLiquid(LiquidStack liquid)
          These shouldn't be used to interact with a foreign tank.
 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(LiquidStack liquid,
                  int capacity)
Method Detail

getLiquid

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

setLiquid

public void setLiquid(LiquidStack liquid)
Description copied from interface: ILiquidTank
These shouldn't be used to interact with a foreign tank. Use ILiquidTank.fill(LiquidStack, boolean) and ILiquidTank.drain(int, boolean).

Specified by:
setLiquid in interface ILiquidTank

setCapacity

public void setCapacity(int capacity)
Description copied from interface: ILiquidTank
This method should not be used to interact with a foreign tank. Use ILiquidTank.fill(LiquidStack, boolean) and ILiquidTank.drain(int, boolean).

Specified by:
setCapacity in interface ILiquidTank

getCapacity

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

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)