OSDN Git Service

4b94bbb4f0a16a91a309190bfa8217df98d4f6ef
[chemicraft/chemicraft.git] / common / chemicraft / ItemAtoms.java
1 package chemicraft;
2
3 import java.util.List;
4
5 import net.minecraft.src.CreativeTabs;
6 import net.minecraft.src.EntityPlayer;
7 import net.minecraft.src.Item;
8 import net.minecraft.src.ItemStack;
9 import net.minecraft.src.World;
10 import cpw.mods.fml.common.Side;
11 import cpw.mods.fml.common.asm.SideOnly;
12
13 public class ItemAtoms extends Item {
14
15         public ItemAtoms(int par1){
16                 super(par1);
17                 this.maxStackSize = 1;
18                 this.setHasSubtypes(true);
19                 this.setMaxDamage(0);
20                 this.setCreativeTab(ChemiCraft.instance.creativeTab);
21         }
22
23
24
25         @SideOnly(Side.CLIENT)
26         @Override
27         public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
28                 for(int type = 0; type < ChemiCraft.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.atomsName[par1ItemStack.getItemDamage()];
40         }
41
42
43
44         @Override
45         public String getTextureFile(){
46                 return "/ChemiCraft/items/Atoms.png";
47         }
48
49
50
51         @SideOnly(Side.CLIENT)
52         @Override
53         public int getIconFromDamage(int par1){
54                 return par1;
55         }
56
57 }