OSDN Git Service

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