OSDN Git Service

ソース参照
[chemicraft/ChemiCraftNext.git] / common / pcc / chemicraft / core / ChemiCraftRegisterItem.java
1 package pcc.chemicraft.core;
2
3 import net.minecraft.client.renderer.texture.IconRegister;
4 import net.minecraft.creativetab.CreativeTabs;
5 import net.minecraft.item.ItemFood;
6 import net.minecraft.item.ItemStack;
7 import pcc.chemicraft.ChemiCraft;
8 import pcc.chemicraft.core.item.ItemAtoms;
9 import pcc.chemicraft.core.item.ItemChemicalCell;
10 import pcc.chemicraft.core.item.ItemCompounds;
11 import pcc.chemicraft.core.item.ItemGasCollectingBottle;
12 import cpw.mods.fml.relauncher.Side;
13 import cpw.mods.fml.relauncher.SideOnly;
14
15 /**
16  * アイテムを追加します
17  * @author mozipi,ponkotate
18  */
19 public class ChemiCraftRegisterItem extends ChemiCraftCoreRegister {
20
21         public ChemiCraftRegisterItem(ChemiCraftCore mod) {
22                 super(mod);
23         }
24
25         @Override
26         public void start() {
27                 //Itemを変数に代入
28                 this.mod.itemAtoms = new ItemAtoms(this.mod.atomsID).setUnlocalizedName(ChemiCraft.TEXTURE + "atoms");
29                 this.mod.itemCompounds = new ItemCompounds(this.mod.compoundsID).setUnlocalizedName("compounds");
30                 this.mod.itemGasCollectingBottle = new ItemGasCollectingBottle(this.mod.gasCollectingBottleID).setUnlocalizedName("gasCollectingBottle");
31                 this.mod.itemChemicalCells = new ItemChemicalCell(this.mod.chemicalCellsID).setUnlocalizedName("chemicalCell");
32                 this.mod.itemPear = new ItemFood(this.mod.pearID, 4, 0.4F, false){
33                         @Override
34                         @SideOnly(Side.CLIENT)
35                         public void updateIcons(IconRegister par1IconRegister) {
36                                 this.iconIndex = par1IconRegister.registerIcon("appleGold");
37                         }
38                         @Override
39                         public int getColorFromItemStack(ItemStack par1ItemStack,int par2){
40                                 return 0x66FF66;
41                                 }
42                         }.setCreativeTab(CreativeTabs.tabFood).setUnlocalizedName(ChemiCraft.TEXTURE + "Pear");
43
44                 //名前登録&Minecraftに登録
45                 this.mod.nameAuxiliary.addName(this.mod.itemAtoms, ChemiCraftCore.ATOMSNAME);
46                 this.mod.nameAuxiliary.addName(this.mod.itemAtoms, "ja_JP", ChemiCraftCore.ATOMSNAMEJP);
47                 this.mod.nameAuxiliary.addName(this.mod.itemGasCollectingBottle, "GasCollectingBottle");
48                 this.mod.nameAuxiliary.addName(this.mod.itemGasCollectingBottle, "ja_JP", "集気瓶");
49                 this.mod.nameAuxiliary.addName(this.mod.itemChemicalCells, "ChemicalCell");
50                 this.mod.nameAuxiliary.addName(this.mod.itemChemicalCells, "ja_JP",  "化学電池");
51                 this.mod.nameAuxiliary.addName(this.mod.itemPear, "Pear");
52                 this.mod.nameAuxiliary.addName(this.mod.itemPear, "ja_JP",  "梨");
53
54         }
55
56 }