OSDN Git Service

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