2012-11-15 21:04:12 +01:00
|
|
|
package mekanism.api;
|
|
|
|
|
|
|
|
import net.minecraft.src.*;
|
|
|
|
|
|
|
|
/**
|
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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public interface IStorageTank
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Gets the amount of gas the item has from NBT storage.
|
|
|
|
* @param itemstack
|
2012-11-28 16:33:34 +01:00
|
|
|
* @return amount of gas
|
2012-11-15 21:04:12 +01:00
|
|
|
*/
|
|
|
|
public int getGas(ItemStack itemstack);
|
|
|
|
|
|
|
|
/**
|
2012-11-28 16:33:34 +01:00
|
|
|
* Sets the gas the item has stored in it's NBTTagCompound.
|
|
|
|
* @param itemstack - itemstack of a Storage Tank to set the gas of
|
|
|
|
* @param type - the type of gas to set
|
|
|
|
* @param amount - the amount of gas to set
|
2012-11-15 21:04:12 +01:00
|
|
|
*/
|
2012-11-28 16:33:34 +01:00
|
|
|
public void setGas(ItemStack itemstack, EnumGas type, int amount);
|
2012-11-15 21:04:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the maximum amount of hydrogen this item can hold.
|
|
|
|
* @return maximum hydrogen
|
|
|
|
*/
|
|
|
|
public int getMaxGas();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the divider that gets that returns the max damage as 100.
|
|
|
|
* @return divider
|
|
|
|
*/
|
|
|
|
public int getDivider();
|
|
|
|
|
|
|
|
/**
|
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
|
|
|
}
|