net.minecraftforge.liquids

## Class LiquidStack

- java.lang.Object
- - net.minecraftforge.liquids.LiquidStack

-     public class LiquidStack
      extends Object

  ItemStack substitute for liquids Things of note: they are equal if their items are equal. Amount does NOT matter for java equals() testing
  The canonical liquidstack is probably the only one that has a lot of the rendering data on it. Use `canonical()` to get it.
  Author:
    SirSengir

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `amount`
    `NBTTagCompound` | `extra`
    `int` | `itemID`
    `int` | `itemMeta`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LiquidStack(Block block, int amount)`
    `LiquidStack(int itemID, int amount)`
    `LiquidStack(int itemID, int amount, int itemDamage)`
    `LiquidStack(int itemID, int amount, int itemDamage, NBTTagCompound nbt)`
    `LiquidStack(Item item, int amount)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ItemStack` | `asItemStack()`
    `LiquidStack` | `canonical()` Get the canonical version of this liquid stack (will contain things like icons and texturesheets)
    `boolean` | `containsLiquid(LiquidStack other)`
    `LiquidStack` | `copy()`
    `boolean` | `equals(Object ob)`
    `Icon` | `getRenderingIcon()` Get the rendering icon for this liquid stack, for presentation in the world or in GUIs.
    `String` | `getTextureSheet()` Return the textureSheet used for this liquid stack's texture Icon Defaults to '/terrain.png' See `getRenderingIcon()` for the actual icon
    `int` | `hashCode()`
    `boolean` | `isLiquidEqual(ItemStack other)`
    `boolean` | `isLiquidEqual(LiquidStack other)`
    `static LiquidStack` | `loadLiquidStackFromNBT(NBTTagCompound nbt)` Reads a liquid stack from the passed nbttagcompound and returns it.
    `void` | `readFromNBT(NBTTagCompound nbt)` Deprecated.
    `LiquidStack` | `setRenderingIcon(Icon icon)` Set the icon for rendering this liquid It should be refreshed whenever textures are refreshed.
    `LiquidStack` | `setTextureSheet(String textureSheet)` Set the texture sheet for this icon (usually /terrain.png or /gui/items.png) See also the `setRenderingIcon(Icon)` for the icon itself
    `NBTTagCompound` | `writeToNBT(NBTTagCompound nbt)`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### itemID

          public final int itemID

    - #### amount

          public int amount

    - #### itemMeta

          public final int itemMeta

    - #### extra

          public NBTTagCompound extra

  - ### Constructor Detail

    - #### LiquidStack

          public LiquidStack(int itemID,
                     int amount)

    - #### LiquidStack

          public LiquidStack(Item item,
                     int amount)

    - #### LiquidStack

          public LiquidStack(Block block,
                     int amount)

    - #### LiquidStack

          public LiquidStack(int itemID,
                     int amount,
                     int itemDamage)

    - #### LiquidStack

          public LiquidStack(int itemID,
                     int amount,
                     int itemDamage,
                     NBTTagCompound nbt)

  - ### Method Detail

    - #### writeToNBT

          public NBTTagCompound writeToNBT(NBTTagCompound nbt)

    - #### readFromNBT

          @Deprecated
          public void readFromNBT(NBTTagCompound nbt)

      Deprecated.
      NO-OP now. Use `loadLiquidStackFromNBT(NBTTagCompound)` to get a new instance
      Parameters:
        `nbt` -

    - #### copy

          public LiquidStack copy()

      Returns:
        A copy of this LiquidStack

    - #### isLiquidEqual

          public boolean isLiquidEqual(LiquidStack other)

      Parameters:
        `other` -
      Returns:
        true if this LiquidStack contains the same liquid as the one passed in.

    - #### containsLiquid

          public boolean containsLiquid(LiquidStack other)

      Parameters:
        `other` -
      Returns:
        true if this LiquidStack contains the other liquid (liquids are equal and amount >= other.amount).

    - #### isLiquidEqual

          public boolean isLiquidEqual(ItemStack other)

      Parameters:
        `other` - ItemStack containing liquids.
      Returns:
        true if this LiquidStack contains the same liquid as the one passed in.

    - #### asItemStack

          public ItemStack asItemStack()

      Returns:
        ItemStack representation of this LiquidStack

    - #### loadLiquidStackFromNBT

          public static LiquidStack loadLiquidStackFromNBT(NBTTagCompound nbt)

      Reads a liquid stack from the passed nbttagcompound and returns it.
      Parameters:
        `nbt` -
      Returns:
        the liquid stack

    - #### getTextureSheet

          public String getTextureSheet()

      Return the textureSheet used for this liquid stack's texture Icon Defaults to '/terrain.png' See `getRenderingIcon()` for the actual icon
      Returns:
        The texture sheet

    - #### setTextureSheet

          public LiquidStack setTextureSheet(String textureSheet)

      Set the texture sheet for this icon (usually /terrain.png or /gui/items.png) See also the `setRenderingIcon(Icon)` for the icon itself
      Parameters:
        `textureSheet` -
      Returns:
        the liquid stack

    - #### getRenderingIcon

          public Icon getRenderingIcon()

      Get the rendering icon for this liquid stack, for presentation in the world or in GUIs. Defaults to handling water and lava, and returns the set rendering icon otherwise. See `getTextureSheet()` to get the texture sheet this icon is associated with
      Returns:
        The icon for rendering this liquid

    - #### setRenderingIcon

          public LiquidStack setRenderingIcon(Icon icon)

      Set the icon for rendering this liquid It should be refreshed whenever textures are refreshed. See also `setTextureSheet(String)` for setting the sheet this icon is associated with
      Parameters:
        `icon` - The icon to render
      Returns:
        The liquid stack

    - #### hashCode

          public final int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public final boolean equals(Object ob)

      Overrides:
        `equals` in class `Object`

    - #### canonical

          public LiquidStack canonical()

      Get the canonical version of this liquid stack (will contain things like icons and texturesheets)
      Returns:
        The canonical liquidstack