OSDN Git Service

GUIのSlot追加
[chemicraft/chemicraft.git] / common / chemicraft / ChemiCraft.java
index 67993ad..ff5f577 100644 (file)
@@ -26,7 +26,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
 // クライアント、サーバー共に必要 1.3.2用\r
 public class ChemiCraft {\r
 \r
-       public static final String[] atomsName = {\r
+       public final String[] atomsName = {\r
                "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon",\r
                "Sodium", "Magnesium", "Aluminium", "Silicon", "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium",\r
                "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium", "Germanium", "Arsenic", "Selenium", "Bromine",\r
@@ -40,7 +40,7 @@ public class ChemiCraft {
        };\r
 \r
 \r
-       public static final String[] atomsNameJP = {\r
+       public final String[] atomsNameJP = {\r
                "水素", "ヘリウム", "リチウム", "ベリウム", "ホウ素", "炭素", "窒素", "酸素", "フッ素", "ネオン", "ナトリウム", "マグネシウム", "アルミニウム", "ケイ素", "リン",\r
                "硫黄", "塩素", "アルゴン", "カリウム", "カルシウム", "スカンジウム", "チタン", "バナジウム", "クロム", "マンガン", "鉄", "コバルト", "ニッケル", "銅", "亜鉛", "ガリウム", "ゲルマニウム", "ヒ素", "セレン", "臭素",\r
                "クリプトン", "ルビジウム", "ストロンチウム", "イットリウム", "ジルコニウム", "ニオブ", "モリブデン", "テクネチウム", "ルテニウム", "ロジウム", "パラジウム", "銀", "カドミウム", "インジウム", "スズ", "アンチモン", "テルル",\r
@@ -69,48 +69,61 @@ public class ChemiCraft {
        /**\r
         * ChemiCraftのCreativeTab\r
         */\r
-       public static CreativeTabs creativeTab = new CreativeTabAtoms("ChemiCraft");\r
+       public CreativeTabs creativeTab = new CreativeTabAtoms("ChemiCraft");\r
 \r
 \r
        /**\r
         * ItemID\r
         */\r
-       public static int atomsID;\r
-       public static int compoundsID;\r
-       public static int gasCollectingBottleID;\r
+       public int atomsID;\r
+       public int compoundsID;\r
+       public int gasCollectingBottleID;\r
 \r
 \r
        /**\r
         * BlockID\r
         */\r
-       public static int chemicalCraftingTableID;\r
+       public int chemicalCraftingTableID;\r
 \r
 \r
        /**\r
         * GUIID\r
         */\r
-       public static int guiChemicalCraftingTableID;\r
+       public int guiChemicalCraftingTableID;\r
 \r
 \r
        /**\r
         * Block型変数\r
         */\r
-       public static Block blockChemicalCraftingTable;\r
+       public Block blockChemicalCraftingTable;\r
 \r
 \r
        /**\r
         * Item型変数\r
         */\r
-       public static Item itemAtoms;\r
-       public static Item itemCompounds;\r
-       public static Item itemGasCollectingBottle;\r
+       public Item itemAtoms;\r
+       public Item itemCompounds;\r
+       public Item itemGasCollectingBottle;\r
+\r
+\r
+       /**\r
+        * このmodで使用するTextureのパス\r
+        */\r
+       private String resourcePath = "/resource/chemiCraft";\r
+       public String itemAtomsTexture = resourcePath + "/items/Atoms.png";\r
+       public String itemCompoundsTexture = resourcePath + "/items/Compounds.png";\r
+       public String blockChemicalCraftingTableTexture = resourcePath + "/blocks/CCTable.png";\r
+       public String guiDecompositionTexture = resourcePath + "/guis/Decomposition.png";\r
+       public String guiChemicalCombinationTexture = resourcePath + "/guis/ChemicalCombination.png";\r
+       public String guiToolAndWeaponCraftingTexture = resourcePath + "/guis/ToolAndWeaponCrafting.png";\r
+       public String guiMaterialCraftingTexture = resourcePath + "/guis/MaterialCrafting.png";\r
 \r
 \r
        /**\r
         * このmodに必要な補助クラスのインスタンス\r
         */\r
-       private static Auxiliary Auxiliary = new Auxiliary();\r
-       private static NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary();\r
+       private Auxiliary Auxiliary = new Auxiliary();\r
+       private NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary();\r
 \r
 \r
 \r
@@ -125,11 +138,11 @@ public class ChemiCraft {
                Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002);\r
                Property guiChemicalCraftingTableIDProp = cfg.get("GUI", "GUIChemicalCraftingTableID", 1000);\r
 \r
-               chemicalCraftingTableID = chemicalCraftingTableIDProp.getInt();\r
-               atomsID = atomsIDProp.getInt();\r
-               compoundsID = compoundsIDProp.getInt();\r
-               gasCollectingBottleID = gasCollectingBottleIDProp.getInt();\r
-               guiChemicalCraftingTableID = guiChemicalCraftingTableIDProp.getInt();\r
+               this.chemicalCraftingTableID = chemicalCraftingTableIDProp.getInt();\r
+               this.atomsID = atomsIDProp.getInt();\r
+               this.compoundsID = compoundsIDProp.getInt();\r
+               this.gasCollectingBottleID = gasCollectingBottleIDProp.getInt();\r
+               this.guiChemicalCraftingTableID = guiChemicalCraftingTableIDProp.getInt();\r
 \r
                cfg.save();\r
        }\r
@@ -139,30 +152,30 @@ public class ChemiCraft {
        @Mod.PostInit\r
        public void chemiPostLoadMethod(FMLPostInitializationEvent event){\r
                // API用の処理\r
-               NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray());\r
-               NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray());\r
+               this.NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray());\r
+               this.NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray());\r
 \r
                // Blockを追加します\r
-               blockChemicalCraftingTable = new BlockChemicalCraftingTable(chemicalCraftingTableID, Block.workbench.blockIndexInTexture, Material.ground)\r
+               this.blockChemicalCraftingTable = new BlockChemicalCraftingTable(chemicalCraftingTableID, 0, Material.ground)\r
                .setHardness(2.0F).setResistance(0.0F).setStepSound(Block.soundStoneFootstep).setBlockName("ChemicalCraftingTable");\r
 \r
                // Itemを追加します\r
-               itemAtoms = new ItemAtoms(atomsID).setItemName("atoms");\r
-               itemCompounds = new ItemCompounds(compoundsID).setItemName("compounds");\r
-               itemGasCollectingBottle = new ItemGasCollectingBottle(gasCollectingBottleID).setItemName("gasCollectingBottle");\r
+               this.itemAtoms = new ItemAtoms(atomsID).setItemName("atoms");\r
+               this.itemCompounds = new ItemCompounds(compoundsID).setItemName("compounds");\r
+               this.itemGasCollectingBottle = new ItemGasCollectingBottle(gasCollectingBottleID).setItemName("gasCollectingBottle");\r
 \r
                // BlockをMinecraftに登録します\r
                GameRegistry.registerBlock(blockChemicalCraftingTable);\r
 \r
                // Blockの名前を設定します\r
-               NameAuxiliary.addName(blockChemicalCraftingTable, "ChemicalCraftingTable");\r
-               NameAuxiliary.addName(blockChemicalCraftingTable, "ja_JP", "科学作業台");\r
+               this.NameAuxiliary.addName(blockChemicalCraftingTable, "ChemicalCraftingTable");\r
+               this.NameAuxiliary.addName(blockChemicalCraftingTable, "ja_JP", "科学作業台");\r
 \r
                // Itemの名前を設定します\r
-               NameAuxiliary.addName(itemAtoms, atomsName);\r
-               NameAuxiliary.addName(itemAtoms, "ja_JP", atomsNameJP);\r
-               NameAuxiliary.addName(itemGasCollectingBottle, "GasCollectingBottle");\r
-               NameAuxiliary.addName(itemGasCollectingBottle, "ja_JP", "集気瓶");\r
+               this.NameAuxiliary.addName(itemAtoms, atomsName);\r
+               this.NameAuxiliary.addName(itemAtoms, "ja_JP", atomsNameJP);\r
+               this.NameAuxiliary.addName(itemGasCollectingBottle, "GasCollectingBottle");\r
+               this.NameAuxiliary.addName(itemGasCollectingBottle, "ja_JP", "集気瓶");\r
 \r
                // 化合物の名前を設定し追加します\r
                ChemiCraftAPI.addLangCompound("ja_JP", "Salt", "塩");\r
@@ -173,6 +186,9 @@ public class ChemiCraft {
                // GUIを追加します\r
                NetworkRegistry.instance().registerGuiHandler(instance, proxy);\r
 \r
+               //画像をpreloadします\r
+               this.proxy.registerTextures();\r
+\r
        }\r
 \r
 }
\ No newline at end of file