OSDN Git Service

文字コードをSJISからUTF8へ
[chemicraft/chemicraft.git] / src / ItemCompounds.java
index 6c521b5..543de67 100644 (file)
@@ -5,8 +5,10 @@ import java.util.List;
 import cpw.mods.fml.common.Side;
 import cpw.mods.fml.common.asm.SideOnly;
 import net.minecraft.src.CreativeTabs;
+import net.minecraft.src.Entity;
 import net.minecraft.src.Item;
 import net.minecraft.src.ItemStack;
+import net.minecraft.src.World;
 
 public class ItemCompounds extends Item {
 
@@ -15,7 +17,18 @@ public class ItemCompounds extends Item {
                this.maxStackSize = 1;
                this.setHasSubtypes(true);
                this.setMaxDamage(0);
-               this.setCreativeTab(CreativeTabs.tabMaterials);
+               this.setCreativeTab(ChemiCraft.tabAtoms);
+       }
+
+       @Override
+       public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5){
+               for(int i=0;i < ChemiCraftAPI.getCompoundsName().size();i++){
+                       for(int j=0;j < ChemiCraftAPI.getCompoundHandlerItemName().size();j++){
+                               if(ChemiCraftAPI.getCompoundsName().get(i).equals(ChemiCraftAPI.getCompoundHandlerItemName().get(i))){
+                                       ChemiCraftAPI.getCompoundHandler().get(j).onUpdateHandler(par1ItemStack, par2World, par3Entity, par4, par5);
+                               }
+                       }
+               }
        }
 
        @SideOnly(Side.CLIENT)