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.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsValidLiquid()`
    `LiquidStack` | `drain(int maxDrain, boolean doDrain)`
    `int` | `fill(LiquidStack resource, boolean doFill)`
    `int` | `getCapacity()`
    `LiquidStack` | `getLiquid()`
    `String` | `getLiquidName()`
    `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
    `LiquidTank` | `readFromNBT(NBTTagCompound nbt)`
    `void` | `setCapacity(int capacity)`
    `void` | `setLiquid(LiquidStack liquid)`
    `void` | `setTankPressure(int pressure)`
    `NBTTagCompound` | `writeToNBT(NBTTagCompound nbt)`

    - ### 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)

    - #### getLiquidName

          public String getLiquidName()

    - #### containsValidLiquid

          public boolean containsValidLiquid()

    - #### writeToNBT

          public NBTTagCompound writeToNBT(NBTTagCompound nbt)

    - #### readFromNBT

          public LiquidTank readFromNBT(NBTTagCompound nbt)