net.minecraftforge.fluids

## Interface IFluidHandler

- All Known Implementing Classes:
    TileFluidHandler

      public interface IFluidHandler

  Implement this interface on TileEntities which should handle fluids, generally storing them in one or more internal `IFluidTank` objects. A reference implementation is provided `TileFluidHandler`.
  Author:
    King Lemming

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canDrain(ForgeDirection from, Fluid fluid)` Returns true if the given fluid can be extracted from the given direction.
    `boolean` | `canFill(ForgeDirection from, Fluid fluid)` Returns true if the given fluid can be inserted into the given direction.
    `FluidStack` | `drain(ForgeDirection from, FluidStack resource, boolean doDrain)` Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.
    `FluidStack` | `drain(ForgeDirection from, int maxDrain, boolean doDrain)` Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.
    `int` | `fill(ForgeDirection from, FluidStack resource, boolean doFill)` Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler.
    `FluidTankInfo[]` | `getTankInfo(ForgeDirection from)` Returns an array of objects which represent the internal tanks.

- - ### Method Detail

    - #### fill

          int fill(ForgeDirection from,
                 FluidStack resource,
                 boolean doFill)

      Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler.
      Parameters:
        `from` - Orientation the Fluid is pumped in from.
        `resource` - FluidStack representing the Fluid and maximum amount of fluid to be filled.
        `doFill` - If false, fill will only be simulated.
      Returns:
        Amount of resource that was (or would have been, if simulated) filled.

    - #### drain

          FluidStack drain(ForgeDirection from,
                         FluidStack resource,
                         boolean doDrain)

      Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.
      Parameters:
        `from` - Orientation the Fluid is drained to.
        `resource` - FluidStack representing the Fluid and maximum amount of fluid to be drained.
        `doDrain` - If false, drain will only be simulated.
      Returns:
        FluidStack representing the Fluid and amount that was (or would have been, if simulated) drained.

    - #### drain

          FluidStack drain(ForgeDirection from,
                         int maxDrain,
                         boolean doDrain)

      Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler. This method is not Fluid-sensitive.
      Parameters:
        `from` - Orientation the fluid is drained to.
        `maxDrain` - Maximum amount of fluid to drain.
        `doDrain` - If false, drain will only be simulated.
      Returns:
        FluidStack representing the Fluid and amount that was (or would have been, if simulated) drained.

    - #### canFill

          boolean canFill(ForgeDirection from,
                        Fluid fluid)

      Returns true if the given fluid can be inserted into the given direction. More formally, this should return true if fluid is able to enter from the given direction.

    - #### canDrain

          boolean canDrain(ForgeDirection from,
                         Fluid fluid)

      Returns true if the given fluid can be extracted from the given direction. More formally, this should return true if fluid is able to leave from the given direction.

    - #### getTankInfo

          FluidTankInfo[] getTankInfo(ForgeDirection from)

      Returns an array of objects which represent the internal tanks. These objects cannot be used to manipulate the internal tanks. See `FluidTankInfo`.
      Parameters:
        `from` - Orientation determining which tanks should be queried.
      Returns:
        Info for the relevant internal tanks.