net.minecraftforge.liquids
Class LiquidTank
java.lang.Object
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.
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)
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)