OSDN Git Service

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