OSDN Git Service

I with OWATA
[chemicraft/ChemiCraftNext.git] / common / pcc / chemicraft / core / ChemiCraftAPI.java
index c608bea..22f8b7a 100644 (file)
@@ -1,6 +1,7 @@
 package pcc.chemicraft.core;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 
 import net.minecraft.item.Item;
@@ -33,25 +34,6 @@ public class ChemiCraftAPI {
        }
 
 
-
-       /**
-        * 電池言語リスト
-        */
-       private ListHash<String, String> chemicalCellsLangListHash = new ListHash<String, String>();
-
-
-       /**
-        * 電池
-        */
-       private HashMap<ItemStack, Integer> chemicalCellsList = new HashMap<ItemStack, Integer>();
-
-
-       /**
-        * 電池名リスト
-        */
-       private ListHash<String, String> chemicalCellsNameListHash = new ListHash<String, String>();
-
-
        /**
         * 化合台の原子の数のリスト
         */
@@ -98,15 +80,15 @@ public class ChemiCraftAPI {
 
 
        /**
-        * List of compounds the language names.
+        * List of compounds names.
         */
-       private ListHash<String, String> compoundsLangListHash = new ListHash<String, String>();
+       private ListHash<String, String> compoundsNameListHash = new ListHash<String, String>();
 
 
        /**
-        * List of compounds names.
+        * 電気分解燃料のリスト。
         */
-       private ListHash<String, String> compoundsNameListHash = new ListHash<String, String>();
+       private HashMap<ItemStack, Integer> electrolysisFuelList = new HashMap<ItemStack, Integer>();
 
 
        /**
@@ -152,36 +134,6 @@ public class ChemiCraftAPI {
        private ArrayList<Boolean> toolAndWeaponSharpless = new ArrayList<Boolean>();
 
 
-       /**
-        * 電池を追加します
-        * @param par1Name
-        */
-       public void addChemicalCell(Item par1ChemicalCell, String par2Name, int par3OperationTime){
-               chemicalCellsList.put(
-                               new ItemStack(
-                                               par1ChemicalCell,
-                                               0,
-                                               chemicalCellsNameListHash.sizeKeysList()),
-                                               par3OperationTime);
-               addChemicalCellLanguage(
-                               par2Name,
-                               "en_US",
-                               par2Name);
-       }
-
-
-       /**
-        * 既に登録した電池の新しい名前・言語を追加します
-        * @param par1Name 英語名
-        * @param par2NewName 新しい名前
-        * @param par3Language 言語
-        */
-       public void addChemicalCellLanguage(String par1Name, String par3NewLanguage, String par2NewName){
-               chemicalCellsNameListHash.add(par1Name, par2NewName);
-               chemicalCellsLangListHash.add(par1Name, par3NewLanguage);
-       }
-
-
 
        /**
         * 化合レシピを追加します。materialの要素数は0<= n <= 16にしてください。
@@ -201,8 +153,7 @@ public class ChemiCraftAPI {
         * @param name compound name.
         */
        public void addCompound(String name){
-               compoundsNameListHash.add(name, name);
-               compoundsLangListHash.add(name, "en_US");
+               compoundsNameListHash.add("en_US", name);
                compoundHash.put(name, compoundHash.size());
        }
 
@@ -215,18 +166,28 @@ public class ChemiCraftAPI {
         */
        public void addCompound(String lang, String englishName, String langName){
                addCompound(englishName);
-               addCompoundLanguage(lang, englishName, langName);
+               addCompoundLanguage(lang, langName);
        }
 
 
 
-       public void addCompoundLanguage(String lang, String englishName, String langName){
+       public void addCompoundLanguage(String lang, String langName){
                compoundsNameListHash.add(
-                               englishName,
+                               lang,
                                langName);
-               compoundsLangListHash.add(
-                               englishName,
-                               lang);
+       }
+
+
+
+       /**
+        * 電気分解台の燃料を追加します
+        * @param itemstack 燃料のItemStack
+        * @param burnTime 燃焼時間(tick * rate)
+        */
+       public void addElectrolysisDecompositionFuel(ItemStack itemstack, int burnTime) {
+               this.electrolysisFuelList.put(
+                               itemstack,
+                               burnTime);
        }
 
 
@@ -249,8 +210,8 @@ public class ChemiCraftAPI {
                        itemstacks[i] =
                                        new ItemStack(
                                                        ChemiCraftCore.instance.itemAtoms,
-                                                       ChemiCraftData.toAtoms(formula.getAtoms()[i]),
-                                                       formula.getAmonts()[i]);
+                                                       formula.getAmonts()[i],
+                                                       ChemiCraftData.toAtoms(formula.getAtoms()[i]));
                }
                this.electrolysisRecipeList.put(
                                material,
@@ -277,6 +238,23 @@ public class ChemiCraftAPI {
 
 
        /**
+        * 素材作成台の不定形レシピを追加します
+        * @param materials 素材
+        * @param result 結果
+        * @param nbtRecipe NBT(Nullの場合はなし)
+        */
+       public void addSharplessMaterialRecipe(ItemStack[] materials, ItemStack result, ChemicalNBTRecipe nbtRecipe){
+               materialRecipe.add(
+                               new MaterialRecipe(
+                                               result,
+                                               materials,
+                                               nbtRecipe,
+                                               true));
+       }
+
+
+
+       /**
         * 電気分解台の燃料を追加します
         * @param itemstack 燃料のItemStack
         * @param burnTime 燃焼時間(tick * rate)
@@ -314,8 +292,8 @@ public class ChemiCraftAPI {
                        itemstacks[i] =
                                        new ItemStack(
                                                        ChemiCraftCore.instance.itemAtoms,
-                                                       ChemiCraftData.toAtoms(formula.getAtoms()[i]),
-                                                       formula.getAmonts()[i]);
+                                                       formula.getAmonts()[i],
+                                                       ChemiCraftData.toAtoms(formula.getAtoms()[i]));
                }
                this.pyrolysisRecipeList.put(
                                material,
@@ -346,23 +324,6 @@ public class ChemiCraftAPI {
 
 
        /**
-        * 素材作成台の不定形レシピを追加します
-        * @param materials 素材
-        * @param result 結果
-        * @param nbtRecipe NBT(Nullの場合はなし)
-        */
-       public void addSharplessMaterialRecipe(ItemStack[] materials, ItemStack result, ChemicalNBTRecipe nbtRecipe){
-               materialRecipe.add(
-                               new MaterialRecipe(
-                                               result,
-                                               materials,
-                                               nbtRecipe,
-                                               true));
-       }
-
-
-
-       /**
         * ツール&武器作成台の不定形レシピを追加します
         * @param materials 素材
         * @param result 結果
@@ -388,22 +349,6 @@ public class ChemiCraftAPI {
 
 
 
-       public ListHash<String, String> getChemicalCellsLanguage(){
-               return chemicalCellsLangListHash;
-       }
-
-
-
-       public HashMap<ItemStack, Integer> getChemicalCellsList(){
-               return chemicalCellsList;
-       }
-
-
-       public ListHash<String, String> getChemicalCellsName(){
-               return chemicalCellsNameListHash;
-       }
-
-
        //以下システム関連//////////////////////////////////////////////////////
 
        public ArrayList<Integer[]> getChemicalCombinationAmounts(){
@@ -449,12 +394,6 @@ public class ChemiCraftAPI {
 
 
 
-       public ListHash<String, String> getCompoundsLang(){
-               return compoundsLangListHash;
-       }
-
-
-
        public ListHash<String, String> getCompoundsName(){
                return compoundsNameListHash;
        }
@@ -467,6 +406,13 @@ public class ChemiCraftAPI {
 
 
 
+       public HashMap<ItemStack, Integer> getElectrolysisFuelList()
+       {
+               return electrolysisFuelList;
+       }
+
+
+
        public HashMap<ItemStack, ItemStack[]> getElectrolysisRecipeList()
        {
                return electrolysisRecipeList;