OSDN Git Service

94cc0198d013cc537b5b78c41a4a7ff4e8ee2e0c
[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.tabAtoms);
21     }
22
23     @SideOnly(Side.CLIENT)
24     @Override
25     public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
26     {
27         for(int type = 0; type < ChemiCraft.atomsName.length; type++)
28         {
29               par3List.add(new ItemStack(par1, 1, type));
30               this.setIconIndex(type);
31         }
32     }
33
34     @Override
35     public String getItemNameIS(ItemStack par1ItemStack)
36     {
37         return super.getItemName() + "." + ChemiCraft.atomsName[par1ItemStack.getItemDamage()];
38     }
39
40     @Override
41     public String getTextureFile()
42     {
43         this.isDefaultTexture = false;
44         return "/ChemiCraft/Atoms.png";
45     }
46
47     @SideOnly(Side.CLIENT)
48     @Override
49     public int getIconFromDamage(int par1)
50     {
51         return par1;
52     }
53
54 }