2012-11-11 02:23:16 +00:00
|
|
|
package net.minecraftforge.liquids;
|
|
|
|
|
2012-11-15 02:22:44 +00:00
|
|
|
/**
|
|
|
|
* A tank is the unit of interaction with liquid inventories.
|
|
|
|
*
|
|
|
|
* @author cpw
|
|
|
|
*/
|
2012-11-11 02:23:16 +00:00
|
|
|
public interface ILiquidTank {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return LiquidStack representing the liquid contained in the tank, null if empty.
|
|
|
|
*/
|
|
|
|
LiquidStack getLiquid();
|
2012-11-15 02:22:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* These shouldn't be used to interact with a foreign tank. Use {@link #fill(LiquidStack, boolean)}
|
|
|
|
* and {@link #drain(int, boolean)}.
|
|
|
|
*
|
|
|
|
* @param liquid
|
|
|
|
*/
|
|
|
|
@Deprecated
|
2012-11-11 02:23:16 +00:00
|
|
|
void setLiquid(LiquidStack liquid);
|
2012-11-15 02:22:44 +00:00
|
|
|
/**
|
|
|
|
* This method should not be used to interact with a foreign tank. Use {@link #fill(LiquidStack, boolean)}
|
|
|
|
* and {@link #drain(int, boolean)}.
|
|
|
|
*
|
|
|
|
* @param capacity
|
|
|
|
*/
|
|
|
|
@Deprecated
|
2012-11-11 02:23:16 +00:00
|
|
|
void setCapacity(int capacity);
|
2012-11-15 02:22:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return capacity of this tank
|
|
|
|
*/
|
2012-11-11 02:23:16 +00:00
|
|
|
int getCapacity();
|
|
|
|
|
|
|
|
/**
|
2012-11-13 19:27:31 +00:00
|
|
|
*
|
2012-11-11 02:23:16 +00:00
|
|
|
* @param resource
|
|
|
|
* @param doFill
|
|
|
|
* @return Amount of liquid used for filling.
|
|
|
|
*/
|
|
|
|
int fill(LiquidStack resource, boolean doFill);
|
|
|
|
/**
|
2012-11-13 19:27:31 +00:00
|
|
|
*
|
2012-11-11 02:23:16 +00:00
|
|
|
* @param maxDrain
|
|
|
|
* @param doDrain
|
|
|
|
* @return Null if nothing was drained, otherwise a LiquidStack containing the drained.
|
|
|
|
*/
|
|
|
|
LiquidStack drain(int maxDrain, boolean doDrain);
|
2012-11-13 19:27:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Positive values indicate a positive liquid pressure (liquid wants to leave this tank)
|
|
|
|
* Negative values indicate a negative liquid pressure (liquid wants to fill this tank)
|
|
|
|
* Zero indicates no pressure
|
|
|
|
*
|
|
|
|
* @return a number indicating tank pressure
|
|
|
|
*/
|
|
|
|
public int getTankPressure();
|
|
|
|
|
2012-11-11 02:23:16 +00:00
|
|
|
}
|