OSDN Git Service

b766426dc993dfda1ad79e2d64c913ba20824adc
[chemicraft/chemicraft.git] / common / chemicraft / item / ItemAtoms.java
1 package chemicraft.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 chemicraft.ChemiCraft;
9 import cpw.mods.fml.relauncher.Side;
10 import cpw.mods.fml.relauncher.SideOnly;
11
12 public class ItemAtoms extends Item {
13
14         public ItemAtoms(int par1){
15                 super(par1);
16                 this.maxStackSize = 64;
17                 this.setHasSubtypes(true);
18                 this.setMaxDamage(0);
19                 this.setCreativeTab(ChemiCraft.instance.creativeTab);
20         }
21
22
23
24         @SuppressWarnings({ "unchecked", "rawtypes" })
25         @SideOnly(Side.CLIENT)
26         @Override
27         public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
28                 for(int type = 0; type < ChemiCraft.instance.ATOMSNAME.length; type++)
29                 {
30                         par3List.add(new ItemStack(par1, 1, type));
31                         this.setIconIndex(type);
32                 }
33         }
34
35
36
37         @Override
38         public String getItemNameIS(ItemStack par1ItemStack){
39                 return super.getItemName() + "." + ChemiCraft.instance.ATOMSNAME[par1ItemStack.getItemDamage()];
40         }
41
42
43
44         @Override
45         public String getTextureFile(){
46                 return ChemiCraft.instance.itemAtomsTexture;
47         }
48
49
50
51         @SideOnly(Side.CLIENT)
52         @Override
53         public int getIconFromDamage(int par1){
54                 return par1;
55         }
56
57 }