OSDN Git Service

・ItemGrenadeクラスをItemAtomGrenadeクラスに変更
[chemicraft/chemicraft.git] / common / chemicraft / ChemiCraft.java
index 372656a..d86014b 100644 (file)
@@ -1,8 +1,9 @@
-package chemicraft;\r
+package chemicraft;\r
 \r
 import net.minecraft.src.Block;\r
 import net.minecraft.src.CreativeTabs;\r
 import net.minecraft.src.Item;\r
+import net.minecraft.src.ItemStack;\r
 import net.minecraft.src.Material;\r
 import net.minecraftforge.common.Configuration;\r
 import net.minecraftforge.common.Property;\r
@@ -66,6 +67,7 @@ public class ChemiCraft {
        public int atomsID;\r
        public int compoundsID;\r
        public int gasCollectingBottleID;\r
+       public int grenadeID;\r
 \r
        /**\r
         * BlockID\r
@@ -86,23 +88,25 @@ public class ChemiCraft {
        /**\r
         * Block型変数\r
         */\r
-       public Block blockDecompositionTable;\r
-       public Block blockChemicalCombinationTable;\r
-       public Block blockToolAndWeaponCraftingTable;\r
-       public Block blockMaterialCraftingTable;\r
+       public static Block blockDecompositionTable;\r
+       public static Block blockChemicalCombinationTable;\r
+       public static Block blockToolAndWeaponCraftingTable;\r
+       public static Block blockMaterialCraftingTable;\r
 \r
        /**\r
         * Item型変数\r
         */\r
-       public Item itemAtoms;\r
-       public Item itemCompounds;\r
-       public Item itemGasCollectingBottle;\r
+       public static Item itemAtoms;\r
+       public static Item itemCompounds;\r
+       public static Item itemGasCollectingBottle;\r
+       public static Item itemGrenade;\r
 \r
        /**\r
         * このmodで使用するTextureのパス\r
         */\r
        public String itemAtomsTexture = "/chemicraft/items/Atoms.png";\r
        public String itemCompoundsTexture = "/chemicraft/items/Compounds.png";\r
+       public String itemTexture = "/chemicraft/items/items.png";\r
        public String blockChemicalCraftingTableTexture = "/chemicraft/blocks/CCTable.png";\r
        public String guiDecompositionTexture = "/chemicraft/guis/Decomposition.png";\r
        public String guiChemicalCombinationTexture = "/chemicraft/guis/ChemicalCombination.png";\r
@@ -115,7 +119,6 @@ public class ChemiCraft {
        private Auxiliary Auxiliary = new Auxiliary();\r
        private NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary();\r
 \r
-\r
        @Mod.PreInit\r
        public void chemiPreLoadMethod(FMLPreInitializationEvent event) {\r
                Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());\r
@@ -129,6 +132,7 @@ public class ChemiCraft {
                Property atomsIDProp = cfg.getItem("AtomsID", 25000);\r
                Property compoundsIDProp = cfg.getItem("CompoundsID", 25001);\r
                Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002);\r
+               Property grenadeIDProp = cfg.getItem("GrenadeID0", 25003);\r
 \r
                Property guiDecompositionTableIDProp = cfg.get("GUI", "GUIChemicalCraftingTableID", 1000);\r
                Property guiChemicalCombinationTableIDProp = cfg.get("GUI", "GUIChemicalCombinationTableID", 1001);\r
@@ -143,6 +147,7 @@ public class ChemiCraft {
                this.atomsID = atomsIDProp.getInt();\r
                this.compoundsID = compoundsIDProp.getInt();\r
                this.gasCollectingBottleID = gasCollectingBottleIDProp.getInt();\r
+               this.grenadeID = grenadeIDProp.getInt();\r
                this.guiDecompositionTableID = guiDecompositionTableIDProp.getInt();\r
                this.guiChemicalCombinationTableID = guiChemicalCombinationTableIDProp.getInt();\r
                this.guiToolAndWeaponCraftingTableID = guiToolAndWeaponCraftingTableIDProp.getInt();\r
@@ -158,8 +163,8 @@ public class ChemiCraft {
        @Mod.PostInit\r
        public void chemiPostLoadMethod(FMLPostInitializationEvent event) {\r
                // API用の処理\r
-               this.NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray());\r
-               this.NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray());\r
+               this.NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.instance.getCompoundsName().toArray());\r
+               this.NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.instance.getCompoundsLangName().toArray());\r
 \r
                // Blockを追加します\r
                this.blockDecompositionTable = new BlockDecompositionTable(this.decompositionTableID, 0, Material.ground).setHardness(2.0F).setResistance(0.0F).setStepSound(Block.soundStoneFootstep).setBlockName("DecompositionTable");\r
@@ -171,7 +176,8 @@ public class ChemiCraft {
                // Itemを追加します\r
                this.itemAtoms = new ItemAtoms(this.atomsID).setItemName("atoms");\r
                this.itemCompounds = new ItemCompounds(this.compoundsID).setItemName("compounds");\r
-               this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle");\r
+               this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);\r
+               this.itemGrenade = new ItemAtomGrenade(this.grenadeID).setItemName("grenade").setIconIndex(1);\r
 \r
                // BlockをMinecraftに登録します\r
                GameRegistry.registerBlock(this.blockDecompositionTable);\r
@@ -195,6 +201,8 @@ public class ChemiCraft {
                this.NameAuxiliary.addName(this.itemAtoms, "ja_JP", atomsNameJP);\r
                this.NameAuxiliary.addName(this.itemGasCollectingBottle, "GasCollectingBottle");\r
                this.NameAuxiliary.addName(this.itemGasCollectingBottle, "ja_JP", "集気瓶");\r
+               this.NameAuxiliary.addName(this.itemGrenade, "AtomGrenade");\r
+               this.NameAuxiliary.addName(this.itemGrenade, "元素手榴弾");\r
 \r
                // TileEntityを追加します\r
                GameRegistry.registerTileEntity(TileEntityDecompositionTable.class, "DecompositionTable");\r
@@ -207,6 +215,18 @@ public class ChemiCraft {
 \r
                //Textureをpreloadします\r
                proxy.registerTextures();\r
+\r
+               ChemiCraftAPI.instance.addMaterialRecipe(new ItemStack[]{new ItemStack(Block.dirt)}, new ItemStack(this.itemGrenade), new NBTRecipeGrenade());\r
+\r
        }\r
 \r
+       public final static int HYDROGEN = 0;\r
+       public final static int HELIUM = 1;\r
+       public final static int LITHIUM = 2;\r
+       public final static int BERYLLIUM = 3;\r
+       public final static int BORON = 4;\r
+       public final static int CARBON = 5;\r
+       public final static int NITROGEN = 6;\r
+       public final static int URANIUM = 92;\r
+\r
 }
\ No newline at end of file