OSDN Git Service

edbf7aeeeeace071c1421cbb4d2235d1caeae6f7
[chemicraft/chemicraft.git] / common / pcc / chemicraft / ChemiCraft.java
1 package pcc.chemicraft;
2
3 import net.minecraft.block.Block;
4 import net.minecraft.block.material.Material;
5 import net.minecraft.creativetab.CreativeTabs;
6 import net.minecraft.item.Item;
7 import net.minecraft.item.ItemStack;
8 import net.minecraftforge.common.Configuration;
9 import net.minecraftforge.common.Property;
10 import net.minecraftforge.oredict.OreDictionary;
11 import pcc.chemicraft.block.BlockChemicalCombinationTable;
12 import pcc.chemicraft.block.BlockChemicalCraftingTable;
13 import pcc.chemicraft.block.BlockElectrolysisTable;
14 import pcc.chemicraft.block.BlockPyrolysisTable;
15 import pcc.chemicraft.block.BlockToolAndWeaponCraftingTable;
16 import pcc.chemicraft.compounds.CompoundDebug;
17 import pcc.chemicraft.compounds.CompoundWater;
18 import pcc.chemicraft.creativetab.CreativeTabAtomsOre;
19 import pcc.chemicraft.creativetab.CreativeTabChemiCraft;
20 import pcc.chemicraft.debug.CommandDeleteItem;
21 import pcc.chemicraft.debug.CommandGenDebugRoom;
22 import pcc.chemicraft.debug.CommandSetTile;
23 import pcc.chemicraft.gen.WorldGenAtomsOre;
24 import pcc.chemicraft.item.ItemAtoms;
25 import pcc.chemicraft.item.ItemAtomsGrenade;
26 import pcc.chemicraft.item.ItemCompounds;
27 import pcc.chemicraft.item.ItemGasCollectingBottle;
28 import pcc.chemicraft.ore.BlockAtomsOre;
29 import pcc.chemicraft.ore.ItemAtomsOre;
30 import pcc.chemicraft.system.CommonProxy;
31 import pcc.chemicraft.system.PacketHandler;
32 import pcc.chemicraft.tileentity.TileEntityChemicalCombinationTable;
33 import pcc.chemicraft.tileentity.TileEntityChemicalCraftingTable;
34 import pcc.chemicraft.tileentity.TileEntityElectrolysisTable;
35 import pcc.chemicraft.tileentity.TileEntityPyrolysisTable;
36 import pcc.chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
37 import pcc.chemicraft.util.Auxiliary;
38 import pcc.chemicraft.util.Auxiliary.ArrayAuxiliary;
39 import pcc.chemicraft.util.Auxiliary.NameAuxiliary;
40 import pcc.chemicraft.util.NBTRecipeGrenade;
41 import cpw.mods.fml.common.Mod;
42 import cpw.mods.fml.common.SidedProxy;
43 import cpw.mods.fml.common.event.FMLPostInitializationEvent;
44 import cpw.mods.fml.common.event.FMLPreInitializationEvent;
45 import cpw.mods.fml.common.event.FMLServerStartingEvent;
46 import cpw.mods.fml.common.network.NetworkMod;
47 import cpw.mods.fml.common.network.NetworkRegistry;
48 import cpw.mods.fml.common.registry.GameRegistry;
49 /**
50  * ChemiCraft本体
51  * @author P.C.C.
52  *
53  */
54 @Mod(modid = "chemiCraft", name = "ChemiCraft", version = "beta")
55 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.4.6", channels = "chemicraft", packetHandler = PacketHandler.class)
56 public class ChemiCraft {
57
58         public static final String[] ATOMSNAME = {
59                 "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon",
60                 "Phosphorus", "Sulfur", "Chlorine", "Argon", "Potassium", "Calcium", "Scandium", "Titanium", "Vanadium", "Chromium", "Manganese", "Iron", "Cobalt", "Nickel", "Copper", "Zinc", "Gallium",
61                 "Germanium", "Arsenic", "Selenium", "Bromine", "Krypton", "Rubidium", "Strontium", "Yttorium", "Zirconium", "Niobium", "Molybdenum", "Technetium", "Ruthenium", "Rhodium", "Palladium",
62                 "Silver", "Cadmium", "Indium", "Tin", "Antimony", "Tellurium", "Iodine", "Xenon", "Caesium", "Barium", "Lanthanum", "Cerium", "Praseodymium", "Neodymium", "Promethium", "Samarium",
63                 "Europium", "Gadolinium", "Terbium", "Dysprosium", "Holmium", "Erbium", "Thulium", "Ytterbium", "Lutetium", "Hafnium", "Tantalum", "Tungsten", "Rhenium", "Osmium", "Iridium", "Platinum",
64                 "Gold", "Mercury", "Thallium", "Lead", "Bismuth", "Polonium", "Astatine", "Radon", "Francium", "Radium", "Actinium", "Thorium", "Protactinium", "Uranium", "Neptunium", "Plutonium",
65                 "Americium", "Curium", "Berkelium", "Californium", "Einsteinium", "Fermium", "Mendelevium", "Nobelium", "Lawrencium", "Rutherfordium", "Dubnium", "Seaborgium", "Bohrium", "Hassium",
66                 "Meitnerium", "Darmstadtium", "Roentgenium", "Copernicium", "Ununtrium", "Ununquadium", "Ununpentium", "Ununhexium", "Ununseptium", "Ununoctium" };
67
68         public static final String[] ATOMSNAMEJP = {
69                 "水素", "ヘリウム", "リチウム", "ベリウム", "ホウ素", "炭素", "窒素", "酸素", "フッ素", "ネオン", "ナトリウム", "マグネシウム", "アルミニウム", "ケイ素", "リン", "硫黄", "塩素", "アルゴン", "カリウム", "カルシウム", "スカンジウム",
70                 "チタン", "バナジウム", "クロム", "マンガン", "鉄", "コバルト", "ニッケル", "銅", "亜鉛", "ガリウム", "ゲルマニウム", "ヒ素", "セレン", "臭素", "クリプトン", "ルビジウム", "ストロンチウム", "イットリウム", "ジルコニウム", "ニオブ", "モリブデン", "テクネチウム", "ルテニウム",
71                 "ロジウム", "パラジウム", "銀", "カドミウム", "インジウム", "スズ", "アンチモン", "テルル", "ヨウ素", "キセノン", "セシウム", "バリウム", "ランタン", "セリウム", "プラセオジム", "ネオジム", "プロメチウム", "サマリウム", "ユウロビウム", "ガドリニウム", "テルビウム", "ジスプロニウム",
72                 "ホルミウム", "エルビウム", "ツリウム", "イッテルビウム", "ルテチウム", "ハフニウム", "タンタル", "タングステン", "レニウム", "オスミウム", "イリジウム", "白金", "金", "水銀", "タリウム", "鉛", "ビスマス", "ポロニウム", "アスタチン", "ラドン", "フランシウム", "ラジウム",
73                 "アクチニウム", "トリウム", "プロトアクチウム", "ウラン", "ネプツニウム", "プルトニウム", "アメリシウム", "キュリウム", "バークリウム", "カルホルニウム", "アインスタイニウム", "フェルミウム", "メンデレビウム", "ノーベリウム", "ローレンシウム", "ラサホージウム", "ドブニウム", "シーボーギウム",
74                 "ボーリウム", "ハッシウム", "マイトネリウム", "ダームスタチウム", "レントゲニウム", "コペルニシウム", "ウンウントリウム", "ウンウンクアジウム", "ウンウンペンチウム", "ウンウンヘキシウム", "ウンウンセプチウム", "ウンウンオクチウム" };
75
76         /**
77          * このmodのインスタンス
78          */
79         @Mod.Instance("chemiCraft")
80         public static ChemiCraft instance;
81
82         /**
83          * ChemiCraftのProxy.
84          */
85         @SidedProxy(clientSide = "pcc.chemicraft.client.ClientProxy", serverSide = "pcc.chemicraft.system.CommonProxy")
86         public static CommonProxy proxy;
87
88         /**
89          * ChemiCraftのCreativeTab.
90          */
91         public static final CreativeTabs creativeTabChemiCraft = new CreativeTabChemiCraft("ChemiCraft");
92         public static final CreativeTabs creativeTabAtomsOre = new CreativeTabAtomsOre("AtomsOre");
93
94         /**
95          * ItemID.
96          */
97         public int atomsID;
98         public int compoundsID;
99         public int gasCollectingBottleID;
100         public int atomGrenadeID;
101
102         /**
103          * BlockID.
104          */
105         public int pyrolysisTableID;
106         public int electrolysisTableID;
107         public int chemicalConbinationTableID;
108         public int toolAndWeaponCraftingTableID;
109         public int chemicalCraftingTableID;
110
111
112         public int[] atomsOreID = new int[16];
113
114         /**
115          * GUIID.
116          */
117         public int guiPyrolysisTableID;
118         public int guiElectrolysisTableID;
119         public int guiChemicalCombinationTableID;
120         public int guiToolAndWeaponCraftingTableID;
121         public int guiChemicalCraftingTableID;
122
123         /**
124          * Block型変数.
125          */
126         public Block blockPyrolysisTable;
127         public Block blockElectrolysisTable;
128         public Block blockChemicalCombinationTable;
129         public Block blockToolAndWeaponCraftingTable;
130         public Block blockChemicalCraftingTable;
131
132         public Block[] blockAtomsOre = new Block[atomsOreID.length];
133
134         /**
135          * Item型変数.
136          */
137         public Item itemAtoms;
138         public Item itemCompounds;
139         public Item itemGasCollectingBottle;
140         public Item itemAtomGrenade;
141
142         /**
143          * このmodで使用するTextureのパス.
144          */
145         public final String ITEM_ATOMS_TEXTURE = "/pcc/chemicraft/items/Atoms.png";
146         public final String ITEM_COMPOUNDS_TEXTURE = "/pcc/chemicraft/items/Compounds.png";
147         public final String ITEM_TEXTURE = "/pcc/chemicraft/items/items.png";
148         public final String BLOCK_CHEMICAL_CRAFTING_TABLE_TEXTURE = "/pcc/chemicraft/blocks/cctable.png";
149         public final String BLOCK_ATOMS_ORE_TEXTURE = "/pcc/chemicraft/blocks/AtomsOre.png";
150         public final String GUI_PYROLYSIS_TEXTURE = "/pcc/chemicraft/guis/Pyrolysis.png";
151         public final String GUI_ELECTROLYSIS_TEXTURE = "/pcc/chemicraft/guis/Electrolysis.png";
152         public final String GUI_CHEMICALCOMBINATION_TEXTURE = "/pcc/chemicraft/guis/ChemicalCombination.png";
153         public final String GUI_TOOLANDWEAPONCRAFTING_TEXTURE = "/pcc/chemicraft/guis/ToolAndWeaponCrafting.png";
154         public final String GUI_CHEMICALCRAFTING_TEXTURE = "/pcc/chemicraft/guis/MaterialCrafting.png";
155
156         /**
157          * このmodに必要な補助クラスのインスタンス.
158          */
159         public Auxiliary auxiliary = new Auxiliary();
160         public NameAuxiliary nameAuxiliary = new NameAuxiliary();
161         public ArrayAuxiliary arrayAuxiliary = new ArrayAuxiliary();
162
163         private ChemiCraftAPI api = ChemiCraftAPI.instance();
164         private ChemiCraftData chemicalData = new ChemiCraftData();
165
166         @Mod.PreInit
167         public void chemiPreLoadMethod(final FMLPreInitializationEvent event) {
168                 Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
169                 cfg.load();
170
171                 Property pyrolysisTableIDProp = cfg.getBlock("PyrolysisTable", 2400);
172                 Property electrolysisTableIDProp = cfg.getBlock("ElectrolysisTable", 2401);
173                 Property chemicalCombinationTableIDProp = cfg.getBlock("ChemicalCombinationID", 2402);
174                 Property toolAndWeaponCraftingTableIDProp = cfg.getBlock("ToolAndWeaponCraftingTableID", 2403);
175                 Property chemicalCraftingTableIDProp = cfg.getBlock("ChemicalCraftingTableID", 2404);
176
177                 Property[] atomsOreIDProp = new Property[this.atomsOreID.length];
178                 for (int i = 0; i < atomsOreIDProp.length; i++) {
179                         atomsOreIDProp[i] = cfg.getBlock("AtomsOreID:" + i, 2500 + i);
180                 }
181
182                 Property atomsIDProp = cfg.getItem("AtomsID", 25000);
183                 Property compoundsIDProp = cfg.getItem("CompoundsID", 25001);
184                 Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002);
185                 Property atomGrenadeIDProp = cfg.getItem("AtomGrenadeID", 25003);
186
187                 Property guiPyrolysisTableIDProp = cfg.get("GUI", "GUIPyrolysisID", 1000);
188                 Property guiElectrolysisTableIDProp = cfg.get("GUI", "GUIElectrolysisTableIDProp", 1001);
189                 Property guiChemicalCombinationTableIDProp = cfg.get("GUI", "GUIChemicalCombinationTableID", 1002);
190                 Property guiToolAndWeaponCraftingTableIDProp = cfg.get("GUI", "GUIToolAndWeaponCraftingTableID", 1003);
191                 Property guiChemicalCraftingTableIDProp = cfg.get("GUI", "GUIChemicalCraftingTableID", 1004);
192
193
194                 this.pyrolysisTableID = pyrolysisTableIDProp.getInt();
195                 this.electrolysisTableID = electrolysisTableIDProp.getInt();
196                 this.chemicalConbinationTableID = chemicalCombinationTableIDProp.getInt();
197                 this.toolAndWeaponCraftingTableID = toolAndWeaponCraftingTableIDProp.getInt();
198                 this.chemicalCraftingTableID = chemicalCraftingTableIDProp.getInt();
199                 for (int i = 0; i < atomsOreID.length; i++) {
200                         this.atomsOreID[i] = atomsOreIDProp[i].getInt();
201                 }
202                 this.atomsID = atomsIDProp.getInt();
203                 this.compoundsID = compoundsIDProp.getInt();
204                 this.gasCollectingBottleID = gasCollectingBottleIDProp.getInt();
205                 this.atomGrenadeID = atomGrenadeIDProp.getInt();
206                 this.guiPyrolysisTableID = guiPyrolysisTableIDProp.getInt();
207                 this.guiElectrolysisTableID = guiElectrolysisTableIDProp.getInt();
208                 this.guiChemicalCombinationTableID = guiChemicalCombinationTableIDProp.getInt();
209                 this.guiToolAndWeaponCraftingTableID = guiToolAndWeaponCraftingTableIDProp.getInt();
210                 this.guiChemicalCraftingTableID = guiChemicalCraftingTableIDProp.getInt();
211
212                 cfg.save();
213         }
214
215         @Mod.ServerStarting
216         public void serverStarting(final FMLServerStartingEvent event) {
217                 event.registerServerCommand(new CommandSetTile());
218                 event.registerServerCommand(new CommandDeleteItem());
219                 event.registerServerCommand(new CommandGenDebugRoom());
220         }
221
222         @Mod.PostInit
223         public void chemiPostLoadMethod(final FMLPostInitializationEvent event) {
224                 this.settingProcessing(event);
225                 this.apiProcessing(event);
226                 this.debug(event);
227         }
228
229         private void settingProcessing(final FMLPostInitializationEvent event) {
230
231                 // Blockを追加します
232                 this.blockPyrolysisTable = new BlockPyrolysisTable(this.pyrolysisTableID, 0, Material.ground).
233                                 setHardness(2.0F).
234                                 setResistance(0.0F).
235                                 setStepSound(Block.soundStoneFootstep).
236                                 setBlockName("PyrolysisTable");
237                 this.blockElectrolysisTable = new BlockElectrolysisTable(this.electrolysisTableID, 0, Material.ground).
238                                 setHardness(2.0F).
239                                 setResistance(0.0F).
240                                 setStepSound(Block.soundStoneFootstep).
241                                 setBlockName("ElectrolysisTable");
242                 this.blockChemicalCombinationTable = new BlockChemicalCombinationTable(this.chemicalConbinationTableID, 0, Material.ground).
243                                 setHardness(2.0F).
244                                 setResistance(0.0F).
245                                 setStepSound(Block.soundStoneFootstep).
246                                 setBlockName("ChemicalCombinationTable");
247                 this.blockToolAndWeaponCraftingTable = new BlockToolAndWeaponCraftingTable(this.toolAndWeaponCraftingTableID, 0, Material.ground).
248                                 setHardness(2.0F).
249                                 setResistance(0.0F).
250                                 setStepSound(Block.soundStoneFootstep).
251                                 setBlockName("ToolAndWeaponCraftingTable");
252                 this.blockChemicalCraftingTable = new BlockChemicalCraftingTable(this.chemicalCraftingTableID, 0, Material.ground).
253                                 setHardness(2.0F).
254                                 setResistance(0.0F).
255                                 setStepSound(Block.soundStoneFootstep).
256                                 setBlockName("ChemicalCraftingTable");
257
258                 for (int i = 0; i < blockAtomsOre.length; i++)
259                 {
260                         this.blockAtomsOre[i] = new BlockAtomsOre(this.atomsOreID[i]).
261                                         setHardness(3.0F).
262                                         setResistance(0.0F).
263                                         setStepSound(Block.soundStoneFootstep).
264                                         setBlockName("AtomsOre" + i);
265                         GameRegistry.registerBlock(blockAtomsOre[i], ItemAtomsOre.class, "AtomsOre" + i);
266                 }
267
268                 // Itemを追加します
269                 this.itemAtoms = new ItemAtoms(this.atomsID).setItemName("atoms");
270                 this.itemCompounds = new ItemCompounds(this.compoundsID).setItemName("compounds");
271                 this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);
272                 this.itemAtomGrenade = new ItemAtomsGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);
273
274                 // BlockをMinecraftに登録します
275                 GameRegistry.registerBlock(this.blockPyrolysisTable, "BlockPyrolysisTable");
276                 GameRegistry.registerBlock(this.blockChemicalCombinationTable, "BlockChemicalCombinationTable");
277                 GameRegistry.registerBlock(this.blockToolAndWeaponCraftingTable, "BlockToolAndWeaponCraftingTable");
278                 GameRegistry.registerBlock(this.blockChemicalCraftingTable, "BlockMaterialCraftingTable");
279                 GameRegistry.registerBlock(this.blockElectrolysisTable, "BlockElectrolysisTable");
280
281                 // Blockの名前を設定します
282                 this.nameAuxiliary.addName(this.blockPyrolysisTable, "PyrolysisTable");
283                 this.nameAuxiliary.addName(this.blockPyrolysisTable, "ja_JP", "熱分解台");
284                 this.nameAuxiliary.addName(this.blockChemicalCombinationTable, "ChemicalCombinationTable");
285                 this.nameAuxiliary.addName(this.blockChemicalCombinationTable, "ja_JP", "化合台");
286                 this.nameAuxiliary.addName(this.blockToolAndWeaponCraftingTable, "ToolAndWeaponCraftingTable");
287                 this.nameAuxiliary.addName(this.blockToolAndWeaponCraftingTable, "ja_JP", "ツール&武器製作台");
288                 this.nameAuxiliary.addName(this.blockChemicalCraftingTable, "ChemicalCraftingTable");
289                 this.nameAuxiliary.addName(this.blockChemicalCraftingTable, "ja_JP", "素材製作台");
290                 this.nameAuxiliary.addName(this.blockElectrolysisTable, "ElectrolysisTable");
291                 this.nameAuxiliary.addName(this.blockElectrolysisTable, "ja_JP", "電気分解台");
292
293                 // Itemの名前を設定します
294                 this.nameAuxiliary.addName(this.itemAtoms, ATOMSNAME);
295                 this.nameAuxiliary.addName(this.itemAtoms, "ja_JP", ATOMSNAMEJP);
296                 this.nameAuxiliary.addName(this.itemGasCollectingBottle, "GasCollectingBottle");
297                 this.nameAuxiliary.addName(this.itemGasCollectingBottle, "ja_JP", "集気瓶");
298                 this.nameAuxiliary.addName(this.itemAtomGrenade, "AtomGrenade");
299                 this.nameAuxiliary.addName(this.itemAtomGrenade, "元素手榴弾");
300
301                 // TileEntityを追加します
302                 GameRegistry.registerTileEntity(TileEntityPyrolysisTable.class, "TileEntityPyrolysisTable");
303                 GameRegistry.registerTileEntity(TileEntityChemicalCombinationTable.class, "TileEntityChemicalCombinationTable");
304                 GameRegistry.registerTileEntity(TileEntityToolAndWeaponCraftingTable.class, "TileEntityToolAndWeaponCraftingTable");
305                 GameRegistry.registerTileEntity(TileEntityChemicalCraftingTable.class, "TileEntityChemicalCraftingTable");
306                 GameRegistry.registerTileEntity(TileEntityElectrolysisTable.class, "TileEntityElectrolysisTable");
307
308                 // GUIを追加します
309                 NetworkRegistry.instance().registerGuiHandler(instance, proxy);
310
311                 // 描画関係の読み込み
312                 proxy.registerRenderInformation();
313
314                 //化学作業台類のレシピを追加します
315                 GameRegistry.addRecipe(new ItemStack(this.blockPyrolysisTable),
316                                 new Object[]{
317                         "XYX", "ZAZ", "ZZZ",
318                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
319                         Character.valueOf('Y'), new ItemStack(Block.workbench),
320                         Character.valueOf('Z'), new ItemStack(Block.stone),
321                         Character.valueOf('A'), new ItemStack(Item.bucketLava),
322                 });
323                 GameRegistry.addRecipe(new ItemStack(this.blockChemicalCombinationTable),
324                                 new Object[]{
325                         "XYX", "ZAZ", "ZZZ",
326                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
327                         Character.valueOf('Y'), new ItemStack(Block.workbench),
328                         Character.valueOf('Z'), new ItemStack(Block.stone),
329                         Character.valueOf('A'), new ItemStack(Block.obsidian),
330                 });
331                 GameRegistry.addRecipe(new ItemStack(this.blockToolAndWeaponCraftingTable),
332                                 new Object[]{
333                         "XYX", "ZAZ", "ZZZ",
334                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
335                         Character.valueOf('Y'), new ItemStack(Block.workbench),
336                         Character.valueOf('Z'), new ItemStack(Block.stone),
337                         Character.valueOf('A'), new ItemStack(Item.pickaxeSteel),
338                 });
339                 GameRegistry.addRecipe(new ItemStack(this.blockChemicalCraftingTable),
340                                 new Object[]{
341                         "XYX", "ZAZ", "ZZZ",
342                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
343                         Character.valueOf('Y'), new ItemStack(Block.workbench),
344                         Character.valueOf('Z'), new ItemStack(Block.stone),
345                         Character.valueOf('A'), new ItemStack(this.itemAtoms, 1, 0),
346                 });
347
348                 //鉱石を追加します
349
350                 // リチウム
351                 api.addAtomsOre("Petalite", this.atomsOreID[api.getAtomsOreIndex()], 5, 10, 50); // LiAlSi4O10
352                 api.addAtomsOreLanguage("Petalite", "ペタル石", "ja_JP");
353                 api.addAtomsOre("Spodumene", this.atomsOreID[api.getAtomsOreIndex()], 5, 15, 50); // LiAlSi2O6
354                 api.addAtomsOreLanguage("Spodumene", "リチア輝石", "ja_JP");
355
356                 // ベリリウム
357                 api.addAtomsOre("Beryl", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Be3Al2Si6O18
358                 api.addAtomsOreLanguage("Beryl", "緑柱石", "ja_JP");
359                 api.addAtomsOre("Chrysoberyl", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // BeAl2O4
360                 api.addAtomsOreLanguage("Chrysoberyl", "金緑石", "ja_JP");
361
362                 // ホウ素
363                 api.addAtomsOre("Ulexite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50);   // NaCaB5O6(OH)6・5H2O
364                 api.addAtomsOreLanguage("Ulexite", "ウレキサイト", "ja_JP"); // ホウ酸塩鉱石
365
366                 // フッ素
367                 api.addAtomsOre("Fluorite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // CaF2
368                 api.addAtomsOreLanguage("Fluorite", "蛍石", "ja_JP");
369                 api.addAtomsOre("Cryolite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Na3AlF6
370                 api.addAtomsOreLanguage("Cryolite", "氷晶石", "ja_JP");
371
372                 // ナトリウム
373                 api.addAtomsOre("RockSalt", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // NaCl
374                 api.addAtomsOreLanguage("RockSalt", "岩塩", "ja_JP");
375
376                 // マグネシウム
377                 api.addAtomsOre("Dolomite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // CaMg(CO3)2
378                 api.addAtomsOreLanguage("Dolomite", "苦灰石", "ja_JP");
379                 api.addAtomsOre("Magnesite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // MgCO3
380                 api.addAtomsOreLanguage("Magnesite", "菱苦土石", "ja_JP");
381
382                 // アルミニウム
383                 api.addAtomsOre("Gibbsite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Al(OH)3
384                 api.addAtomsOreLanguage("Gibbsite", "ギブス石", "ja_JP");
385                 api.addAtomsOre("Ruby", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Al2O3
386                 api.addAtomsOreLanguage("Ruby", "ルビー", "ja_JP");
387                 api.addAtomsOre("Sapphire", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Al2O3
388                 api.addAtomsOreLanguage("Sapphire", "サファイア", "ja_JP");
389
390                 // ケイ素
391                 api.addAtomsOre("Quartz", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // SiO2
392                 api.addAtomsOreLanguage("Quartz", "石英", "ja_JP");
393
394                 // リン
395                 api.addAtomsOre("Fluorapatite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Ca5(PO4)3F
396                 api.addAtomsOreLanguage("Fluorapatite", "フッ素リン灰石", "ja_JP");
397                 api.addAtomsOre("Chlorapatite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Ca5(PO4)3Cl
398                 api.addAtomsOreLanguage("Chlorapatite", "塩素燐灰石", "ja_JP");
399                 api.addAtomsOre("Hydroxylapatite", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Ca5(PO4)3(OH)
400                 api.addAtomsOreLanguage("Hydroxylapatite", "水酸燐灰石", "ja_JP");
401
402                 //化合物を追加します
403                 this.api.addCompound("ja_JP", "ChlorousAcid", "亜塩素酸");
404                 this.api.addCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");
405                 this.api.addCompound("ja_JP", "CarbonDioxide", "二酸化炭素");
406                 this.api.addCompound("ja_JP", "Water", "水");
407                 this.api.addCompound("ja_JP", "SodiumChloride", "塩化ナトリウム");
408                 this.api.addCompound("ja_JP", "SodiumBicarbonate", "重曹");
409                 this.api.addCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");
410                 this.api.addCompound("ja_JP", "CarbonDioxide", "二酸化炭素");
411                 this.api.addCompound("ja_JP", "Water", "水");
412
413                 //化合物のHandlerを設定します
414                 this.api.settingCompoundHandler("Water", new CompoundWater());
415
416                 //化合物のレシピを追加します
417                 this.api.addChemicalCombinationRecipe(new String[]{"H", "O", "Cl"}, new Integer[]{1, 2, 1}, new ItemStack(this.itemCompounds, 1, this.api.getCompound("ChlorousAcid")));
418                 this.api.addChemicalCombinationRecipe(new String[]{"Na", "O", "H"}, new Integer[]{1, 1, 1}, new ItemStack(this.itemCompounds, 1, api.getCompound("SodiumChloride")));
419                 this.api.addChemicalCombinationRecipe(new String[]{"H", "O", "Cl"}, new Integer[]{1, 2, 1}, new ItemStack(this.itemCompounds, 1, api.getCompound("ChlorousAcid")));
420                 this.api.addChemicalCombinationRecipe(new String[]{"H", "O"}, new Integer[]{2, 1}, new ItemStack(this.itemCompounds, 1, this.api.getCompound("Water")));
421
422                 //手榴弾の追加
423                 this.api.addMaterialRecipe(new ItemStack[] {
424                                 null,
425                                 new ItemStack(Block.stone),
426                                 null,
427                                 new ItemStack(Block.stone),
428                                 new ItemStack(Item.gunpowder),
429                                 new ItemStack(Block.stone),
430                                 null,
431                                 new ItemStack(Block.stone),
432                                 null
433                 },
434                 new ItemStack(this.itemAtomGrenade, 16, 0),
435                 new NBTRecipeGrenade()
436                                 );
437
438                 this.api.addDecompositionRecipe(new ItemStack(Item.potion, 1, 0),
439                                 new int[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},
440                                 new int[] {2, 1});
441
442                 this.api.addDecompositionRecipe(new ItemStack(this.itemCompounds, 1, this.api.getCompound("Water")),
443                                 new int[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},
444                                 new int[] {2, 1});
445
446                 this.api.addDecompositionFuel(new ItemStack(Item.coal), 2000*8);
447         }
448
449         private void apiProcessing(final FMLPostInitializationEvent event) {
450                 // API用の処理
451                 for (int i = 0; i < api.getCompoundsName().sizeKeysList(); i++)
452                 {
453                         for (int j = 0; j < api.getCompoundsName().sizeElementsList(api.getCompoundsName().getKeyList(i)); j++)
454                         {
455                                 this.nameAuxiliary.addName(new ItemStack(itemCompounds, 0, i), api.getCompoundsLang().get(api.getCompoundsName().getKeyList(i), j), api.getCompoundsName().get(api.getCompoundsName().getKeyList(i), j));
456                         }
457                 }
458
459                 for (int i = 0; i < api.getAtomsOreNameListHash().sizeKeysList(); i++)
460                 {
461                         for (int j = 0; j < api.getAtomsOreNameListHash().sizeElementsList(api.getAtomsOreNameListHash().getKeyList(i)); j++)
462                         {
463                                 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));
464                                 OreDictionary.registerOre("ore" + api.getAtomsOreNameListHash().getKeyList(i), new ItemStack(blockAtomsOre[i / 16], 1, i - i / 16 * 16));
465                         }
466                 }
467
468                 for (int i = 0; i < api.getAtomsOres().size(); i++)
469                 {
470                         GameRegistry.registerWorldGenerator(api.getAtomsOres().get(i));
471                 }
472
473         }
474
475         private void debug(final FMLPostInitializationEvent event) {
476                 //DebugTickingの追加
477                 this.proxy.registerTickHandler();
478                 this.api.addCompound("Debug");
479                 this.api.settingCompoundHandler("Debug", new CompoundDebug());
480
481                 /*
482                  * TWDebug
483                  */
484                 this.api.addToolAndWeaponRecipe(new ItemStack[] {
485                                 new ItemStack(Block.stone, 1, 1)
486                 },
487                 new ItemStack(Block.dirt, 1, 0));
488
489         }
490
491 }