OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/chemicraft/chemicraft
[chemicraft/chemicraft.git] / common / pcc / chemicraft / ChemiCraft.java
index 5b8ec99..edbf7ae 100644 (file)
@@ -7,6 +7,7 @@ import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
 import net.minecraftforge.common.Configuration;
 import net.minecraftforge.common.Property;
+import net.minecraftforge.oredict.OreDictionary;
 import pcc.chemicraft.block.BlockChemicalCombinationTable;
 import pcc.chemicraft.block.BlockChemicalCraftingTable;
 import pcc.chemicraft.block.BlockElectrolysisTable;
@@ -14,6 +15,8 @@ import pcc.chemicraft.block.BlockPyrolysisTable;
 import pcc.chemicraft.block.BlockToolAndWeaponCraftingTable;
 import pcc.chemicraft.compounds.CompoundDebug;
 import pcc.chemicraft.compounds.CompoundWater;
+import pcc.chemicraft.creativetab.CreativeTabAtomsOre;
+import pcc.chemicraft.creativetab.CreativeTabChemiCraft;
 import pcc.chemicraft.debug.CommandDeleteItem;
 import pcc.chemicraft.debug.CommandGenDebugRoom;
 import pcc.chemicraft.debug.CommandSetTile;
@@ -34,7 +37,6 @@ import pcc.chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
 import pcc.chemicraft.util.Auxiliary;
 import pcc.chemicraft.util.Auxiliary.ArrayAuxiliary;
 import pcc.chemicraft.util.Auxiliary.NameAuxiliary;
-import pcc.chemicraft.util.CreativeTabAtoms;
 import pcc.chemicraft.util.NBTRecipeGrenade;
 import cpw.mods.fml.common.Mod;
 import cpw.mods.fml.common.SidedProxy;
@@ -86,7 +88,8 @@ public class ChemiCraft {
        /**
         * ChemiCraftのCreativeTab.
         */
-       public static final CreativeTabs creativeTab = new CreativeTabAtoms("ChemiCraft");
+       public static final CreativeTabs creativeTabChemiCraft = new CreativeTabChemiCraft("ChemiCraft");
+       public static final CreativeTabs creativeTabAtomsOre = new CreativeTabAtomsOre("AtomsOre");
 
        /**
         * ItemID.
@@ -105,7 +108,8 @@ public class ChemiCraft {
        public int toolAndWeaponCraftingTableID;
        public int chemicalCraftingTableID;
 
-       public int[] atomsOreID = new int[1];
+
+       public int[] atomsOreID = new int[16];
 
        /**
         * GUIID.
@@ -342,20 +346,69 @@ public class ChemiCraft {
                });
 
                //鉱石を追加します
-               this.api.addAtomsOre("Petalite", this.atomsOreID[0], 0, 5, 5, 20); //ペタル石を追加
-               this.api.addAtomsOreLanguage("Petalite", "ペタル石", "ja_JP");
 
-               //化合物を追加します
-               this.api.addLangCompound("ja_JP", "ChlorousAcid", "亜塩素酸");
-               this.api.addLangCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");
-               this.api.addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");
-               this.api.addLangCompound("ja_JP", "Water", "水");
-               this.api.addLangCompound("ja_JP", "SodiumChloride", "塩化ナトリウム");
-               this.api.addLangCompound("ja_JP", "SodiumBicarbonate", "重曹");
-               this.api.addLangCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");
-               this.api.addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");
-               this.api.addLangCompound("ja_JP", "Water", "水");
+               // リチウム
+               api.addAtomsOre("Petalite", this.atomsOreID[api.getAtomsOreIndex()], 5, 10, 50); // LiAlSi4O10
+               api.addAtomsOreLanguage("Petalite", "ペタル石", "ja_JP");
+               api.addAtomsOre("Spodumene", this.atomsOreID[api.getAtomsOreIndex()], 5, 15, 50); // LiAlSi2O6
+               api.addAtomsOreLanguage("Spodumene", "リチア輝石", "ja_JP");
+
+               // ベリリウム
+               api.addAtomsOre("Beryl", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Be3Al2Si6O18
+               api.addAtomsOreLanguage("Beryl", "緑柱石", "ja_JP");
+               api.addAtomsOre("Chrysoberyl", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // BeAl2O4
+               api.addAtomsOreLanguage("Chrysoberyl", "金緑石", "ja_JP");
+
+               // ホウ素
+               api.addAtomsOre("Ulexite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50);   // NaCaB5O6(OH)6・5H2O
+               api.addAtomsOreLanguage("Ulexite", "ウレキサイト", "ja_JP"); // ホウ酸塩鉱石
+
+               // フッ素
+               api.addAtomsOre("Fluorite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // CaF2
+               api.addAtomsOreLanguage("Fluorite", "蛍石", "ja_JP");
+               api.addAtomsOre("Cryolite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Na3AlF6
+               api.addAtomsOreLanguage("Cryolite", "氷晶石", "ja_JP");
+
+               // ナトリウム
+               api.addAtomsOre("RockSalt", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // NaCl
+               api.addAtomsOreLanguage("RockSalt", "岩塩", "ja_JP");
+
+               // マグネシウム
+               api.addAtomsOre("Dolomite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // CaMg(CO3)2
+               api.addAtomsOreLanguage("Dolomite", "苦灰石", "ja_JP");
+               api.addAtomsOre("Magnesite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // MgCO3
+               api.addAtomsOreLanguage("Magnesite", "菱苦土石", "ja_JP");
+
+               // アルミニウム
+               api.addAtomsOre("Gibbsite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Al(OH)3
+               api.addAtomsOreLanguage("Gibbsite", "ギブス石", "ja_JP");
+               api.addAtomsOre("Ruby", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Al2O3
+               api.addAtomsOreLanguage("Ruby", "ルビー", "ja_JP");
+               api.addAtomsOre("Sapphire", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Al2O3
+               api.addAtomsOreLanguage("Sapphire", "サファイア", "ja_JP");
+
+               // ケイ素
+               api.addAtomsOre("Quartz", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // SiO2
+               api.addAtomsOreLanguage("Quartz", "石英", "ja_JP");
+
+               // リン
+               api.addAtomsOre("Fluorapatite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Ca5(PO4)3F
+               api.addAtomsOreLanguage("Fluorapatite", "フッ素リン灰石", "ja_JP");
+               api.addAtomsOre("Chlorapatite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Ca5(PO4)3Cl
+               api.addAtomsOreLanguage("Chlorapatite", "塩素燐灰石", "ja_JP");
+               api.addAtomsOre("Hydroxylapatite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Ca5(PO4)3(OH)
+               api.addAtomsOreLanguage("Hydroxylapatite", "水酸燐灰石", "ja_JP");
 
+               //化合物を追加します
+               this.api.addCompound("ja_JP", "ChlorousAcid", "亜塩素酸");
+               this.api.addCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");
+               this.api.addCompound("ja_JP", "CarbonDioxide", "二酸化炭素");
+               this.api.addCompound("ja_JP", "Water", "水");
+               this.api.addCompound("ja_JP", "SodiumChloride", "塩化ナトリウム");
+               this.api.addCompound("ja_JP", "SodiumBicarbonate", "重曹");
+               this.api.addCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");
+               this.api.addCompound("ja_JP", "CarbonDioxide", "二酸化炭素");
+               this.api.addCompound("ja_JP", "Water", "水");
 
                //化合物のHandlerを設定します
                this.api.settingCompoundHandler("Water", new CompoundWater());
@@ -395,30 +448,27 @@ public class ChemiCraft {
 
        private void apiProcessing(final FMLPostInitializationEvent event) {
                // API用の処理
-               this.nameAuxiliary.addName(itemCompounds, this.api.getCompoundsName().toArray());
-               for (int i = 0; i < this.api.getCompoundsLang().size(); i++) {
-                       this.nameAuxiliary.addName(itemCompounds, this.api.getCompoundsLang().get(i), this.api.getCompoundsLangName().toArray());
+               for (int i = 0; i < api.getCompoundsName().sizeKeysList(); i++)
+               {
+                       for (int j = 0; j < api.getCompoundsName().sizeElementsList(api.getCompoundsName().getKeyList(i)); j++)
+                       {
+                               this.nameAuxiliary.addName(new ItemStack(itemCompounds, 0, i), api.getCompoundsLang().get(api.getCompoundsName().getKeyList(i), j), api.getCompoundsName().get(api.getCompoundsName().getKeyList(i), j));
+                       }
                }
 
-               for (int i = 0; i < blockAtomsOre.length; i++)
+               for (int i = 0; i < api.getAtomsOreNameListHash().sizeKeysList(); i++)
                {
-                       for (int j = 0; j < api.getAtomsOreNameListHash().sizeKeysList(); j++)
+                       for (int j = 0; j < api.getAtomsOreNameListHash().sizeElementsList(api.getAtomsOreNameListHash().getKeyList(i)); j++)
                        {
-                               for (int k = 0; k < api.getAtomsOreNameListHash().sizeElementsList(api.getAtomsOreNameListHash().getKeyList(j)); k++)
-                               {
-                                       this.nameAuxiliary.addName(new ItemStack(blockAtomsOre[i], 0, j), api.getAtomsOreLangListHash().get(api.getAtomsOreNameListHash().getKeyList(j), k), api.getAtomsOreNameListHash().get(api.getAtomsOreNameListHash().getKeyList(j), k));
-                               }
+                               this.nameAuxiliary.addName(new ItemStack(blockAtomsOre[i / 16], 0, i - i / 16 * 16), api.getAtomsOreLangListHash().get(api.getAtomsOreNameListHash().getKeyList(i), j), api.getAtomsOreNameListHash().get(api.getAtomsOreNameListHash().getKeyList(i), j));
+                               OreDictionary.registerOre("ore" + api.getAtomsOreNameListHash().getKeyList(i), new ItemStack(blockAtomsOre[i / 16], 1, i - i / 16 * 16));
                        }
                }
 
-               /* 動作がおかしかったため一時的にコメントアウト */
-               /*
-               //鉱石の生成
-               for (int i = 0; i < this.api.getAtomsOreIDList().size(); i++) {
-                       GameRegistry.registerWorldGenerator(new WorldGenAtomsOre(this.api.getAtomsOreIDList().get(i), this.api.getAtomsOreMetaList().get(i), this.api.getAtomsOreSizeList().get(i), this.api.getAtomsOreFrequencyList().get(i), this.api.getAtomsOrePosYList().get(i)));
+               for (int i = 0; i < api.getAtomsOres().size(); i++)
+               {
                        GameRegistry.registerWorldGenerator(api.getAtomsOres().get(i));
                }
-                */
 
        }