001    package net.minecraftforge.liquids;
002    
003    /**
004     * A tank is the unit of interaction with liquid inventories.
005     *
006     * @author cpw
007     */
008    public interface ILiquidTank {
009    
010        /**
011         * @return LiquidStack representing the liquid contained in the tank, null if empty.
012         */
013        LiquidStack getLiquid();
014    
015        /**
016         * @return capacity of this tank
017         */
018        int getCapacity();
019    
020        /**
021         *
022         * @param resource
023         * @param doFill
024         * @return Amount of liquid used for filling.
025         */
026        int fill(LiquidStack resource, boolean doFill);
027        /**
028         *
029         * @param maxDrain
030         * @param doDrain
031         * @return Null if nothing was drained, otherwise a LiquidStack containing the drained.
032         */
033        LiquidStack drain(int maxDrain, boolean doDrain);
034    
035        /**
036         * Positive values indicate a positive liquid pressure (liquid wants to leave this tank)
037         * Negative values indicate a negative liquid pressure (liquid wants to fill this tank)
038         * Zero indicates no pressure
039         *
040         * @return a number indicating tank pressure
041         */
042        public int getTankPressure();
043    
044    }