OSDN Git Service

文字化け用
[chemicraft/chemicraft.git] / common / chemicraft / ChemiCraftAPI.java
1 package chemicraft;
2
3 import java.util.ArrayList;
4
5 import net.minecraft.src.ItemStack;
6
7 /**
8  * ChemiCraftのAPI
9  * 基本的にAddonはこのクラスのインスタンスを使う
10  * @author mozipi
11  *
12  */
13 public class ChemiCraftAPI {
14
15         /**
16          * Instance of the ChemiCraftAPI.
17          */
18         public static ChemiCraftAPI instance = new ChemiCraftAPI();
19
20
21         /**
22          * List of compounds names.
23          */
24         private static ArrayList<String> compoundsNameList = new ArrayList();
25
26
27         /**
28          * List of compounds names(Some kind of language).
29          */
30         private static ArrayList<String> compoundsLangNameList = new ArrayList();
31
32
33         /**
34          * List of compounds the language names.
35          */
36         private static ArrayList<String> compoundsLangList = new ArrayList();
37
38
39         /**
40          * List of compounds handlers.
41          */
42         private static ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
43
44
45         /**
46          * List of item name of handler to compounds.
47          */
48         private static ArrayList<String> compoundHandlerItemNames = new ArrayList<String>();
49
50
51         /**
52          * 分解台の素材のリスト
53          */
54         private static ArrayList<ItemStack> decompositionMaterial = new ArrayList<ItemStack>();
55
56
57         /**
58          * 分解台の結果のリスト
59          */
60         private static ArrayList<ItemStack[]> decompositionResults = new ArrayList<ItemStack[]>();
61
62
63         /**
64          * 化合台の素材のリスト
65          */
66         private static ArrayList<ItemStack[]> chemicalCombinationMaterials = new ArrayList<ItemStack[]>();
67
68
69         /**
70          * 化合台の結果のリスト
71          */
72         private static ArrayList<ItemStack> chemicalCombinationResult = new ArrayList<ItemStack>();
73
74
75
76         /**
77          * ChemiCraftの化学作業台類のレシピのマネージャー
78          */
79         private static ChemiCraftCraftingManager chemiCraftCraftingManager = new ChemiCraftCraftingManager();
80
81
82
83         /**
84          * add compound.
85          * @param name compound name.
86          */
87         public static void addCompound(String name){
88                 compoundsNameList.add(name);
89                 compoundsLangNameList.add("");
90                 compoundsLangList.add("");
91         }
92
93
94
95         /**
96          * add compound corresponding to the language.
97          * @param lang Language to the corresponding
98          * @param englishName compound name
99          * @param langName compound name(specified language)
100          */
101         public static void addLangCompound(String lang, String englishName, String langName){
102                 compoundsNameList.add(englishName);
103                 compoundsLangNameList.add(langName);
104                 compoundsLangList.add(lang);
105         }
106
107
108
109         /**
110          * setting compound handler.
111          * @param handlerItemName
112          * @param compoundHandler
113          */
114         public static void settingCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){
115                 ChemiCraftAPI.compoundHandlers.add(compoundHandler);
116                 compoundHandlerItemNames.add(handlerItemName);
117         }
118
119
120
121         /**
122          * 分解レシピを追加します。resultの要素数は0<= n <= 16にしてください。
123          * @param material 素材
124          * @param result 結果
125          */
126         public static void addDecompositionRecipe(ItemStack material, ItemStack[] result){
127                 if(result.length <= 16){
128                         decompositionMaterial.add(material);
129                         decompositionResults.add(result);
130                 }else{
131                         System.err.println("ChemiCraft内でエラー:addDecompositionRecipeの引数resultの要素数が16を超えています。" + "Material:" + material + "  Result:" + result);
132                 }
133         }
134
135
136
137         /**
138          * 化合レシピを追加します。materialの要素数は0<= n <= 16にしてください。
139          * @param material 素材
140          * @param result 結果
141          */
142         public static void addChemicalCombinationRecipe(ItemStack[] material, ItemStack result){
143                 if(material.length <= 16){
144                         chemicalCombinationMaterials.add(material);
145                         chemicalCombinationResult.add(result);
146                 }else{
147                         System.err.println("ChemiCraft内でエラー:addChemicalCombinationRecipeの引数materialの要素数が16を超えています。" + "Material:" + material + "  Result:" + result);
148                 }
149         }
150         //以下システム関連//////////////////////////////////////////////////////
151
152         public static ArrayList<ICompoundHandler> getCompoundHandler(){
153                 compoundHandlers.trimToSize();
154                 return compoundHandlers;
155
156         }
157
158
159
160         public static ArrayList<String> getCompoundHandlerItemName(){
161                 compoundHandlerItemNames.trimToSize();
162                 return compoundHandlerItemNames;
163         }
164
165
166
167         public static ArrayList<String> getCompoundsName(){
168                 compoundsNameList.trimToSize();
169                 return compoundsNameList;
170         }
171
172
173
174         public static ArrayList<String> getCompoundsLangName(){
175                 compoundsLangNameList.trimToSize();
176                 return compoundsLangNameList;
177         }
178
179
180
181         public static ArrayList<String> getCompoundsLang(){
182                 compoundsLangList.trimToSize();
183                 return compoundsLangList;
184         }
185
186
187
188         public static ArrayList<ItemStack> getDecompositionMaterial(){
189                 return decompositionMaterial;
190         }
191
192
193
194         public static ArrayList<ItemStack[]> getDecompositionResult(){
195                 return decompositionResults;
196         }
197
198
199
200         public static ArrayList<ItemStack[]> getChemicalCombinationMaterial(){
201                 return chemicalCombinationMaterials;
202         }
203
204
205
206         public static ArrayList<ItemStack> getChemicalCombinationResult(){
207                 return chemicalCombinationResult;
208         }
209
210
211
212         public static ChemiCraftCraftingManager getCraftingManager(){
213                 return chemiCraftCraftingManager;
214         }
215
216 }