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