OSDN Git Service

tc
[chemicraft/chemicraft.git] / common / pcc / chemicraft / ChemiCraft.java
index e8ee625..f89a5d3 100644 (file)
@@ -5,7 +5,9 @@ import net.minecraft.block.material.Material;
 import net.minecraft.creativetab.CreativeTabs;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
+import net.minecraft.src.ModLoader;
 import net.minecraftforge.common.Configuration;
+import net.minecraftforge.common.MinecraftForge;
 import net.minecraftforge.common.Property;
 import net.minecraftforge.oredict.OreDictionary;
 import pcc.chemicraft.block.BlockChemicalCombinationTable;
@@ -15,17 +17,23 @@ 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.CreativeTabAtomOres;
 import pcc.chemicraft.creativetab.CreativeTabChemiCraft;
 import pcc.chemicraft.debug.CommandDeleteItem;
 import pcc.chemicraft.debug.CommandGenDebugRoom;
 import pcc.chemicraft.debug.CommandSetTile;
+import pcc.chemicraft.entity.EntityDust;
+import pcc.chemicraft.gen.EnumOreSpawnFrequency;
 import pcc.chemicraft.item.ItemAtoms;
 import pcc.chemicraft.item.ItemAtomsGrenade;
+import pcc.chemicraft.item.ItemChemiCell;
 import pcc.chemicraft.item.ItemCompounds;
+import pcc.chemicraft.item.ItemDust;
 import pcc.chemicraft.item.ItemGasCollectingBottle;
-import pcc.chemicraft.ore.BlockAtomsOre;
-import pcc.chemicraft.ore.ItemAtomsOre;
+import pcc.chemicraft.item.ItemRadiationBallet;
+import pcc.chemicraft.item.ItemRadiationGun;
+import pcc.chemicraft.ore.BlockAtomOres;
+import pcc.chemicraft.ore.ItemAtomOres;
 import pcc.chemicraft.system.CommonProxy;
 import pcc.chemicraft.system.PacketHandler;
 import pcc.chemicraft.tileentity.TileEntityChemicalCombinationTable;
@@ -44,7 +52,9 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
 import cpw.mods.fml.common.event.FMLServerStartingEvent;
 import cpw.mods.fml.common.network.NetworkMod;
 import cpw.mods.fml.common.network.NetworkRegistry;
+import cpw.mods.fml.common.registry.EntityRegistry;
 import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
 /**
  * ChemiCraft本体
  * @author P.C.C.
@@ -52,7 +62,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
  */
 @Mod(modid = "chemiCraft", name = "ChemiCraft", version = "beta")
 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.4.6", channels = "chemicraft", packetHandler = PacketHandler.class)
-public class ChemiCraft {
+public class ChemiCraft implements Runnable {
 
        public static final String[] ATOMSNAME = {
                "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon",
@@ -88,7 +98,7 @@ public class ChemiCraft {
         * ChemiCraftのCreativeTab.
         */
        public static final CreativeTabs creativeTabChemiCraft = new CreativeTabChemiCraft("ChemiCraft");
-       public static final CreativeTabs creativeTabAtomsOre = new CreativeTabAtomsOre("AtomsOre");
+       public static final CreativeTabs creativeTabAtomsOre = new CreativeTabAtomOres("AtomsOre");
 
        /**
         * ItemID.
@@ -97,6 +107,10 @@ public class ChemiCraft {
        public int compoundsID;
        public int gasCollectingBottleID;
        public int atomGrenadeID;
+       public int chemicalCellsID;
+       public int dustID;
+       public int radiationGunID;
+       public int radiationBalletID;
 
        /**
         * BlockID.
@@ -107,7 +121,7 @@ public class ChemiCraft {
        public int toolAndWeaponCraftingTableID;
        public int chemicalCraftingTableID;
 
-       public int[] atomsOreID = new int[16];
+       public int[] atomOresID = new int[3];
 
        /**
         * GUIID.
@@ -127,7 +141,7 @@ public class ChemiCraft {
        public Block blockToolAndWeaponCraftingTable;
        public Block blockChemicalCraftingTable;
 
-       public Block[] blockAtomsOre = new Block[atomsOreID.length];
+       public Block[] blockAtomOres = new Block[atomOresID.length];
 
        /**
         * Item型変数.
@@ -136,20 +150,27 @@ public class ChemiCraft {
        public Item itemCompounds;
        public Item itemGasCollectingBottle;
        public Item itemAtomGrenade;
+       public Item itemChemicalCells;
+       public Item itemDust;
+       public Item itemRadiationGun;
+       public Item itemRadiationBallet;
 
        /**
         * このmodで使用するTextureのパス.
         */
        public final String ITEM_ATOMS_TEXTURE = "/pcc/chemicraft/items/Atoms.png";
        public final String ITEM_COMPOUNDS_TEXTURE = "/pcc/chemicraft/items/Compounds.png";
+       public final String ITEM_VEGETABLES_TEXTURE = "/pcc/chemicraft/items/Vegetables.png";
        public final String ITEM_TEXTURE = "/pcc/chemicraft/items/items.png";
        public final String BLOCK_CHEMICAL_CRAFTING_TABLE_TEXTURE = "/pcc/chemicraft/blocks/cctable.png";
        public final String BLOCK_ATOMS_ORE_TEXTURE = "/pcc/chemicraft/blocks/AtomsOre.png";
+       public final String BLOCK_VEGETABLES_TEXTURE = "/pcc/chemicraft/blocks/Vegetables.png";
        public final String GUI_PYROLYSIS_TEXTURE = "/pcc/chemicraft/guis/Pyrolysis.png";
        public final String GUI_ELECTROLYSIS_TEXTURE = "/pcc/chemicraft/guis/Electrolysis.png";
        public final String GUI_CHEMICALCOMBINATION_TEXTURE = "/pcc/chemicraft/guis/ChemicalCombination.png";
        public final String GUI_TOOLANDWEAPONCRAFTING_TEXTURE = "/pcc/chemicraft/guis/ToolAndWeaponCrafting.png";
        public final String GUI_CHEMICALCRAFTING_TEXTURE = "/pcc/chemicraft/guis/MaterialCrafting.png";
+       public final String ENTITY_PARTICLE_TEXRURE = "/pcc/chemicraft/entityParticles/dust.png";
 
        /**
         * このmodに必要な補助クラスのインスタンス.
@@ -161,6 +182,16 @@ public class ChemiCraft {
        private ChemiCraftAPI api = ChemiCraftAPI.instance();
        private ChemiCraftData chemicalData = new ChemiCraftData();
 
+       /**
+        * このMODのスレッド
+        */
+       private Thread thread;
+
+       /**
+        * Eventのインスタンス(PostInit以降)
+        */
+       private FMLPostInitializationEvent event;
+
        @Mod.PreInit
        public void chemiPreLoadMethod(final FMLPreInitializationEvent event) {
                Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
@@ -172,15 +203,19 @@ public class ChemiCraft {
                Property toolAndWeaponCraftingTableIDProp = cfg.getBlock("ToolAndWeaponCraftingTableID", 2403);
                Property chemicalCraftingTableIDProp = cfg.getBlock("ChemicalCraftingTableID", 2404);
 
-               Property[] atomsOreIDProp = new Property[this.atomsOreID.length];
-               for (int i = 0; i < atomsOreIDProp.length; i++) {
-                       atomsOreIDProp[i] = cfg.getBlock("AtomsOreID:" + i, 2500 + i);
+               Property[] atomOresIDProp = new Property[this.atomOresID.length];
+               for (int i = 0; i < atomOresIDProp.length; i++) {
+                       atomOresIDProp[i] = cfg.getBlock("AtomsOreID:" + i, 2500 + i);
                }
 
                Property atomsIDProp = cfg.getItem("AtomsID", 25000);
                Property compoundsIDProp = cfg.getItem("CompoundsID", 25001);
                Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002);
                Property atomGrenadeIDProp = cfg.getItem("AtomGrenadeID", 25003);
+               Property chemicalCellsIDProp = cfg.getItem("ChemicalCellID", 25004);
+               Property dustIDProp = cfg.getItem("DustID", 25005);
+               Property radiationGunIDProp = cfg.getItem("RadiationGunID", 25006);
+               Property radiationBalletIDProp = cfg.getItem("RadiationBalletID", 25007);
 
                Property guiPyrolysisTableIDProp = cfg.get("GUI", "GUIPyrolysisID", 1000);
                Property guiElectrolysisTableIDProp = cfg.get("GUI", "GUIElectrolysisTableIDProp", 1001);
@@ -194,13 +229,19 @@ public class ChemiCraft {
                this.chemicalConbinationTableID = chemicalCombinationTableIDProp.getInt();
                this.toolAndWeaponCraftingTableID = toolAndWeaponCraftingTableIDProp.getInt();
                this.chemicalCraftingTableID = chemicalCraftingTableIDProp.getInt();
-               for (int i = 0; i < atomsOreID.length; i++) {
-                       this.atomsOreID[i] = atomsOreIDProp[i].getInt();
+               for (int i = 0; i < atomOresID.length; i++) {
+                       this.atomOresID[i] = atomOresIDProp[i].getInt();
                }
+
                this.atomsID = atomsIDProp.getInt();
                this.compoundsID = compoundsIDProp.getInt();
                this.gasCollectingBottleID = gasCollectingBottleIDProp.getInt();
                this.atomGrenadeID = atomGrenadeIDProp.getInt();
+               this.chemicalCellsID = chemicalCellsIDProp.getInt();
+               this.dustID = dustIDProp.getInt();
+               this.radiationGunID = radiationGunIDProp.getInt();
+               this.radiationBalletID = radiationBalletIDProp.getInt();
+
                this.guiPyrolysisTableID = guiPyrolysisTableIDProp.getInt();
                this.guiElectrolysisTableID = guiElectrolysisTableIDProp.getInt();
                this.guiChemicalCombinationTableID = guiChemicalCombinationTableIDProp.getInt();
@@ -219,9 +260,28 @@ public class ChemiCraft {
 
        @Mod.PostInit
        public void chemiPostLoadMethod(final FMLPostInitializationEvent event) {
-               this.settingProcessing(event);
-               this.apiProcessing(event);
-               this.debug(event);
+               this.thread = new Thread(this);
+               this.event = event;
+               this.thread.start();
+               try {
+                       this.thread.join();
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               }
+               proxy.registerRenderInformation();
+               Thread.yield();
+       }
+
+       @Override
+       public void run() {
+               while (true) {
+                       if (proxy != null && instance != null) {
+                               this.settingProcessing(event);
+                               this.apiProcessing(event);
+                               this.debug(event);
+                               break;
+                       }
+               }
        }
 
        private void settingProcessing(final FMLPostInitializationEvent event) {
@@ -232,35 +292,36 @@ public class ChemiCraft {
                                setResistance(0.0F).
                                setStepSound(Block.soundStoneFootstep).
                                setBlockName("PyrolysisTable");
-               this.blockElectrolysisTable = new BlockElectrolysisTable(this.electrolysisTableID, 0, Material.ground).
+               this.blockElectrolysisTable = new BlockElectrolysisTable(this.electrolysisTableID, 1, Material.ground).
                                setHardness(2.0F).
                                setResistance(0.0F).
                                setStepSound(Block.soundStoneFootstep).
                                setBlockName("ElectrolysisTable");
-               this.blockChemicalCombinationTable = new BlockChemicalCombinationTable(this.chemicalConbinationTableID, 0, Material.ground).
+               this.blockChemicalCombinationTable = new BlockChemicalCombinationTable(this.chemicalConbinationTableID, 2, Material.ground).
                                setHardness(2.0F).
                                setResistance(0.0F).
                                setStepSound(Block.soundStoneFootstep).
                                setBlockName("ChemicalCombinationTable");
-               this.blockToolAndWeaponCraftingTable = new BlockToolAndWeaponCraftingTable(this.toolAndWeaponCraftingTableID, 0, Material.ground).
+               this.blockToolAndWeaponCraftingTable = new BlockToolAndWeaponCraftingTable(this.toolAndWeaponCraftingTableID, 3, Material.ground).
                                setHardness(2.0F).
                                setResistance(0.0F).
                                setStepSound(Block.soundStoneFootstep).
                                setBlockName("ToolAndWeaponCraftingTable");
-               this.blockChemicalCraftingTable = new BlockChemicalCraftingTable(this.chemicalCraftingTableID, 0, Material.ground).
+               this.blockChemicalCraftingTable = new BlockChemicalCraftingTable(this.chemicalCraftingTableID, 4, Material.ground).
                                setHardness(2.0F).
                                setResistance(0.0F).
                                setStepSound(Block.soundStoneFootstep).
                                setBlockName("ChemicalCraftingTable");
 
-               for (int i = 0; i < blockAtomsOre.length; i++)
+               for (int i = 0; i < blockAtomOres.length; i++)
                {
-                       this.blockAtomsOre[i] = new BlockAtomsOre(this.atomsOreID[i]).
+                       this.blockAtomOres[i] = new BlockAtomOres(this.atomOresID[i]).
                                        setHardness(3.0F).
                                        setResistance(0.0F).
                                        setStepSound(Block.soundStoneFootstep).
                                        setBlockName("AtomsOre" + i);
-                       GameRegistry.registerBlock(blockAtomsOre[i], ItemAtomsOre.class, "AtomsOre" + i);
+                       GameRegistry.registerBlock(blockAtomOres[i], ItemAtomOres.class, "AtomsOre" + i);
+                       MinecraftForge.setBlockHarvestLevel(this.blockAtomOres[i], "pickaxe", 2);
                }
 
                // Itemを追加します
@@ -268,6 +329,11 @@ public class ChemiCraft {
                this.itemCompounds = new ItemCompounds(this.compoundsID).setItemName("compounds");
                this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);
                this.itemAtomGrenade = new ItemAtomsGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);
+               this.itemChemicalCells = new ItemChemiCell(this.chemicalCellsID).setItemName("chemiCell").setIconIndex(3);
+               this.itemDust = new ItemDust(15000).setItemName("dust").setIconIndex(12);
+               this.itemRadiationGun = new ItemRadiationGun(this.radiationGunID).setIconIndex(4).setItemName("RadiationGun");
+               this.itemRadiationBallet = new ItemRadiationBallet(this.radiationBalletID).setIconIndex(5).setItemName("RadiationBallet");
+
 
                // BlockをMinecraftに登録します
                GameRegistry.registerBlock(this.blockPyrolysisTable, "BlockPyrolysisTable");
@@ -294,7 +360,13 @@ public class ChemiCraft {
                this.nameAuxiliary.addName(this.itemGasCollectingBottle, "GasCollectingBottle");
                this.nameAuxiliary.addName(this.itemGasCollectingBottle, "ja_JP", "集気瓶");
                this.nameAuxiliary.addName(this.itemAtomGrenade, "AtomGrenade");
-               this.nameAuxiliary.addName(this.itemAtomGrenade, "元素手榴弾");
+               this.nameAuxiliary.addName(this.itemAtomGrenade, "ja_JP", "元素手榴弾");
+               this.nameAuxiliary.addName(this.itemDust, "dust");
+               this.nameAuxiliary.addName(this.itemDust, "ja_JP", "粉塵");
+               this.nameAuxiliary.addName(this.itemRadiationGun, "RadiationGun");
+               this.nameAuxiliary.addName(this.itemRadiationGun, "ja_JP", "放射線銃");
+               this.nameAuxiliary.addName(this.itemRadiationBallet, "RadiationBallet");
+               this.nameAuxiliary.addName(this.itemRadiationGun, "ja_JP", "放射線弾");
 
                // TileEntityを追加します
                GameRegistry.registerTileEntity(TileEntityPyrolysisTable.class, "TileEntityPyrolysisTable");
@@ -306,9 +378,6 @@ public class ChemiCraft {
                // GUIを追加します
                NetworkRegistry.instance().registerGuiHandler(instance, proxy);
 
-               // 描画関係の読み込み
-               proxy.registerRenderInformation();
-
                //化学作業台類のレシピを追加します
                GameRegistry.addRecipe(new ItemStack(this.blockPyrolysisTable),
                                new Object[]{
@@ -343,82 +412,250 @@ public class ChemiCraft {
                        Character.valueOf('A'), new ItemStack(this.itemAtoms, 1, 0),
                });
 
-               //鉱石を追加します
+               //電池を追加します
+               api.addChemicalCell(itemChemicalCells, "ChemicalCell", 1000);
+               api.addChemicalCellLanguage("ChemicalCell", "ja_JP", "化学電池");
+
+               // 元素入手手段
+
+               // 水素
+               // 水を分解。
+
+               // ヘリウム
+               // 未定。
 
                // リチウム
-               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.addAtomOres(
+                               "LithiumOre",
+                               new String[] { "Li", "Al", "Si", "O" },
+                               new Integer[] { 1, 1, 4, 10 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // LiAlSi4O10
+               api.addAtomOresLanguage("LithiumOre", "リチウム鉱石", "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.addAtomOres(
+                               "BerylliumOre",
+                               new String[] { "Be", "Al", "Si", "O" },
+                               new Integer[] { 3, 2, 6, 18 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // Be3Al2Si6O18
+               api.addAtomOresLanguage("BerylliumOre", "ベリリウム鉱石", "ja_JP");
 
                // ホウ素
-               api.addAtomsOre("Ulexite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50);   // NaCaB5O6(OH)6・5H2O
-               api.addAtomsOreLanguage("Ulexite", "ウレキサイト", "ja_JP"); // ホウ酸塩鉱石
+               api.addAtomOres(
+                               "BoronOre",
+                               new String[] { "Na", "Ca", "B", "O", "H" },
+                               new Integer[] { 1, 1, 5, 17, 16 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // NaCaB5O6(OH)6・5H2O
+               api.addAtomOresLanguage("BoronOre", "ホウ素鉱石", "ja_JP");
+
+               // 炭素
+               api.addPyrolysisDecompositionRecipe(
+                               new ItemStack(Block.oreCoal),
+                               new Integer[] { chemicalData.CARBON },
+                               new Integer[] { 1 });
 
                // フッ素
-               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.addAtomOres(
+                               "FluorineOre",
+                               new String[] { "Ca", "F" },
+                               new Integer[] { 1, 2 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // CaF2
+               api.addAtomOresLanguage("FluorineOre", "フッ素鉱石", "ja_JP");
 
                // ナトリウム
-               api.addAtomsOre("RockSalt", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // NaCl
-               api.addAtomsOreLanguage("RockSalt", "岩塩", "ja_JP");
+               api.addAtomOres(
+                               "SodiumOre",
+                               new String[] { "Na", "Cl" },
+                               new Integer[] { 1, 1 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // NaCl
+               api.addAtomOresLanguage("SodiumOre", "ナトリウム鉱石", "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.addAtomOres(
+                               "MagnesiumOre",
+                               new String[] { "Ca", "Mg", "C", "O" },
+                               new Integer[] { 1, 1, 2, 6 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // CaMg(CO3)2
+               api.addAtomOresLanguage("MagnesiumOre", "マグネシウム鉱石", "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.addAtomOres(
+                               "AluminiumOre",
+                               new String[] { "Al", "O", "H" },
+                               new Integer[] { 3, 3, 3 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // Al(OH)3
+               api.addAtomOresLanguage("AluminiumOre", "アルミニウム鉱石", "ja_JP");
 
                // ケイ素
-               api.addAtomsOre("Quartz", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // SiO2
-               api.addAtomsOreLanguage("Quartz", "石英", "ja_JP");
+               // 1.5まで保留。
 
                // リン
-               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");
+               api.addAtomOres(
+                               "PhosphorusOre",
+                               new String[] { "Ca", "P", "O", "F" },
+                               new Integer[] { 5, 3, 12, 1 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // Ca5(PO4)3F
+               api.addAtomOresLanguage("PhosphorusOre", "リン鉱石", "ja_JP");
+
+               // 硫黄
+               api.addAtomOres(
+                               "SulfurOre",
+                               new String[] { "S" },
+                               new Integer[] { 1 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // S
+               api.addAtomOresLanguage("SulfurOre", "硫黄鉱石", "ja_JP");
+
+               // カリウム
+               api.addAtomOres(
+                               "PotassiumOre",
+                               new String[] { "K", "Cl" },
+                               new Integer[] { 1, 1 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // KCl
+               api.addAtomOresLanguage("PotassiumOre", "カリウム鉱石", "ja_JP");
+
+               // カルシウム
+               api.addAtomOres(
+                               "CalciumOre",
+                               new String[] { "Ca", "C", "O" },
+                               new Integer[] { 1, 1, 3 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // CaCO3
+               api.addAtomOresLanguage("CalciumOre", "カルシウム鉱石", "ja_JP");
+
+               // スカンジウム
+               api.addAtomOres(
+                               "ScandiumOre",
+                               new String[] { "Sc", "Y", "Si", "O" },
+                               new Integer[] { 2, 2, 2, 7 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // (Sc,Y)2Si2O7
+               api.addAtomOresLanguage("ScandiumOre", "スカンジウム鉱石", "ja_JP");
+
+               // チタン
+               api.addAtomOres(
+                               "TitaniumOre",
+                               new String[] { "Ti", "O" },
+                               new Integer[] { 1, 2 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // TiO2
+               api.addAtomOresLanguage("TitaniumOre", "チタン鉱石", "ja_JP");
+
+               // バナジウム
+               api.addAtomOres(
+                               "VanadiumOre",
+                               new String[] { "K", "U", "O", "V", "H" },
+                               new Integer[] { 2, 2, 15, 2, 6 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               // K2(UO2)2V2O8・3H2O
+               api.addAtomOresLanguage("VanadiumOre", "バナジウム鉱石", "ja_JP");
+
+               // クロム
+               api.addAtomOres(
+                               "Chromium",
+                               new String[] { "Fe", "Cr", "O" },
+                               new Integer[] { 1, 2, 4 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               api.addAtomOresLanguage("Chromium", "クロム鉱石", "ja_JP");
+               // FeCr2O4
+
+               // マンガン
+               api.addAtomOres(
+                               "ManganeseOre",
+                               new String[] { "Mn", "O" },
+                               new Integer[] { 1, 2 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               api.addAtomOresLanguage("ManganeseOre", "ja_JP", "マンガン鉱石");
+               // MnO2
+
+               // コバルト
+               api.addAtomOres(
+                               "CobaltOre",
+                               new String[] { "Co", "As", "S" },
+                               new Integer[] { 1, 1, 1 },
+                               this.atomOresID[api.getAtomOresLastIndex()],
+                               8,
+                               EnumOreSpawnFrequency.NORMAL);
+               api.addAtomOresLanguage("CobaltOre", "ja_JP", "コバルト鉱石");
+               // CoAsS
+
+               // api.addAtomOres("元素名(英)", new String[]{"元素"}, new Integer[]{<数>}, this.atomOresID[api.getAtomOresLastIndex()], 8, EnumOreSpawnFrequency.NORMAL); // 化学式
+               // api.addAtomOresLanguage("元素名(英)", "元素名(他国語)", "言語");
 
                //化合物を追加します
-               api.addCompound("ja_JP", "ChlorousAcid", "亜塩素酸");
-
-               api.addCompound("ja_JP", "SodiumChloride", "塩化ナトリウム");
-               api.addCompound("ja_JP", "SodiumBicarbonate", "重曹");
-
-               api.addCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");
-               api.addCompound("ja_JP", "CarbonDioxide", "二酸化炭素");
-               api.addCompound("ja_JP", "Water", "水");
-
+               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", "重曹");
 
                //化合物のHandlerを設定します
-               api.settingCompoundHandler("Water", new CompoundWater());
+               this.api.settingCompoundHandler("Water", new CompoundWater());
 
                //化合物のレシピを追加します
-               api.addChemicalCombinationRecipe(new String[]{"Na", "O", "H"}, new Integer[]{1, 1, 1}, new ItemStack(this.itemCompounds, 1, api.getCompound("SodiumChloride")));
-               api.addChemicalCombinationRecipe(new String[]{"H", "O", "Cl"}, new Integer[]{1, 2, 1}, new ItemStack(this.itemCompounds, 1, api.getCompound("ChlorousAcid")));
+               this.api.addChemicalCombinationRecipe(new String[]{"Na", "O", "H"}, new Integer[]{1, 1, 1}, new ItemStack(this.itemCompounds, 1, this.api.getCompound("SodiumChloride")));
+               this.api.addChemicalCombinationRecipe(new String[]{"H", "O", "Cl"}, new Integer[]{1, 2, 1}, new ItemStack(this.itemCompounds, 1, this.api.getCompound("ChlorousAcid")));
+               this.api.addChemicalCombinationRecipe(new String[]{"H", "O"}, new Integer[]{2, 1}, new ItemStack(this.itemCompounds, 1, this.api.getCompound("Water")));
 
-               api.addChemicalCombinationRecipe(new String[]{"H", "O"}, new Integer[]{2, 1}, new ItemStack(this.itemCompounds, 1, api.getCompound("Water")));
+               //化学電池の追加
+               this.api.addMaterialRecipe(new ItemStack[] {
+                               null,
+                               null,
+                               null,
+                               new ItemStack(this.itemAtoms, 1, chemicalData.ZINC),
+                               null,
+                               new ItemStack(this.itemAtoms, 1, chemicalData.COPPER),
+                               new ItemStack(Item.bucketWater),
+                               new ItemStack(Item.bucketWater),
+                               new ItemStack(Item.bucketWater),
+               },
+               new ItemStack(this.itemChemicalCells, 1, 0),
+               null);
 
                //手榴弾の追加
-               api.addMaterialRecipe(new ItemStack[] {
+               this.api.addMaterialRecipe(new ItemStack[] {
                                null,
                                new ItemStack(Block.stone),
                                null,
@@ -433,56 +670,77 @@ public class ChemiCraft {
                new NBTRecipeGrenade()
                                );
 
-               api.addDecompositionRecipe(new ItemStack(Item.potion, 1, 0),
-                               new int[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},
-                               new int[] {2, 1});
+               this.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.potion, 1, 0),
+                               new Integer[] {ChemiCraftData.HYDROGEN, chemicalData.OXYGEN},
+                               new Integer[] {2, 1});
+
+               this.api.addPyrolysisDecompositionRecipe(new ItemStack(this.itemCompounds, 1, this.api.getCompound("Water")),
+                               new Integer[] {ChemiCraftData.HYDROGEN, chemicalData.OXYGEN},
+                               new Integer[] {2, 1});
 
-               api.addDecompositionRecipe(new ItemStack(this.itemCompounds, 1, api.getCompound("Water")),
-                               new int[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},
-                               new int[] {2, 1});
+               for (int i = 0; i < api.getAtomOresName().sizeKeysList(); i++){
+                       this.api.addPyrolysisDecompositionRecipe(new ItemStack(this.blockAtomOres[i / 16], 1, i - i / 16 * 16),
+                                       api.getAtomOresAtoms().get(api.getAtomOresName().getKeyList(i)),
+                                       api.getAtomOresAmounts().get(api.getAtomOresName().getKeyList(i)));
+               }
 
-               api.addDecompositionFuel(new ItemStack(Item.coal), 2000*8);
+               //Entityを追加
+               LanguageRegistry.instance().addStringLocalization("entity.Dust.name", "en_US", "Dust");
+               EntityRegistry.registerModEntity(EntityDust.class,
+                               "Dust",
+                               ModLoader.getUniqueEntityId(),
+                               this,
+                               250,
+                               5,
+                               true);
+
+               this.api.addPyrolysisDecompositionFuel(new ItemStack(Item.coal), 2000*8);
        }
 
        private void apiProcessing(final FMLPostInitializationEvent event) {
                // API用の処理
-               for (int i = 0; i < api.getCompoundsName().sizeKeysList(); i++)
+               for (int i = 0; i < api.getAtomOresName().sizeKeysList(); i++)
                {
-                       for (int j = 0; j < api.getCompoundsName().sizeElementsList(api.getCompoundsName().getKeyList(i)); j++)
+                       for (int j = 0; j < api.getAtomOresName().sizeElementsList(api.getAtomOresName().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));
+                               this.nameAuxiliary.addName(new ItemStack(blockAtomOres[i / 16], 0, i - i / 16 * 16), api.getAtomOresLanguage().get(api.getAtomOresName().getKeyList(i), j), api.getAtomOresName().get(api.getAtomOresName().getKeyList(i), j));
+                               OreDictionary.registerOre("ore" + api.getAtomOresName().getKeyList(i), new ItemStack(blockAtomOres[i / 16], 1, i - i / 16 * 16));
                        }
                }
 
-               for (int i = 0; i < api.getAtomsOreNameListHash().sizeKeysList(); i++)
+               for (int i = 0; i < api.getAtomOres().size(); i++)
                {
-                       for (int j = 0; j < api.getAtomsOreNameListHash().sizeElementsList(api.getAtomsOreNameListHash().getKeyList(i)); j++)
+                       GameRegistry.registerWorldGenerator(api.getAtomOres().get(i));
+               }
+
+               for (int i = 0; i < api.getChemicalCellsName().sizeKeysList(); i++)
+               {
+                       for (int j = 0; j < api.getChemicalCellsName().sizeElementsList(api.getChemicalCellsName().getKeyList(i)); j++)
                        {
-                               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));
+                               this.nameAuxiliary.addName(new ItemStack(itemChemicalCells, 0, i), api.getChemicalCellsLanguage().get(api.getChemicalCellsName().getKeyList(i), j), api.getChemicalCellsName().get(api.getChemicalCellsName().getKeyList(i), j));
                        }
                }
 
-               for (int i = 0; i < api.getAtomsOres().size(); i++)
+               for (int i = 0; i < api.getCompoundsName().sizeKeysList(); i++)
                {
-                       GameRegistry.registerWorldGenerator(api.getAtomsOres().get(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));
+                       }
                }
 
        }
 
        private void debug(final FMLPostInitializationEvent event) {
-               //DebugTickingの追加
                this.proxy.registerTickHandler();
                this.api.addCompound("Debug");
                this.api.settingCompoundHandler("Debug", new CompoundDebug());
 
-               /*
-                * TWDebug
-                */
-               api.addToolAndWeaponRecipe(new ItemStack[] {
+               this.api.addToolAndWeaponRecipe(new ItemStack[] {
                                new ItemStack(Block.stone, 1, 1)
                },
                new ItemStack(Block.dirt, 1, 0));
+
        }
 
 }