OSDN Git Service

b32dd600b3f2b5ee3cd590564f658278508717a5
[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.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;
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;
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/AtomsOres.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 = cfg.getBlock("AtomsOreID", 2500);
173
174                 Property atomsIDProp = cfg.getItem("AtomsID", 25000);
175                 Property compoundsIDProp = cfg.getItem("CompoundsID", 25001);
176                 Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25002);
177                 Property atomGrenadeIDProp = cfg.getItem("AtomGrenadeID", 25003);
178
179                 Property guiPyrolysisTableIDProp = cfg.get("GUI", "GUIPyrolysisID", 1000);
180                 Property guiElectrolysisTableIDProp = cfg.get("GUI", "GUIElectrolysisTableIDProp", 1001);
181                 Property guiChemicalCombinationTableIDProp = cfg.get("GUI", "GUIChemicalCombinationTableID", 1002);
182                 Property guiToolAndWeaponCraftingTableIDProp = cfg.get("GUI", "GUIToolAndWeaponCraftingTableID", 1003);
183                 Property guiChemicalCraftingTableIDProp = cfg.get("GUI", "GUIChemicalCraftingTableID", 1004);
184
185
186                 this.pyrolysisTableID = pyrolysisTableIDProp.getInt();
187                 this.electrolysisTableID = electrolysisTableIDProp.getInt();
188                 this.chemicalConbinationTableID = chemicalCombinationTableIDProp.getInt();
189                 this.toolAndWeaponCraftingTableID = toolAndWeaponCraftingTableIDProp.getInt();
190                 this.chemicalCraftingTableID = chemicalCraftingTableIDProp.getInt();
191                 this.atomsOreID = atomsOreIDProp.getInt();
192                 this.atomsID = atomsIDProp.getInt();
193                 this.compoundsID = compoundsIDProp.getInt();
194                 this.gasCollectingBottleID = gasCollectingBottleIDProp.getInt();
195                 this.atomGrenadeID = atomGrenadeIDProp.getInt();
196                 this.guiPyrolysisTableID = guiPyrolysisTableIDProp.getInt();
197                 this.guiElectrolysisTableID = guiElectrolysisTableIDProp.getInt();
198                 this.guiChemicalCombinationTableID = guiChemicalCombinationTableIDProp.getInt();
199                 this.guiToolAndWeaponCraftingTableID = guiToolAndWeaponCraftingTableIDProp.getInt();
200                 this.guiChemicalCraftingTableID = guiChemicalCraftingTableIDProp.getInt();
201
202                 cfg.save();
203         }
204
205         @Mod.ServerStarting
206         public void serverStarting(final FMLServerStartingEvent event) {
207                 event.registerServerCommand(new CommandSetTile());
208                 event.registerServerCommand(new CommandDeleteItem());
209                 event.registerServerCommand(new CommandGenDebugRoom());
210         }
211
212         @Mod.PostInit
213         public void chemiPostLoadMethod(final FMLPostInitializationEvent event) {
214                 this.settingProcessing(event);
215                 this.apiProcessing(event);
216                 this.debug(event);
217         }
218
219         private void settingProcessing(final FMLPostInitializationEvent event) {
220
221                 // Blockを追加します
222                 this.blockPyrolysisTable = new BlockPyrolysisTable(this.pyrolysisTableID, 0, Material.ground).
223                                 setHardness(2.0F).
224                                 setResistance(0.0F).
225                                 setStepSound(Block.soundStoneFootstep).
226                                 setBlockName("PyrolysisTable");
227                 this.blockElectrolysisTable = new BlockElectrolysisTable(this.electrolysisTableID, 0, Material.ground).
228                                 setHardness(2.0F).
229                                 setResistance(0.0F).
230                                 setStepSound(Block.soundStoneFootstep).
231                                 setBlockName("ElectrolysisTable");
232                 this.blockChemicalCombinationTable = new BlockChemicalCombinationTable(this.chemicalConbinationTableID, 0, Material.ground).
233                                 setHardness(2.0F).
234                                 setResistance(0.0F).
235                                 setStepSound(Block.soundStoneFootstep).
236                                 setBlockName("ChemicalCombinationTable");
237                 this.blockToolAndWeaponCraftingTable = new BlockToolAndWeaponCraftingTable(this.toolAndWeaponCraftingTableID, 0, Material.ground).
238                                 setHardness(2.0F).
239                                 setResistance(0.0F).
240                                 setStepSound(Block.soundStoneFootstep).
241                                 setBlockName("ToolAndWeaponCraftingTable");
242                 this.blockChemicalCraftingTable = new BlockChemicalCraftingTable(this.chemicalCraftingTableID, 0, Material.ground).
243                                 setHardness(2.0F).
244                                 setResistance(0.0F).
245                                 setStepSound(Block.soundStoneFootstep).
246                                 setBlockName("ChemicalCraftingTable");
247
248                 // Itemを追加します
249                 this.itemAtoms = new ItemAtoms(this.atomsID).setItemName("atoms");
250                 this.itemCompounds = new ItemCompounds(this.compoundsID).setItemName("compounds");
251                 this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);
252                 this.itemAtomGrenade = new ItemAtomsGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);
253
254                 // BlockをMinecraftに登録します
255                 GameRegistry.registerBlock(this.blockPyrolysisTable, "BlockPyrolysisTable");
256                 GameRegistry.registerBlock(this.blockChemicalCombinationTable, "BlockChemicalCombinationTable");
257                 GameRegistry.registerBlock(this.blockToolAndWeaponCraftingTable, "BlockToolAndWeaponCraftingTable");
258                 GameRegistry.registerBlock(this.blockChemicalCraftingTable, "BlockMaterialCraftingTable");
259                 GameRegistry.registerBlock(this.blockElectrolysisTable, "BlockElectrolysisTable");
260
261                 // Blockの名前を設定します
262                 this.nameAuxiliary.addName(this.blockPyrolysisTable, "PyrolysisTable");
263                 this.nameAuxiliary.addName(this.blockPyrolysisTable, "ja_JP", "熱分解台");
264                 this.nameAuxiliary.addName(this.blockChemicalCombinationTable, "ChemicalCombinationTable");
265                 this.nameAuxiliary.addName(this.blockChemicalCombinationTable, "ja_JP", "化合台");
266                 this.nameAuxiliary.addName(this.blockToolAndWeaponCraftingTable, "ToolAndWeaponCraftingTable");
267                 this.nameAuxiliary.addName(this.blockToolAndWeaponCraftingTable, "ja_JP", "ツール&武器製作台");
268                 this.nameAuxiliary.addName(this.blockChemicalCraftingTable, "ChemicalCraftingTable");
269                 this.nameAuxiliary.addName(this.blockChemicalCraftingTable, "ja_JP", "素材製作台");
270                 this.nameAuxiliary.addName(this.blockElectrolysisTable, "ElectrolysisTable");
271                 this.nameAuxiliary.addName(this.blockElectrolysisTable, "ja_JP", "電気分解台");
272
273                 // Itemの名前を設定します
274                 this.nameAuxiliary.addName(this.itemAtoms, ATOMSNAME);
275                 this.nameAuxiliary.addName(this.itemAtoms, "ja_JP", ATOMSNAMEJP);
276                 this.nameAuxiliary.addName(this.itemGasCollectingBottle, "GasCollectingBottle");
277                 this.nameAuxiliary.addName(this.itemGasCollectingBottle, "ja_JP", "集気瓶");
278                 this.nameAuxiliary.addName(this.itemAtomGrenade, "AtomGrenade");
279                 this.nameAuxiliary.addName(this.itemAtomGrenade, "元素手榴弾");
280
281                 // TileEntityを追加します
282                 GameRegistry.registerTileEntity(TileEntityPyrolysisTable.class, "TileEntityPyrolysisTable");
283                 GameRegistry.registerTileEntity(TileEntityChemicalCombinationTable.class, "TileEntityChemicalCombinationTable");
284                 GameRegistry.registerTileEntity(TileEntityToolAndWeaponCraftingTable.class, "TileEntityToolAndWeaponCraftingTable");
285                 GameRegistry.registerTileEntity(TileEntityChemicalCraftingTable.class, "TileEntityChemicalCraftingTable");
286                 GameRegistry.registerTileEntity(TileEntityElectrolysisTable.class, "TileEntityElectrolysisTable");
287
288                 // GUIを追加します
289                 NetworkRegistry.instance().registerGuiHandler(instance, proxy);
290
291                 // 描画関係の読み込み
292                 proxy.registerRenderInformation();
293
294                 //化学作業台類のレシピを追加します
295                 GameRegistry.addRecipe(new ItemStack(this.blockPyrolysisTable),
296                                 new Object[]{
297                         "XYX", "ZAZ", "ZZZ",
298                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
299                         Character.valueOf('Y'), new ItemStack(Block.workbench),
300                         Character.valueOf('Z'), new ItemStack(Block.stone),
301                         Character.valueOf('A'), new ItemStack(Item.bucketLava),
302                 });
303                 GameRegistry.addRecipe(new ItemStack(this.blockChemicalCombinationTable),
304                                 new Object[]{
305                         "XYX", "ZAZ", "ZZZ",
306                         Character.valueOf('X'), new ItemStack(Item.ingotIron),
307                         Character.valueOf('Y'), new ItemStack(Block.workbench),
308                         Character.valueOf('Z'), new ItemStack(Block.stone),
309                         Character.valueOf('A'), new ItemStack(Block.obsidian),
310                 });
311                 GameRegistry.addRecipe(new ItemStack(this.blockToolAndWeaponCraftingTable),
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.pickaxeSteel),
318                 });
319                 GameRegistry.addRecipe(new ItemStack(this.blockChemicalCraftingTable),
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(this.itemAtoms, 1, 0),
326                 });
327
328                 //鉱石の登録
329                 for (int i = 0; i < api.getAtomsOreIDList().size(); i++) {
330                         this.blockAtomsOre = new BlockAtomsOre(api.getAtomsOreIDList().get(i)).
331                                         setHardness(3.0F).setResistance(5.0F).
332                                         setStepSound(Block.soundStoneFootstep).
333                                         setBlockName("AtomsOre" + "." + api.getAtomsOreIDList().get(i));
334                         GameRegistry.registerBlock(this.blockAtomsOre, "AtomsOre");
335                 }
336
337                 //鉱石を追加します
338                 api.addAtomsOre("Test", Block.blockDiamond.blockID, 0, 5, 5, 20); //テスト用
339
340                 //鉱石の生成
341                 for (int i = 0; i < api.getAtomsOreIDList().size(); i++) {
342                         GameRegistry.registerWorldGenerator(new WorldGenAtomsOre(api.getAtomsOreIDList().get(i), api.getAtomsOreMetaList().get(i), api.getAtomsOreSizeList().get(i), api.getAtomsOreFrequencyList().get(i), api.getAtomsOrePosYList().get(i)));
343                 }
344
345                 //化合物を追加します
346                 api.addLangCompound("ja_JP", "ChlorousAcid", "亜塩素酸");
347
348                 api.addLangCompound("ja_JP", "CarbonMonoxide", "一酸化炭素");
349                 api.addLangCompound("ja_JP", "CarbonDioxide", "二酸化炭素");
350                 api.addLangCompound("ja_JP", "Water", "水");
351
352
353                 //化合物のHandlerを設定します
354                 api.settingCompoundHandler("Water", new CompoundWater());
355
356                 //化合物のレシピを追加します
357                 api.addChemicalCombinationRecipe(new String[]{"H", "O", "Cl"}, new Integer[]{1, 2, 1}, new ItemStack(this.itemCompounds, 1, api.getCompound("ChlorousAcid")));
358
359                 api.addChemicalCombinationRecipe(new String[]{"H", "O"}, new Integer[]{2, 1}, new ItemStack(this.itemCompounds, 1, api.getCompound("Water")));
360
361                 //手榴弾の追加
362                 api.addMaterialRecipe(new ItemStack[] {
363                                 null,
364                                 new ItemStack(Block.stone),
365                                 null,
366                                 new ItemStack(Block.stone),
367                                 new ItemStack(Item.gunpowder),
368                                 new ItemStack(Block.stone),
369                                 null,
370                                 new ItemStack(Block.stone),
371                                 null
372                 },
373                 new ItemStack(this.itemAtomGrenade, 16, 0),
374                 new NBTRecipeGrenade()
375                                 );
376
377                 api.addDecompositionRecipe(new ItemStack(Item.potion, 1, 0),
378                                 new int[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},
379                                 new int[] {2, 1});
380
381                 api.addDecompositionRecipe(new ItemStack(this.itemCompounds, 1, api.getCompound("Water")),
382                                 new int[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},
383                                 new int[] {2, 1});
384
385                 api.addDecompositionFuel(new ItemStack(Item.coal), 2000*8);
386         }
387
388         private void apiProcessing(final FMLPostInitializationEvent event) {
389                 // API用の処理
390                 this.nameAuxiliary.addName(itemCompounds, api.getCompoundsName().toArray());
391                 for (int i = 0; i < api.getCompoundsLang().size(); i++) {
392                         this.nameAuxiliary.addName(itemCompounds, api.getCompoundsLang().get(i), api.getCompoundsLangName().toArray());
393                 }
394         }
395
396         private void debug(final FMLPostInitializationEvent event) {
397                 //DebugTickingの追加
398                 this.proxy.registerTickHandler();
399                 this.api.addCompound("Debug");
400                 this.api.settingCompoundHandler("Debug", new CompoundDebug());
401
402                 /*
403                  * TWDebug
404                  */
405                 api.addToolAndWeaponRecipe(new ItemStack[] {
406                                 new ItemStack(Block.stone, 1, 1)
407                 },
408                 new ItemStack(Block.dirt, 1, 0));
409         }
410
411 }