OSDN Git Service

tc
[chemicraft/chemicraft.git] / common / pcc / chemicraft / core / item / ItemChemiCell.java
1 package pcc.chemicraft.core.item;
2
3 import java.util.List;
4
5 import net.minecraft.creativetab.CreativeTabs;
6 import net.minecraft.item.Item;
7 import net.minecraft.item.ItemStack;
8 import pcc.chemicraft.ChemiCraft;
9 import pcc.chemicraft.core.ChemiCraftAPI;
10 import pcc.chemicraft.core.ChemiCraftCore;
11
12
13 public class ItemChemiCell extends Item
14 {
15
16         public ItemChemiCell(int par1)
17         {
18                 super(par1);
19                 this.maxStackSize = 64;
20                 this.setHasSubtypes(true);
21                 this.setMaxDamage(0);
22                 this.setCreativeTab(ChemiCraftCore.instance.creativeTabChemiCraft);
23         }
24
25
26
27         @Override
28         public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
29                 for(int type = 0; type < ChemiCraftAPI.instance().getChemicalCellsName().sizeKeysList(); type++)
30                 {
31                         par3List.add(new ItemStack(par1, 1, type));
32                         this.setIconIndex(type);
33                 }
34         }
35
36
37
38         @Override
39         public String getItemNameIS(ItemStack par1ItemStack){
40                 return super.getItemName() + "." + ChemiCraftAPI.instance().getChemicalCellsName().getKeyList(par1ItemStack.getItemDamage());
41         }
42
43
44
45         @Override
46         public String getTextureFile(){
47                 return ChemiCraft.ITEM_TEXTURE;
48         }
49
50 }