OSDN Git Service

GUIのSlot追加
[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                 ItemStack itemStack = new ItemStack(this);
22         }
23
24
25
26         @SideOnly(Side.CLIENT)
27         @Override
28         public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
29                 for(int type = 0; type < ChemiCraft.instance.atomsName.length; 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() + "." + ChemiCraft.instance.atomsName[par1ItemStack.getItemDamage()];
41         }
42
43
44
45         @Override
46         public String getTextureFile(){
47                 return ChemiCraft.instance.itemAtomsTexture;
48         }
49
50
51
52         @SideOnly(Side.CLIENT)
53         @Override
54         public int getIconFromDamage(int par1){
55                 return par1;
56         }
57
58 }