2013-11-27 02:11:26 +01:00
|
|
|
package mekanism.api.gas;
|
2012-11-15 21:04:12 +01:00
|
|
|
|
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-12-12 22:54:55 +01:00
|
|
|
public interface IGasItem
|
2012-11-15 21:04:12 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Gets the rate of transfer this item can handle.
|
|
|
|
* @return
|
|
|
|
*/
|
2013-11-28 05:42:54 +01:00
|
|
|
public int getRate(ItemStack itemstack);
|
2012-11-15 21:04:12 +01:00
|
|
|
|
|
|
|
/**
|
2013-11-28 05:42:54 +01:00
|
|
|
* Adds a defined amount of a certain gas to an item.
|
|
|
|
* @param itemstack - the itemstack to add gas to
|
2012-11-28 16:33:34 +01:00
|
|
|
* @param type - the type of gas to add
|
|
|
|
* @param amount - the amount of gas to add
|
2013-11-28 05:42:54 +01:00
|
|
|
* @return the gas that was accepted by the item
|
2012-11-15 21:04:12 +01:00
|
|
|
*/
|
2013-11-27 02:11:26 +01:00
|
|
|
public int addGas(ItemStack itemstack, GasStack stack);
|
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.
|
2013-11-28 05:42:54 +01:00
|
|
|
* @param itemstack - the itemstack to remove gas from
|
2012-11-28 16:33:34 +01:00
|
|
|
* @param type - the type of gas to remove
|
|
|
|
* @param amount - the amount of gas to remove
|
2013-11-28 05:42:54 +01:00
|
|
|
* @return the gas that was removed by the item
|
2012-11-15 21:04:12 +01:00
|
|
|
*/
|
2013-11-27 02:11:26 +01:00
|
|
|
public GasStack removeGas(ItemStack itemstack, 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
|
|
|
|
*/
|
2013-11-27 02:11:26 +01:00
|
|
|
public boolean canReceiveGas(ItemStack itemstack, Gas type);
|
2012-11-28 16:33:34 +01:00
|
|
|
|
|
|
|
/**
|
2013-11-28 05:42:54 +01:00
|
|
|
* Whether or not this item can give a gas receiver a certain type of gas.
|
2012-11-28 16:33:34 +01:00
|
|
|
* @param itemstack - the itemstack to check
|
2013-11-28 05:42:54 +01:00
|
|
|
* @param type - the type of gas the tank can provide
|
2012-11-28 16:33:34 +01:00
|
|
|
* @return if the item can provide gas
|
|
|
|
*/
|
2013-11-27 02:11:26 +01:00
|
|
|
public boolean canProvideGas(ItemStack itemstack, Gas type);
|
2013-12-12 22:54:55 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the gas of a declared type.
|
|
|
|
* @param type - type of gas
|
|
|
|
* @param data - ItemStack parameter if necessary
|
|
|
|
* @return gas stored
|
|
|
|
*/
|
|
|
|
public GasStack getGas(ItemStack itemstack);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the gas of a declared type to a new amount;
|
|
|
|
* @param type - type of gas
|
|
|
|
* @param data - ItemStack parameter if necessary
|
|
|
|
* @param amount - amount to store
|
|
|
|
*/
|
|
|
|
public void setGas(ItemStack itemstack, GasStack stack);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the maximum amount of gas this tile entity can store.
|
|
|
|
* @param type - type of gas
|
|
|
|
* @param data - ItemStack parameter if necessary
|
|
|
|
* @return maximum gas
|
|
|
|
*/
|
|
|
|
public int getMaxGas(ItemStack itemstack);
|
2012-11-15 21:04:12 +01:00
|
|
|
}
|