3 import java.util.ArrayList;
5 import net.minecraft.src.ItemStack;
9 * 基本的にAddonはこのクラスのインスタンスを使う
13 public class ChemiCraftAPI {
16 * Instance of the ChemiCraftAPI.
18 public static ChemiCraftAPI instance = new ChemiCraftAPI();
22 * List of compounds names.
24 private ArrayList<String> compoundsNameList = new ArrayList();
28 * List of compounds names(Some kind of language).
30 private ArrayList<String> compoundsLangNameList = new ArrayList();
34 * List of compounds the language names.
36 private ArrayList<String> compoundsLangList = new ArrayList();
40 * List of compounds handlers.
42 private ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
46 * List of item name of handler to compounds.
48 private ArrayList<String> compoundHandlerItemNames = new ArrayList<String>();
54 private ArrayList<ItemStack> decompositionMaterial = new ArrayList<ItemStack>();
60 private ArrayList<ItemStack[]> decompositionResults = new ArrayList<ItemStack[]>();
66 private ArrayList<ItemStack[]> chemicalCombinationMaterials = new ArrayList<ItemStack[]>();
72 private ArrayList<ItemStack> chemicalCombinationResult = new ArrayList<ItemStack>();
79 private ArrayList<ItemStack[]> materialEffectMaterials = new ArrayList<ItemStack[]>();
86 private ArrayList<ItemStack[]> materialMaterials = new ArrayList<ItemStack[]>();
93 private ArrayList<ItemStack> materialResult = new ArrayList<ItemStack>();
100 private ArrayList<String[]> materialEffectKey = new ArrayList<String[]>();
107 private ArrayList<Object[]> materialEffectValue = new ArrayList<Object[]>();
112 * ChemiCraftの化学作業台類のレシピのマネージャー
114 private ChemiCraftCraftingManager chemiCraftCraftingManager = new ChemiCraftCraftingManager();
120 * @param name compound name.
122 public void addCompound(String name){
123 compoundsNameList.add(name);
124 compoundsLangNameList.add("");
125 compoundsLangList.add("");
131 * add compound corresponding to the language.
132 * @param lang Language to the corresponding
133 * @param englishName compound name
134 * @param langName compound name(specified language)
136 public void addLangCompound(String lang, String englishName, String langName){
137 compoundsNameList.add(englishName);
138 compoundsLangNameList.add(langName);
139 compoundsLangList.add(lang);
145 * setting compound handler.
146 * @param handlerItemName
147 * @param compoundHandler
149 public void settingCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){
150 compoundHandlers.add(compoundHandler);
151 compoundHandlerItemNames.add(handlerItemName);
157 * 分解レシピを追加します。resultの要素数は0<= n <= 16にしてください。
161 public void addDecompositionRecipe(ItemStack material, ItemStack[] result){
162 if(result.length <= 16){
163 decompositionMaterial.add(material);
164 decompositionResults.add(result);
166 System.err.println("ChemiCraft内でエラー:addDecompositionRecipeの引数resultの要素数が16を超えています。" + "Material:" + material + " Result:" + result);
173 * 化合レシピを追加します。materialの要素数は0<= n <= 16にしてください。
177 public void addChemicalCombinationRecipe(ItemStack[] material, ItemStack result){
178 if(material.length <= 16){
179 chemicalCombinationMaterials.add(material);
180 chemicalCombinationResult.add(result);
182 System.err.println("ChemiCraft内でエラー:addChemicalCombinationRecipeの引数materialの要素数が16を超えています。" + "Material:" + material + " Result:" + result);
188 public void addMaterialRecipe(ItemStack[] materials, ItemStack[] effectMaterials,ItemStack result, String[] key, Object[] value){
189 if(materials.length <= 9){
190 if(effectMaterials.length <= 3){
191 materialMaterials.add(materials);
192 materialResult.add(result);
193 materialEffectKey.add(key);
194 materialEffectValue.add(value);
196 System.err.println("ChemiCraft内でエラー:addMaterialRecipeの引数effectMaterialsの要素数が3を超えています。" + "Material:" + materials + " Result:" + result + " key" + key + " value:" + value);
199 System.err.println("ChemiCraft内でエラー:addMaterialRecipeの引数materialsの要素数が9を超えています。" + "Material:" + materials + " Result:" + result + " key" + key + " value:" + value);
202 //以下システム関連//////////////////////////////////////////////////////
204 public ArrayList<ICompoundHandler> getCompoundHandler(){
205 compoundHandlers.trimToSize();
206 return compoundHandlers;
212 public ArrayList<String> getCompoundHandlerItemName(){
213 compoundHandlerItemNames.trimToSize();
214 return compoundHandlerItemNames;
219 public ArrayList<String> getCompoundsName(){
220 compoundsNameList.trimToSize();
221 return compoundsNameList;
226 public ArrayList<String> getCompoundsLangName(){
227 compoundsLangNameList.trimToSize();
228 return compoundsLangNameList;
233 public ArrayList<String> getCompoundsLang(){
234 compoundsLangList.trimToSize();
235 return compoundsLangList;
240 public ArrayList<ItemStack> getDecompositionMaterial(){
241 return decompositionMaterial;
246 public ArrayList<ItemStack[]> getDecompositionResult(){
247 return decompositionResults;
252 public ArrayList<ItemStack[]> getChemicalCombinationMaterial(){
253 return chemicalCombinationMaterials;
258 public ArrayList<ItemStack> getChemicalCombinationResult(){
259 return chemicalCombinationResult;
264 public ChemiCraftCraftingManager getCraftingManager(){
265 return chemiCraftCraftingManager;