001package net.minecraftforge.liquids;
002
003import net.minecraftforge.common.ForgeDirection;
004
005public interface ITankContainer {
006
007    /**
008     * Fills liquid into internal tanks, distribution is left to the ITankContainer.
009     * @param from Orientation the liquid is pumped in from.
010     * @param resource LiquidStack representing the maximum amount of liquid filled into the ITankContainer
011     * @param doFill If false filling will only be simulated.
012     * @return Amount of resource that was filled into internal tanks.
013     */
014    int fill(ForgeDirection from, LiquidStack resource, boolean doFill);
015    /**
016     * Fills liquid into the specified internal tank.
017     * @param from Orientation the liquid is pumped in from.
018     * @param resource LiquidStack representing the maximum amount of liquid filled into the ITankContainer
019     * @param doFill If false filling will only be simulated.
020     * @return Amount of resource that was filled into internal tanks.
021     */
022    int fill(int tankIndex, LiquidStack resource, boolean doFill);
023
024    /**
025     * Drains liquid out of internal tanks, distribution is left to the ITankContainer.
026     * @param from Orientation the liquid is drained to.
027     * @param maxDrain Maximum amount of liquid to drain.
028     * @param doDrain If false draining will only be simulated.
029     * @return LiquidStack representing the liquid and amount actually drained from the ITankContainer
030     */
031    LiquidStack drain(ForgeDirection from, int maxDrain, boolean doDrain);
032    /**
033     * Drains liquid out of the specified internal tank.
034     * @param from Orientation the liquid is drained to.
035     * @param maxDrain Maximum amount of liquid to drain.
036     * @param doDrain If false draining will only be simulated.
037     * @return LiquidStack representing the liquid and amount actually drained from the ITankContainer
038     */
039    LiquidStack drain(int tankIndex, int maxDrain, boolean doDrain);
040
041    /**
042     * @param direction tank side: UNKNOWN for default tank set
043     * @return Array of {@link LiquidTank}s contained in this ITankContainer for this direction
044     */
045    ILiquidTank[] getTanks(ForgeDirection direction);
046
047    /**
048     * Return the tank that this tank container desired to be used for the specified liquid type from the specified direction
049     *
050     * @param direction the direction
051     * @param type the liquid type, null is always an acceptable value
052     * @return a tank or null for no such tank
053     */
054    ILiquidTank getTank(ForgeDirection direction, LiquidStack type);
055
056}