OSDN Git Service

代理コミット
[chemicraft/chemicraft.git] / src / ChemiCraft.java
1 package net.minecraft.src.ChemiCraft;\r
2 \r
3 import java.util.ArrayList;\r
4 import java.util.Properties;\r
5 \r
6 import net.minecraft.src.Block;\r
7 import net.minecraft.src.Item;\r
8 import net.minecraft.src.ItemStack;\r
9 import net.minecraftforge.common.Configuration;\r
10 import net.minecraftforge.common.Property;\r
11 import cpw.mods.fml.common.Mod;\r
12 import cpw.mods.fml.common.event.FMLInitializationEvent;\r
13 import cpw.mods.fml.common.event.FMLPostInitializationEvent;\r
14 import cpw.mods.fml.common.event.FMLPreInitializationEvent;\r
15 import cpw.mods.fml.common.network.NetworkMod;\r
16 import cpw.mods.fml.common.registry.GameRegistry;\r
17 import cpw.mods.fml.common.registry.LanguageRegistry;\r
18 \r
19 @Mod( modid = "chemiCraft", name="ChemiCraft", version="\83e\83X\83g\94Å") //ID,\96¼\91O,\83o\81[\83W\83\87\83\93\r
20 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "[1.3.2]") //\83N\83\89\83C\83A\83\93\83g\81A\83T\81[\83o\81[\8b¤\82É\95K\97v 1.3.2\97p\r
21 \r
22 public class ChemiCraft\r
23 {\r
24 \r
25         public static final String[] atomsName = {\r
26                 "Hydrogen", "Helium","Lithium","Beryllium","Boron","Carbon","Nitrogen","Oxygen","Fluorine","Neon",\r
27                 "Sodium","Magnesium","Aluminium","Silicon","Phosphorus","Sulfur","Chlorine","Argon","Potassium","Calcium",\r
28                 "Scandium","Titanium","Vanadium","Chromium","Manganese","Iron","Cobalt","Nickel","Copper","Zinc",\r
29                 "Gallium","Germanium","Arsenic","Selenium","Bromine","Krypton","Rubidium","Strontium","Yttorium","Zirconium",\r
30                 "Niobium","Molybdenum","Technetium","Ruthenium","Rhodium","Palladium","Silver","Cadmium","Indium","Tin",\r
31                 "Antimony","Tellurium","Iodine","Xenon","Caesium","Barium","Lanthanum","Cerium","Praseodymium","Neodymium",\r
32                 "Promethium","Samarium","Europium","Gadolinium","Terbium","Dysprosium","Holmium","Erbium","Thulium","Ytterbium",\r
33                 "Lutetium","Hafnium","Tantalum","Tungsten","Rhenium","Osmium","Iridium","Platinum","Gold","Mercury",\r
34                 "Thallium","Lead","Bismuth","Polonium","Astatine","Radon","Francium","Radium","Actinium","Thorium",\r
35                 "Protactinium","Uranium","Neptunium","Plutonium","Americium","Curium","Berkelium","Californium","Einsteinium","Fermium",\r
36                 "Mendelevium","Nobelium","Lawrencium","Rutherfordium","Dubnium","Seaborgium","Bohrium","Hassium","Meitnerium","Darmstadtium",\r
37                 "Roentgenium","Copernicium","Ununtrium","Ununquadium","Ununpentium","Ununhexium","","Ununoctium"\r
38         };\r
39 \r
40         public static final String[] atomsNameJP = {\r
41                 "\90\85\91f", "\83w\83\8a\83E\83\80"\r
42         };\r
43 \r
44         private ChemiCraftAPI chemiCraftAPI = ChemiCraftAPI.instance;\r
45 \r
46         public static int atomsID;\r
47         public static int compoundsID;\r
48 \r
49         public static Item itemAtoms;\r
50         public static Item itemCompounds;\r
51 \r
52         private Auxiliary Auxiliary = new Auxiliary();\r
53         private Auxiliary.NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary();\r
54 \r
55         // \83R\83\93\83X\83g\83\89\83N\83^\r
56         @Mod.Init\r
57         public void chemiLoadMethod(FMLInitializationEvent event)\r
58         {\r
59                 //\89»\8d\87\95¨\82Ì\92Ç\89Á\r
60                 ChemiCraftAPI.addLangCompound("ja_JP", "Salt", "\89\96(\89\96\89»\83i\83g\83\8a\83E\83\80)");\r
61         }\r
62 \r
63         @Mod.PreInit  // \91O\8f\88\97\9d\r
64         public void chemiPreLoadMethod(FMLPreInitializationEvent event)\r
65         {\r
66                 Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());\r
67                 cfg.load();\r
68                 Property atomsIDProp = cfg.getItem("atomsID", 25000);\r
69                 Property compoundsIDProp = cfg.getItem("compoundsID", 25001);\r
70                 atomsID = atomsIDProp.getInt();\r
71                 compoundsID = compoundsIDProp.getInt();\r
72                 cfg.save();\r
73         }\r
74 \r
75         @Mod.PostInit // ModLoader.load\83\81\83\\83b\83h\82Æ\93¯\93\99\r
76         public void chemiPostLoadMethod(FMLPostInitializationEvent event)\r
77         {\r
78                 itemAtoms = new ItemAtoms(atomsID).setItemName("atoms");\r
79                 itemCompounds = new ItemCompounds(compoundsID).setItemName("compounds");\r
80 \r
81                 NameAuxiliary.addForName(itemAtoms, atomsName);\r
82                 NameAuxiliary.addForLangName(itemAtoms, "ja_JP", atomsNameJP);\r
83                 NameAuxiliary.addForName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray());\r
84                 NameAuxiliary.addForLangName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray());\r
85 \r
86                 ChemiCraftAPI.addCompoundHandler("Salt", new CompoundHandlerTest());\r
87 \r
88         }\r
89 \r
90 }