1 package net.minecraft.src.ChemiCraft;
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.tabAtoms);
24 public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
25 for(int i=0;i < ChemiCraftAPI.getCompoundsName().size();i++){
26 for(int j=0;j < ChemiCraftAPI.getCompoundHandlerItemName().size();j++){
27 if(ChemiCraftAPI.getCompoundsName().get(i).equals(ChemiCraftAPI.getCompoundHandlerItemName().get(i))){
28 ChemiCraftAPI.getCompoundHandler().get(j).onUpdateHandler(par1ItemStack, par2World, par3Entity, par4, par5);
34 @SideOnly(Side.CLIENT)
36 public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
38 for(int type = 0; type < ChemiCraftAPI.getCompoundsName().toArray().length; type++)
40 par3List.add(new ItemStack(par1, 1, type));
41 this.setIconIndex(type);
46 public String getItemNameIS(ItemStack par1ItemStack)
48 return super.getItemName() + "." + ChemiCraftAPI.getCompoundsName().toArray()[par1ItemStack.getItemDamage()];
52 public String getTextureFile()
54 this.isDefaultTexture = false;
55 return "/ChemiCraft/Compounds.png";
58 @SideOnly(Side.CLIENT)
60 public int getIconFromDamage(int par1)