2012-11-15 21:04:12 +01:00
|
|
|
package mekanism.api;
|
|
|
|
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.api.gas.EnumGas;
|
|
|
|
import mekanism.api.gas.IGasStorage;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
2012-11-15 21:04:12 +01:00
|
|
|
|
|
|
|
/**
|
2012-11-28 16:33:34 +01:00
|
|
|
* Implement this in your item class if it can store or transfer certain gasses.
|
2012-11-15 21:04:12 +01:00
|
|
|
* @author AidanBrady
|
|
|
|
*
|
|
|
|
*/
|
2013-04-01 01:12:10 +02:00
|
|
|
public interface IStorageTank extends IGasStorage
|
2012-11-15 21:04:12 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Gets the rate of transfer this item can handle.
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public int getRate();
|
|
|
|
|
|
|
|
/**
|
2012-11-28 16:33:34 +01:00
|
|
|
* Adds a defined about of a certain gas to a Storage Tank.
|
|
|
|
* @param itemstack - the itemstack of a Storage Tank to add gas to
|
|
|
|
* @param type - the type of gas to add
|
|
|
|
* @param amount - the amount of gas to add
|
|
|
|
* @return leftover gas
|
2012-11-15 21:04:12 +01:00
|
|
|
*/
|
2012-11-28 16:33:34 +01:00
|
|
|
public int addGas(ItemStack itemstack, EnumGas type, int amount);
|
2012-11-15 21:04:12 +01:00
|
|
|
|
|
|
|
/**
|
2012-11-28 16:33:34 +01:00
|
|
|
* Removes the defined amount of a certain gas from the item.
|
|
|
|
* @param itemstack - the itemstack of a Storage Tank to remove gas from
|
|
|
|
* @param type - the type of gas to remove
|
|
|
|
* @param amount - the amount of gas to remove
|
|
|
|
* @return how much gas was used by this item
|
2012-11-15 21:04:12 +01:00
|
|
|
*/
|
2012-11-28 16:33:34 +01:00
|
|
|
public int removeGas(ItemStack itemstack, EnumGas type, int amount);
|
2012-11-15 21:04:12 +01:00
|
|
|
|
|
|
|
/**
|
2012-11-28 16:33:34 +01:00
|
|
|
* Whether or not this storage tank be given a specific gas.
|
|
|
|
* @param itemstack - the itemstack to check
|
|
|
|
* @param type - the type of gas the tank can possibly receive
|
2012-11-15 21:04:12 +01:00
|
|
|
* @return if the item be charged
|
|
|
|
*/
|
2012-11-28 16:33:34 +01:00
|
|
|
public boolean canReceiveGas(ItemStack itemstack, EnumGas type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not this energized item can give a gas receiver a certain amount of gas.
|
|
|
|
* @param itemstack - the itemstack to check
|
|
|
|
* @param type - the type of gas the tank can possibly provide
|
|
|
|
* @return if the item can provide gas
|
|
|
|
*/
|
|
|
|
public boolean canProvideGas(ItemStack itemstack, EnumGas type);
|
2012-11-15 21:04:12 +01:00
|
|
|
|
|
|
|
/**
|
2012-11-28 16:33:34 +01:00
|
|
|
* Gets this storage tank's current stored gas.
|
|
|
|
* @param itemstack - the itemstack of a Storage Tank to check.
|
|
|
|
* @return which gas the tank is holding
|
2012-11-15 21:04:12 +01:00
|
|
|
*/
|
2012-11-28 16:33:34 +01:00
|
|
|
public EnumGas getGasType(ItemStack itemstack);
|
2012-11-15 21:04:12 +01:00
|
|
|
|
2012-11-28 16:33:34 +01:00
|
|
|
/**
|
|
|
|
* Sets a storage tank's current stored gas.
|
|
|
|
* @param itemstack - the itemstack of a Storage Tank to set.
|
|
|
|
* @param type - the type of gas to change to
|
|
|
|
*/
|
|
|
|
public void setGasType(ItemStack itemstack, EnumGas type);
|
2012-11-15 21:04:12 +01:00
|
|
|
}
|