5 import cpw.mods.fml.common.Side;
6 import cpw.mods.fml.common.asm.SideOnly;
7 import net.minecraft.src.CreativeTabs;
8 import net.minecraft.src.Entity;
9 import net.minecraft.src.Item;
10 import net.minecraft.src.ItemStack;
11 import net.minecraft.src.World;
13 public class ItemCompounds extends Item {
15 public ItemCompounds(int par1){
17 this.maxStackSize = 1;
18 this.setHasSubtypes(true);
20 this.setCreativeTab(ChemiCraft.instance.creativeTab);
26 public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
27 for(int i=0;i < ChemiCraftAPI.getCompoundsName().size();i++){
28 for(int j=0;j < ChemiCraftAPI.getCompoundHandlerItemName().size();j++){
29 if(ChemiCraftAPI.getCompoundsName().get(i).equals(ChemiCraftAPI.getCompoundHandlerItemName().get(i))){
30 ChemiCraftAPI.getCompoundHandler().get(j).onUpdateHandler(par1ItemStack, par2World, par3Entity, par4, par5);
38 @SideOnly(Side.CLIENT)
40 public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
41 for(int type = 0; type < ChemiCraftAPI.getCompoundsName().toArray().length; type++)
43 par3List.add(new ItemStack(par1, 1, type));
44 this.setIconIndex(type);
51 public String getItemNameIS(ItemStack par1ItemStack){
52 return super.getItemName() + "." + ChemiCraftAPI.getCompoundsName().toArray()[par1ItemStack.getItemDamage()];
58 public String getTextureFile(){
59 return "/ChemiCraft/items/Compounds.png";
64 @SideOnly(Side.CLIENT)
66 public int getIconFromDamage(int par1){