1 package chemicraft.item;
5 import net.minecraft.src.CreativeTabs;
6 import net.minecraft.src.Entity;
7 import net.minecraft.src.Item;
8 import net.minecraft.src.ItemStack;
9 import net.minecraft.src.World;
10 import chemicraft.ChemiCraft;
11 import chemicraft.ChemiCraftAPI;
12 import cpw.mods.fml.common.Side;
13 import cpw.mods.fml.common.asm.SideOnly;
15 public class ItemCompounds extends Item {
17 public ItemCompounds(int par1){
19 this.maxStackSize = 1;
20 this.setHasSubtypes(true);
22 this.setCreativeTab(ChemiCraft.instance.creativeTab);
28 public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
29 for(int i=0;i < ChemiCraftAPI.instance.getCompoundsName().size();i++){
30 for(int j=0;j < ChemiCraftAPI.instance.getCompoundHandlerItemName().size();j++){
31 if(ChemiCraftAPI.instance.getCompoundsName().get(i).equals(ChemiCraftAPI.instance.getCompoundHandlerItemName().get(i))){
32 ChemiCraftAPI.instance.getCompoundHandler().get(j).onUpdateHandler(par1ItemStack, par2World, par3Entity, par4, par5);
40 @SideOnly(Side.CLIENT)
42 public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
43 for(int type = 0; type < ChemiCraftAPI.instance.getCompoundsName().toArray().length; type++)
45 par3List.add(new ItemStack(par1, 1, type));
46 this.setIconIndex(type);
53 public String getItemNameIS(ItemStack par1ItemStack){
54 return super.getItemName() + "." + ChemiCraftAPI.instance.getCompoundsName().toArray()[par1ItemStack.getItemDamage()];
60 public String getTextureFile(){
61 return ChemiCraft.instance.itemCompoundsTexture;
66 @SideOnly(Side.CLIENT)
68 public int getIconFromDamage(int par1){