3 import java.util.ArrayList;
5 import net.minecraft.src.ItemStack;
6 import chemicraft.system.ChemiCraftCraftingManager;
7 import chemicraft.util.ICompoundHandler;
8 import chemicraft.util.NBTRecipe;
12 * 基本的にAddonはこのクラスのインスタンスを使う
16 public class ChemiCraftAPI {
19 * Instance of the ChemiCraftAPI.
21 public static ChemiCraftAPI instance = new ChemiCraftAPI();
25 * List of compounds names.
27 private ArrayList<String> compoundsNameList = new ArrayList();
31 * List of compounds names(Some kind of language).
33 private ArrayList<String> compoundsLangNameList = new ArrayList();
37 * List of compounds the language names.
39 private ArrayList<String> compoundsLangList = new ArrayList();
43 * List of compounds handlers.
45 private ArrayList<ICompoundHandler> compoundHandlers = new ArrayList<ICompoundHandler>();
49 * List of item name of handler to compounds.
51 private ArrayList<String> compoundHandlerItemNames = new ArrayList<String>();
57 private ArrayList<ItemStack> decompositionMaterial = new ArrayList<ItemStack>();
63 private ArrayList<ItemStack[]> decompositionResults = new ArrayList<ItemStack[]>();
69 private ArrayList<ItemStack[]> chemicalCombinationMaterials = new ArrayList<ItemStack[]>();
75 private ArrayList<ItemStack> chemicalCombinationResult = new ArrayList<ItemStack>();
82 private ArrayList<ItemStack[]> materialEffectMaterials = new ArrayList<ItemStack[]>();
89 private ArrayList<ItemStack[]> materialMaterials = new ArrayList<ItemStack[]>();
96 private ArrayList<ItemStack> materialResult = new ArrayList<ItemStack>();
101 * 素材製作台の効果付属用のNBTRecipeのリスト
103 private ArrayList<NBTRecipe> materialNBT = new ArrayList<NBTRecipe>();
108 * ChemiCraftの化学作業台類のレシピのマネージャー
110 private ChemiCraftCraftingManager chemiCraftCraftingManager = new ChemiCraftCraftingManager();
116 * @param name compound name.
118 public void addCompound(String name){
119 compoundsNameList.add(name);
120 compoundsLangNameList.add("");
121 compoundsLangList.add("");
127 * add compound corresponding to the language.
128 * @param lang Language to the corresponding
129 * @param englishName compound name
130 * @param langName compound name(specified language)
132 public void addLangCompound(String lang, String englishName, String langName){
133 compoundsNameList.add(englishName);
134 compoundsLangNameList.add(langName);
135 compoundsLangList.add(lang);
141 * setting compound handler.
142 * @param handlerItemName
143 * @param compoundHandler
145 public void settingCompoundHandler(String handlerItemName, ICompoundHandler compoundHandler){
146 compoundHandlers.add(compoundHandler);
147 compoundHandlerItemNames.add(handlerItemName);
153 * 分解レシピを追加します。resultの要素数は0<= n <= 16にしてください。
157 public void addDecompositionRecipe(ItemStack material, ItemStack[] result){
158 if(result.length <= 16){
159 decompositionMaterial.add(material);
160 decompositionResults.add(result);
162 System.err.println("ChemiCraft内でエラー:addDecompositionRecipeの引数resultの要素数が16を超えています。" + "Material:" + material + " Result:" + result);
169 * 化合レシピを追加します。materialの要素数は0<= n <= 16にしてください。
173 public void addChemicalCombinationRecipe(ItemStack[] material, ItemStack result){
174 if(material.length <= 16){
175 chemicalCombinationMaterials.add(material);
176 chemicalCombinationResult.add(result);
178 System.err.println("ChemiCraft内でエラー:addChemicalCombinationRecipeの引数materialの要素数が16を超えています。" + "Material:" + material + " Result:" + result);
184 public void addMaterialRecipe(ItemStack[] materials, ItemStack result, NBTRecipe nbtRecipe){
185 if(materials.length <= 9){
186 materialMaterials.add(materials);
187 materialResult.add(result);
188 materialNBT.add(nbtRecipe);
190 System.err.println("ChemiCraft内でエラー:addMaterialRecipeの引数materialsの要素数が9を超えています。" + "Material:" + materials + " Result:" + result);
193 //以下システム関連//////////////////////////////////////////////////////
195 public ArrayList<ICompoundHandler> getCompoundHandler(){
196 compoundHandlers.trimToSize();
197 return compoundHandlers;
203 public ArrayList<String> getCompoundHandlerItemName(){
204 compoundHandlerItemNames.trimToSize();
205 return compoundHandlerItemNames;
210 public ArrayList<String> getCompoundsName(){
211 compoundsNameList.trimToSize();
212 return compoundsNameList;
217 public ArrayList<String> getCompoundsLangName(){
218 compoundsLangNameList.trimToSize();
219 return compoundsLangNameList;
224 public ArrayList<String> getCompoundsLang(){
225 compoundsLangList.trimToSize();
226 return compoundsLangList;
231 public ArrayList<ItemStack> getDecompositionMaterial(){
232 return decompositionMaterial;
237 public ArrayList<ItemStack[]> getDecompositionResult(){
238 return decompositionResults;
243 public ArrayList<ItemStack[]> getChemicalCombinationMaterial(){
244 return chemicalCombinationMaterials;
249 public ArrayList<ItemStack> getChemicalCombinationResult(){
250 return chemicalCombinationResult;
255 public ArrayList<ItemStack[]> getMaterialMaterials(){
256 return materialMaterials;
261 public ArrayList<ItemStack> getMaterialResult(){
262 return materialResult;
267 public ArrayList<NBTRecipe> getMaterialNBTRecipe(){
273 public ChemiCraftCraftingManager getCraftingManager(){
274 return chemiCraftCraftingManager;