net.minecraftforge.fluids

## Class Fluid

- java.lang.Object
- - net.minecraftforge.fluids.Fluid

-     public class Fluid
      extends java.lang.Object

  Minecraft Forge Fluid Implementation This class is a fluid (liquid or gas) equivalent to "Item." It describes the nature of a fluid and contains its general properties. These properties do not have inherent gameplay mechanics - they are provided so that mods may choose to take advantage of them. Fluid implementations are not required to actively use these properties, nor are objects interfacing with fluids required to make use of them, but it is encouraged. The default values can be used as a reference point for mods adding fluids such as oil or heavy water.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Block` | `block` If there is a Block implementation of the Fluid, the Block is linked here.
    `protected int` | `density` Density of the fluid - completely arbitrary; negative density indicates that the fluid is lighter than air.
    `protected IIcon` | `flowingIcon`
    `protected java.lang.String` | `fluidName` The unique identification name for this fluid.
    `protected boolean` | `isGaseous` This indicates if the fluid is gaseous.
    `protected int` | `luminosity` The light level emitted by this fluid.
    `protected EnumRarity` | `rarity` The rarity of the fluid.
    `protected IIcon` | `stillIcon` The Icons for this fluid.
    `protected int` | `temperature` Temperature of the fluid - completely arbitrary; higher temperature indicates that the fluid is hotter than air.
    `protected java.lang.String` | `unlocalizedName` The unlocalized name of this fluid.
    `protected int` | `viscosity` Viscosity ("thickness") of the fluid - completely arbitrary; negative values are not permissible.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Fluid(java.lang.String fluidName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canBePlacedInWorld()`
    `Block` | `getBlock()`
    `int` | `getColor()`
    `int` | `getColor(FluidStack stack)`
    `int` | `getColor(World world, int x, int y, int z)`
    `int` | `getDensity()`
    `int` | `getDensity(FluidStack stack)`
    `int` | `getDensity(World world, int x, int y, int z)`
    `IIcon` | `getFlowingIcon()`
    `IIcon` | `getIcon()`
    `IIcon` | `getIcon(FluidStack stack)`
    `IIcon` | `getIcon(World world, int x, int y, int z)`
    `int` | `getID()`
    `java.lang.String` | `getLocalizedName()` Returns the localized name of this fluid.
    `int` | `getLuminosity()`
    `int` | `getLuminosity(FluidStack stack)`
    `int` | `getLuminosity(World world, int x, int y, int z)`
    `java.lang.String` | `getName()`
    `EnumRarity` | `getRarity()`
    `EnumRarity` | `getRarity(FluidStack stack)`
    `EnumRarity` | `getRarity(World world, int x, int y, int z)`
    `int` | `getSpriteNumber()` Returns 0 for "/terrain.png".
    `IIcon` | `getStillIcon()`
    `int` | `getTemperature()`
    `int` | `getTemperature(FluidStack stack)`
    `int` | `getTemperature(World world, int x, int y, int z)`
    `java.lang.String` | `getUnlocalizedName()` Returns the unlocalized name of this fluid.
    `int` | `getViscosity()`
    `int` | `getViscosity(FluidStack stack)`
    `int` | `getViscosity(World world, int x, int y, int z)`
    `boolean` | `isGaseous()`
    `boolean` | `isGaseous(FluidStack stack)`
    `boolean` | `isGaseous(World world, int x, int y, int z)`
    `static void` | `registerLegacyName(java.lang.String legacyName, java.lang.String canonicalName)` Register a legacy liquid name with the Fluids system
    `Fluid` | `setBlock(Block block)`
    `Fluid` | `setDensity(int density)`
    `Fluid` | `setFlowingIcon(IIcon flowingIcon)`
    `Fluid` | `setGaseous(boolean isGaseous)`
    `Fluid` | `setIcons(IIcon commonIcon)`
    `Fluid` | `setIcons(IIcon stillIcon, IIcon flowingIcon)`
    `Fluid` | `setLuminosity(int luminosity)`
    `Fluid` | `setRarity(EnumRarity rarity)`
    `Fluid` | `setStillIcon(IIcon stillIcon)`
    `Fluid` | `setTemperature(int temperature)`
    `Fluid` | `setUnlocalizedName(java.lang.String unlocalizedName)`
    `Fluid` | `setViscosity(int viscosity)`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### fluidName

          protected final java.lang.String fluidName

      The unique identification name for this fluid.

    - #### unlocalizedName

          protected java.lang.String unlocalizedName

      The unlocalized name of this fluid.

    - #### stillIcon

          protected IIcon stillIcon

      The Icons for this fluid.

    - #### flowingIcon

          protected IIcon flowingIcon

    - #### luminosity

          protected int luminosity

      The light level emitted by this fluid. Default value is 0, as most fluids do not actively emit light.

    - #### density

          protected int density

      Density of the fluid - completely arbitrary; negative density indicates that the fluid is lighter than air. Default value is approximately the real-life density of water in kg/m^3.

    - #### temperature

          protected int temperature

      Temperature of the fluid - completely arbitrary; higher temperature indicates that the fluid is hotter than air. Default value is approximately the real-life room temperature of water in degrees Kelvin.

    - #### viscosity

          protected int viscosity

      Viscosity ("thickness") of the fluid - completely arbitrary; negative values are not permissible. Default value is approximately the real-life density of water in m/s^2 (x10^-3).

    - #### isGaseous

          protected boolean isGaseous

      This indicates if the fluid is gaseous. Useful for rendering the fluid in containers and the world. Generally this is associated with negative density fluids.

    - #### rarity

          protected EnumRarity rarity

      The rarity of the fluid. Used primarily in tool tips.

    - #### block

          protected Block block

      If there is a Block implementation of the Fluid, the Block is linked here. The default value of null should remain for any Fluid without a Block implementation.

  - ### Constructor Detail

    - #### Fluid

          public Fluid(java.lang.String fluidName)

  - ### Method Detail

    - #### setUnlocalizedName

          public Fluid setUnlocalizedName(java.lang.String unlocalizedName)

    - #### setBlock

          public Fluid setBlock(Block block)

    - #### setLuminosity

          public Fluid setLuminosity(int luminosity)

    - #### setDensity

          public Fluid setDensity(int density)

    - #### setTemperature

          public Fluid setTemperature(int temperature)

    - #### setViscosity

          public Fluid setViscosity(int viscosity)

    - #### setGaseous

          public Fluid setGaseous(boolean isGaseous)

    - #### setRarity

          public Fluid setRarity(EnumRarity rarity)

    - #### getName

          public final java.lang.String getName()

    - #### getID

          public final int getID()

    - #### getBlock

          public final Block getBlock()

    - #### canBePlacedInWorld

          public final boolean canBePlacedInWorld()

    - #### getLocalizedName

          public java.lang.String getLocalizedName()

      Returns the localized name of this fluid.

    - #### getUnlocalizedName

          public java.lang.String getUnlocalizedName()

      Returns the unlocalized name of this fluid.

    - #### getSpriteNumber

          public final int getSpriteNumber()

      Returns 0 for "/terrain.png". ALL FLUID TEXTURES MUST BE ON THIS SHEET.

    - #### getLuminosity

          public final int getLuminosity()

    - #### getDensity

          public final int getDensity()

    - #### getTemperature

          public final int getTemperature()

    - #### getViscosity

          public final int getViscosity()

    - #### isGaseous

          public final boolean isGaseous()

    - #### getRarity

          public EnumRarity getRarity()

    - #### getColor

          public int getColor()

    - #### setStillIcon

          public final Fluid setStillIcon(IIcon stillIcon)

    - #### setFlowingIcon

          public final Fluid setFlowingIcon(IIcon flowingIcon)

    - #### setIcons

          public final Fluid setIcons(IIcon stillIcon,
                       IIcon flowingIcon)

    - #### setIcons

          public final Fluid setIcons(IIcon commonIcon)

    - #### getIcon

          public IIcon getIcon()

    - #### getStillIcon

          public IIcon getStillIcon()

    - #### getFlowingIcon

          public IIcon getFlowingIcon()

    - #### getLuminosity

          public int getLuminosity(FluidStack stack)

    - #### getDensity

          public int getDensity(FluidStack stack)

    - #### getTemperature

          public int getTemperature(FluidStack stack)

    - #### getViscosity

          public int getViscosity(FluidStack stack)

    - #### isGaseous

          public boolean isGaseous(FluidStack stack)

    - #### getRarity

          public EnumRarity getRarity(FluidStack stack)

    - #### getColor

          public int getColor(FluidStack stack)

    - #### getIcon

          public IIcon getIcon(FluidStack stack)

    - #### getLuminosity

          public int getLuminosity(World world,
                          int x,
                          int y,
                          int z)

    - #### getDensity

          public int getDensity(World world,
                       int x,
                       int y,
                       int z)

    - #### getTemperature

          public int getTemperature(World world,
                           int x,
                           int y,
                           int z)

    - #### getViscosity

          public int getViscosity(World world,
                         int x,
                         int y,
                         int z)

    - #### isGaseous

          public boolean isGaseous(World world,
                          int x,
                          int y,
                          int z)

    - #### getRarity

          public EnumRarity getRarity(World world,
                             int x,
                             int y,
                             int z)

    - #### getColor

          public int getColor(World world,
                     int x,
                     int y,
                     int z)

    - #### getIcon

          public IIcon getIcon(World world,
                      int x,
                      int y,
                      int z)

    - #### registerLegacyName

          public static void registerLegacyName(java.lang.String legacyName,
                                java.lang.String canonicalName)

      Register a legacy liquid name with the Fluids system
      Parameters:
        `legacyName` - The legacy name to recognize
        `canonicalName` - The canonical fluid name it will become