OSDN Git Service

70930071514e628db073bc8c84151d779dd1c739
[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.CreativeTabs;\r
8 import net.minecraft.src.Item;\r
9 import net.minecraft.src.ItemStack;\r
10 import net.minecraftforge.common.Configuration;\r
11 import net.minecraftforge.common.Property;\r
12 import cpw.mods.fml.common.Mod;\r
13 import cpw.mods.fml.common.event.FMLInitializationEvent;\r
14 import cpw.mods.fml.common.event.FMLPostInitializationEvent;\r
15 import cpw.mods.fml.common.event.FMLPreInitializationEvent;\r
16 import cpw.mods.fml.common.network.NetworkMod;\r
17 import cpw.mods.fml.common.registry.GameRegistry;\r
18 import cpw.mods.fml.common.registry.LanguageRegistry;\r
19 \r
20 @Mod( modid = "chemiCraft", name="ChemiCraft", version="\83e\83X\83g\94Å") //ID,\96¼\91O,\83o\81[\83W\83\87\83\93\r
21 @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
22 \r
23 public class ChemiCraft\r
24 {\r
25 \r
26         public static final CreativeTabs tabAtoms = new CreativeTabAtoms("tabAtoms");\r
27 \r
28         public static final String[] atomsName = {\r
29                 "Hydrogen", "Helium","Lithium","Beryllium","Boron","Carbon","Nitrogen","Oxygen","Fluorine","Neon",\r
30                 "Sodium","Magnesium","Aluminium","Silicon","Phosphorus","Sulfur","Chlorine","Argon","Potassium","Calcium",\r
31                 "Scandium","Titanium","Vanadium","Chromium","Manganese","Iron","Cobalt","Nickel","Copper","Zinc",\r
32                 "Gallium","Germanium","Arsenic","Selenium","Bromine","Krypton","Rubidium","Strontium","Yttorium","Zirconium",\r
33                 "Niobium","Molybdenum","Technetium","Ruthenium","Rhodium","Palladium","Silver","Cadmium","Indium","Tin",\r
34                 "Antimony","Tellurium","Iodine","Xenon","Caesium","Barium","Lanthanum","Cerium","Praseodymium","Neodymium",\r
35                 "Promethium","Samarium","Europium","Gadolinium","Terbium","Dysprosium","Holmium","Erbium","Thulium","Ytterbium",\r
36                 "Lutetium","Hafnium","Tantalum","Tungsten","Rhenium","Osmium","Iridium","Platinum","Gold","Mercury",\r
37                 "Thallium","Lead","Bismuth","Polonium","Astatine","Radon","Francium","Radium","Actinium","Thorium",\r
38                 "Protactinium","Uranium","Neptunium","Plutonium","Americium","Curium","Berkelium","Californium","Einsteinium","Fermium",\r
39                 "Mendelevium","Nobelium","Lawrencium","Rutherfordium","Dubnium","Seaborgium","Bohrium","Hassium","Meitnerium","Darmstadtium",\r
40                 "Roentgenium","Copernicium","Ununtrium","Ununquadium","Ununpentium","Ununhexium","","Ununoctium"\r
41         };\r
42 \r
43         public static final String[] atomsNameJP = {\r
44                 "\90\85\91f", "\83w\83\8a\83E\83\80", "\83\8a\83`\83E\83\80", "\83x\83\8a\83E\83\80", "\83z\83E\91f", "\92Y\91f", "\92\82\91f", "\8e_\91f", "\83t\83b\91f", "\83l\83I\83\93",\r
45                 "\83i\83g\83\8a\83E\83\80", "\83}\83O\83l\83V\83E\83\80", "\83A\83\8b\83~\83j\83E\83\80", "\83P\83C\91f", "\83\8a\83\93", "\97°\89©", "\89\96\91f", "\83A\83\8b\83S\83\93", "\83J\83\8a\83E\83\80", "\83J\83\8b\83V\83E\83\80",\r
46                 "\83X\83J\83\93\83W\83E\83\80", "\83`\83^\83\93", "\83o\83i\83W\83E\83\80", "\83N\83\8d\83\80", "\83}\83\93\83K\83\93", "\93S", "\83R\83o\83\8b\83g", "\83j\83b\83P\83\8b", "\93º", "\88\9f\89\94",\r
47                 "\83K\83\8a\83E\83\80", "\83Q\83\8b\83}\83j\83E\83\80", "\83q\91f", "\83Z\83\8c\83\93", "\8fL\91f", "\83N\83\8a\83v\83g\83\93", "\83\8b\83r\83W\83E\83\80", "\83X\83g\83\8d\83\93\83`\83E\83\80", "\83C\83b\83g\83\8a\83E\83\80", "\83W\83\8b\83R\83j\83E\83\80",\r
48                 "\83j\83I\83u", "\83\82\83\8a\83u\83f\83\93", "\83e\83N\83l\83`\83E\83\80", "\83\8b\83e\83j\83E\83\80", "\83\8d\83W\83E\83\80", "\83p\83\89\83W\83E\83\80", "\8bâ", "\83J\83h\83~\83E\83\80", "\83C\83\93\83W\83E\83\80", "\83X\83Y",\r
49                 "\83A\83\93\83`\83\82\83\93", "\83e\83\8b\83\8b", "\83\88\83E\91f", "\83L\83Z\83m\83\93", "\83Z\83V\83E\83\80", "\83o\83\8a\83E\83\80", "\83\89\83\93\83^\83\93", "\83Z\83\8a\83E\83\80", "\83v\83\89\83Z\83I\83W\83\80", "\83l\83I\83W\83\80",\r
50                 "\83v\83\8d\83\81\83`\83E\83\80", "\83T\83}\83\8a\83E\83\80", "\83\86\83E\83\8d\83r\83E\83\80", "\83K\83h\83\8a\83j\83E\83\80", "\83e\83\8b\83r\83E\83\80", "\83W\83X\83v\83\8d\83j\83E\83\80", "\83z\83\8b\83~\83E\83\80", "\83G\83\8b\83r\83E\83\80", "\83c\83\8a\83E\83\80", "\83C\83b\83e\83\8b\83r\83E\83\80",\r
51                 "\83\8b\83e\83`\83E\83\80", "\83n\83t\83j\83E\83\80", "\83^\83\93\83^\83\8b", "\83^\83\93\83O\83X\83e\83\93", "\83\8c\83j\83E\83\80", "\83I\83X\83~\83E\83\80", "\83C\83\8a\83W\83E\83\80", "\94\92\8bà", "\8bà", "\90\85\8bâ",\r
52                 "\83^\83\8a\83E\83\80", "\89\94", "\83r\83X\83}\83X", "\83|\83\8d\83j\83E\83\80", "\83A\83X\83^\83`\83\93", "\83\89\83h\83\93", "\83t\83\89\83\93\83V\83E\83\80", "\83\89\83W\83E\83\80", "\83A\83N\83`\83j\83E\83\80", "\83g\83\8a\83E\83\80",\r
53                 "\83v\83\8d\83g\83A\83N\83`\83E\83\80", "\83E\83\89\83\93", "\83l\83v\83c\83j\83E\83\80", "\83v\83\8b\83g\83j\83E\83\80", "\83A\83\81\83\8a\83V\83E\83\80", "\83L\83\85\83\8a\83E\83\80", "\83o\81[\83N\83\8a\83E\83\80", "\83J\83\8b\83z\83\8b\83j\83E\83\80", "\83A\83C\83\93\83X\83^\83C\83j\83E\83\80", "\83t\83F\83\8b\83~\83E\83\80",\r
54                 "\83\81\83\93\83f\83\8c\83r\83E\83\80", "\83m\81[\83x\83\8a\83E\83\80", "\83\8d\81[\83\8c\83\93\83V\83E\83\80", "\83\89\83T\83z\81[\83W\83E\83\80", "\83h\83u\83j\83E\83\80", "\83V\81[\83{\81[\83M\83E\83\80", "\83{\81[\83\8a\83E\83\80", "\83n\83b\83V\83E\83\80", "\83}\83C\83g\83l\83\8a\83E\83\80", "\83_\81[\83\80\83X\83^\83`\83E\83\80",\r
55                 "\83\8c\83\93\83g\83Q\83j\83E\83\80", "\83R\83y\83\8b\83j\83V\83E\83\80", "\83E\83\93\83E\83\93\83g\83\8a\83E\83\80", "\83t\83\8c\83\8d\83r\83E\83\80", "\83E\83\93\83E\83\93\83y\83\93\83`\83E\83\80", "\83\8a\83o\83\82\83\8a\83E\83\80", "\83E\83\93\83E\83\93\83Z\83v\83`\83E\83\80", "\83E\83\93\83E\83\93\83I\83N\83`\83E\83\80"\r
56         };\r
57 \r
58         private ChemiCraftAPI chemiCraftAPI = ChemiCraftAPI.instance;\r
59 \r
60         public static int gasCollectingBottleID;\r
61         public static int atomsID;\r
62         public static int compoundsID;\r
63 \r
64         public static Item itemGasCollectingBottle;\r
65         public static Item itemAtoms;\r
66         public static Item itemCompounds;\r
67 \r
68         private Auxiliary Auxiliary = new Auxiliary();\r
69         private Auxiliary.NameAuxiliary NameAuxiliary = Auxiliary.new NameAuxiliary();\r
70 \r
71         // \83R\83\93\83X\83g\83\89\83N\83^\r
72         @Mod.Init\r
73         public void chemiLoadMethod(FMLInitializationEvent event)\r
74         {\r
75 \r
76                 //\89»\8d\87\95¨\82Ì\92Ç\89Á\r
77                 ChemiCraftAPI.addLangCompound("ja_JP", "Salt", "\89\96");\r
78         }\r
79 \r
80         @Mod.PreInit  // \91O\8f\88\97\9d\r
81         public void chemiPreLoadMethod(FMLPreInitializationEvent event)\r
82         {\r
83                 Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());\r
84                 cfg.load();\r
85                 Property gasCollectingBottleIDProp = cfg.getItem("gasCollectingBottleID", 25000);\r
86                 Property atomsIDProp = cfg.getItem("atomsID", 25001);\r
87                 Property compoundsIDProp = cfg.getItem("compoundsID", 25002);\r
88                 gasCollectingBottleID = gasCollectingBottleIDProp.getInt();\r
89                 atomsID = atomsIDProp.getInt();\r
90                 compoundsID = compoundsIDProp.getInt();\r
91                 cfg.save();\r
92         }\r
93 \r
94         @Mod.PostInit // ModLoader.load\83\81\83\\83b\83h\82Æ\93¯\93\99\r
95         public void chemiPostLoadMethod(FMLPostInitializationEvent event)\r
96         {\r
97                 itemGasCollectingBottle = new ItemGasCollectingBottle(gasCollectingBottleID).setItemName("gasCollectingBottle");\r
98                 itemAtoms = new ItemAtoms(atomsID).setItemName("atoms");\r
99                 itemCompounds = new ItemCompounds(compoundsID).setItemName("compounds");\r
100 \r
101                 NameAuxiliary.addName(itemAtoms, atomsName);\r
102                 NameAuxiliary.addName(itemAtoms, "ja_JP", atomsNameJP);\r
103                 NameAuxiliary.addName(itemCompounds, ChemiCraftAPI.getCompoundsName().toArray());\r
104                 NameAuxiliary.addName(itemCompounds, "ja_JP", ChemiCraftAPI.getCompoundsLangName().toArray());\r
105                 NameAuxiliary.addName(itemGasCollectingBottle, "GasCollectingBottle");\r
106                 NameAuxiliary.addName(itemGasCollectingBottle, "ja_JP", "\8fW\8bC\95r");\r
107 \r
108                 ChemiCraftAPI.addCompoundHandler("Salt", new CompoundHandlerTest());\r
109 \r
110         }\r
111 \r
112 }