Mekanism-tilera-Edition/src/common/mekanism/api/IStorageTank.java

74 lines
1.5 KiB
Java
Raw Normal View History

v5 Beta #9 *Bumped animation textures to 32x32. *Added default parameter to TabProxy.tabMekanism(). *Added additional info to Machine/GeneratorType for better handling of metadata. *Added Reinforced Iron, a stronger version of an Iron Block. *Updated onBlockActivated() code to function correctly. *Added feature for a generator or power unit to be placed facing up or down. *Cleaned up GUI access/handler code. *Fixed electric machine shift-click bug. *Added Diamond Dust. *Fixed Energized Bow continuing to fire after it's energy is depleted. *Added HP information to armor and tools. *Fixed slot parameters. *Overhauled packet system. *Cleaned up tile entity hierarchy. *Added BuildCraft liquid support to Heat Generator to allow energy generation with both BuildCraft's fuel buckets and liquid fuel. *Fixed texture preloads. *Added Electolytic Separator -- a machine that separates hydrogen and oxygen molecules from water. It accepts water from BuildCraft pipes. *Added Hydrogen Generator -- a generator that by default generates 128 u/t, but has boosts by the block's height of up to 512 u/t. *Added Solar Generator, a generator that produces 32 u/t when it can see the sun. *Added Gas API! Simple gas management that allows for both storage of gas in items, blocks, and transfer between themselves. So far implemented gasses are oxygen and hydrogen. *Added LiquidSlot for easy management of liquid in tile entities. *Added Hydrogen Tank and Oxygen Tank items. *Added BuildCraft hooks. *Fixed zombies and skeletons spawning with Obsidian Armor, and lowered chances of spawning with any armor. *More OreDictionary registrations to fix IC2's different dust names. *Fixed some javadocs. *Added 'Solar Panel' item as a crafting element for a Solar Generator. *Minor bugfixes.
2012-11-15 21:04:12 +01:00
package mekanism.api;
import net.minecraft.src.*;
/**
* Implement this in your item class if it can store or transfer hydrogen.
* @author AidanBrady
*
*/
public interface IStorageTank
{
/**
* Gets the amount of gas the item has from NBT storage.
* @param itemstack
* @return amount of hydrogen
*/
public int getGas(ItemStack itemstack);
/**
* Sets the hydrogen the item has with NBT.
* @param itemstack
* @param energy
*/
public void setGas(ItemStack itemstack, int hydrogen);
/**
* 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();
/**
* Charges the item with the defined amount of hydrogen.
* @param itemstack
* @param amount
* @return leftover hydrogen
*/
public int addGas(ItemStack itemstack, int amount);
/**
* Removes the defined amount of hydrogen from the item.
* @param itemstack
* @param amount
* @return hydrogen discharged
*/
public int removeGas(ItemStack itemstack, int amount);
/**
* Gets the divider that gets that returns the max damage as 100.
* @return divider
*/
public int getDivider();
/**
* Whether or not this energized item be given hydrogen.
* @return if the item be charged
*/
public boolean canReceiveGas();
/**
* Whether or not this energized item can give a hydrogen receiver hydrogen.
* @return if the item can charge
*/
public boolean canProvideGas();
public EnumGas gasType();
}