net.minecraftforge.fluids

## Class TileFluidHandler

- java.lang.Object
- - net.minecraft.tileentity.TileEntity
  - - net.minecraftforge.fluids.TileFluidHandler

- All Implemented Interfaces:
    IFluidHandler

      public class TileFluidHandler
      extends TileEntity
      implements IFluidHandler

  Reference Tile Entity implementation of `IFluidHandler`. Use/extend this or write your own.
  Author:
    King Lemming

- - ### Field Summary

    - ### Fields inherited from class net.minecraft.tileentity.TileEntity

      `blockMetadata, blockType, INFINITE_EXTENT_AABB, worldObj, xCoord, yCoord, zCoord`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TileFluidHandler()`

  - ### 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.
    `void` | `readFromNBT(NBTTagCompound tag)` Reads a tile entity from NBT.
    `void` | `writeToNBT(NBTTagCompound tag)` Writes a tile entity to NBT.

    - ### Methods inherited from class net.minecraft.tileentity.TileEntity

      `addMapping, canUpdate, createAndLoadEntity, func_85027_a, getBlockMetadata, getBlockType, getDescriptionPacket, getDistanceFrom, getMaxRenderDistanceSquared, getRenderBoundingBox, getWorldObj, hasWorldObj, invalidate, isInvalid, onChunkUnload, onDataPacket, onInventoryChanged, receiveClientEvent, setWorldObj, shouldRefresh, shouldRenderInPass, updateContainingBlockInfo, updateEntity, validate`

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

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

- - ### Constructor Detail

    - #### TileFluidHandler

          public TileFluidHandler()

  - ### Method Detail

    - #### readFromNBT

          public void readFromNBT(NBTTagCompound tag)

      Description copied from class: `TileEntity`
      Reads a tile entity from NBT.
      Overrides:
        `readFromNBT` in class `TileEntity`

    - #### writeToNBT

          public void writeToNBT(NBTTagCompound tag)

      Description copied from class: `TileEntity`
      Writes a tile entity to NBT.
      Overrides:
        `writeToNBT` in class `TileEntity`

    - #### fill

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

      Description copied from interface: `IFluidHandler`
      Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler.
      Specified by:
        `fill` in interface `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

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

      Description copied from interface: `IFluidHandler`
      Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.
      Specified by:
        `drain` in interface `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

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

      Description copied from interface: `IFluidHandler`
      Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler. This method is not Fluid-sensitive.
      Specified by:
        `drain` in interface `IFluidHandler`
      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

          public boolean canFill(ForgeDirection from,
                        Fluid fluid)

      Description copied from interface: `IFluidHandler`
      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.
      Specified by:
        `canFill` in interface `IFluidHandler`

    - #### canDrain

          public boolean canDrain(ForgeDirection from,
                         Fluid fluid)

      Description copied from interface: `IFluidHandler`
      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.
      Specified by:
        `canDrain` in interface `IFluidHandler`

    - #### getTankInfo

          public FluidTankInfo[] getTankInfo(ForgeDirection from)

      Description copied from interface: `IFluidHandler`
      Returns an array of objects which represent the internal tanks. These objects cannot be used to manipulate the internal tanks. See `FluidTankInfo`.
      Specified by:
        `getTankInfo` in interface `IFluidHandler`
      Parameters:
        `from` - Orientation determining which tanks should be queried.
      Returns:
        Info for the relevant internal tanks.