OSDN Git Service

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