OSDN Git Service

修正・変更
[chemicraft/chemicraft.git] / common / pcc / chemicraft / ChemiCraftAPI.java
index bdddd39..6046d9f 100644 (file)
@@ -5,6 +5,7 @@ import java.util.HashMap;
 
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
+import pcc.chemicraft.gen.EnumOreSpawnFrequency;
 import pcc.chemicraft.gen.WorldGenAtomsOre;
 import pcc.chemicraft.system.ChemiCraftCraftingManager;
 import pcc.chemicraft.tileentity.TileEntityElectrolysisTable;
@@ -37,13 +38,13 @@ public class ChemiCraftAPI {
        /**
         * 鉱石別元素数リスト
         */
-       private HashMap<String, Integer[]> atomOresAmountsHash = new HashMap<String, Integer[]>();
+       private ArrayList<Integer[]> atomOresAmountsList = new ArrayList<Integer[]>();
 
 
        /**
         * 鉱石別元素リスト
         */
-       private HashMap<String, Integer[]> atomOresAtomsHash = new HashMap<String, Integer[]>();
+       private ArrayList<Integer[]> atomOresAtomsList = new ArrayList<Integer[]>();
 
 
        /**
@@ -66,15 +67,15 @@ public class ChemiCraftAPI {
 
 
        /**
-        * 電池
+        * 電池言語リスト
         */
-       private HashMap<ItemStack, Integer> chemicalCellsList = new HashMap<ItemStack, Integer>();
+       private ListHash<String, String> chemicalCellsLangListHash = new ListHash<String, String>();
 
 
        /**
-        * 電池言語リスト
+        * 電池
         */
-       private ListHash<String, String> chemicalCellsLangListHash = new ListHash<String, String>();
+       private HashMap<ItemStack, Integer> chemicalCellsList = new HashMap<ItemStack, Integer>();
 
 
        /**
@@ -177,13 +178,25 @@ public class ChemiCraftAPI {
         */
        public void addAtomOres(String par1Name, Integer[] par2Atoms, Integer[] par3Amounts, int par4Id, int par5Size, int par6Frequency, int par7PosY){
                atomOresList.add(new WorldGenAtomsOre(par4Id, getAtomOresMetaOfLastIndex(), par5Size, par6Frequency, par7PosY));
-               atomOresAtomsHash.put(par1Name, par2Atoms);
-               atomOresAmountsHash.put(par1Name, par3Amounts);
+               atomOresAtomsList.add(par2Atoms);
+               atomOresAmountsList.add(par3Amounts);
                addAtomOresLanguage(par1Name, par1Name, "en_US");
        }
 
 
 
+       public void addAtomOres(String par1Name, Integer[] par2Atoms, Integer[] par3Amounts, int par4Id, int par5Size, EnumOreSpawnFrequency par6Frequency, int par7PosY){
+               addAtomOres(par1Name, par2Atoms, par3Amounts, par4Id, par5Size, par6Frequency.getFrequency(), par7PosY);
+       }
+
+
+
+       public void addAtomOres(String par1Name, String[] par2Atoms, Integer[] par3Amounts, int par4Id, int par5Size, EnumOreSpawnFrequency par6Frequency, int par7PosY){
+               addAtomOres(par1Name, ChemiCraftData.toAtoms(par2Atoms), par3Amounts, par4Id, par5Size, par6Frequency.getFrequency(), par7PosY);
+       }
+
+
+
        public void addAtomOres(String par1Name, String[] par2Atoms, Integer[] par3Amounts, int par4Id, int par5Size, int par6Frequency, int par7PosY){
                addAtomOres(par1Name, ChemiCraftData.toAtoms(par2Atoms), par3Amounts, par4Id, par5Size, par6Frequency, par7PosY);
        }
@@ -213,6 +226,7 @@ public class ChemiCraftAPI {
        }
 
 
+
        /**
         * 既に登録した電池の新しい名前・言語を追加します
         * @param par1Name 英語名
@@ -271,6 +285,27 @@ public class ChemiCraftAPI {
 
 
 
+       public void addElectrolysisDecompositionRecipe(ItemStack material, Integer[] integers, Integer[] integers2) {
+               ItemStack[] itemstacks = new ItemStack[integers.length];
+               for (int i = 0; i < itemstacks.length; i++) {
+                       itemstacks[i] = new ItemStack(ChemiCraft.instance.itemAtoms,integers2[i], integers[i]);
+               }
+               TileEntityElectrolysisTable.addRecipe(material, itemstacks);
+       }
+
+
+       /**
+        * 素材作成台のレシピを追加します
+        * @param materials 素材
+        * @param result 結果
+        * @param nbtRecipe NBT(Nullの場合はなし)
+        */
+       public void addMaterialRecipe(ItemStack[] materials, ItemStack result, ChemicalNBTRecipe nbtRecipe){
+               materialRecipe.add(new MaterialRecipe(result, materials, nbtRecipe, false));
+       }
+
+
+
        /**
         * 分解台の燃料を追加します
         * @param itemstack 燃料のItemStack
@@ -281,6 +316,7 @@ public class ChemiCraftAPI {
        }
 
 
+
        /**
         * 分解台のレシピを追加します
         * @param material 素材
@@ -297,28 +333,6 @@ public class ChemiCraftAPI {
 
 
 
-       public void addElectrolysisDecompositionRecipe(ItemStack material, Integer[] integers, Integer[] integers2) {
-               ItemStack[] itemstacks = new ItemStack[integers.length];
-               for (int i = 0; i < itemstacks.length; i++) {
-                       itemstacks[i] = new ItemStack(ChemiCraft.instance.itemAtoms,integers2[i], integers[i]);
-               }
-               TileEntityElectrolysisTable.addRecipe(material, itemstacks);
-       }
-
-
-
-       /**
-        * 素材作成台のレシピを追加します
-        * @param materials 素材
-        * @param result 結果
-        * @param nbtRecipe NBT(Nullの場合はなし)
-        */
-       public void addMaterialRecipe(ItemStack[] materials, ItemStack result, ChemicalNBTRecipe nbtRecipe){
-               materialRecipe.add(new MaterialRecipe(result, materials, nbtRecipe, false));
-       }
-
-
-
        /**
         * 素材作成台の不定形レシピを追加します
         * @param materials 素材
@@ -362,14 +376,14 @@ public class ChemiCraftAPI {
        
        //以下システム関連//////////////////////////////////////////////////////
 
-       public HashMap<String, Integer[]> getAtomOresAmounts(){
-               return atomOresAmountsHash;
+       public ArrayList<Integer[]> getAtomOresAmounts(){
+               return atomOresAmountsList;
        }
 
 
 
-       public HashMap<String, Integer[]> getAtomOresAtoms(){
-               return atomOresAtomsHash;
+       public ArrayList<Integer[]> getAtomOresAtoms(){
+               return atomOresAtomsList;
        }
 
 
@@ -398,14 +412,14 @@ public class ChemiCraftAPI {
 
 
 
-       public HashMap<ItemStack, Integer> getChemicalCellsList(){
-               return chemicalCellsList;
+       public ListHash<String, String> getChemicalCellsLanguage(){
+               return chemicalCellsLangListHash;
        }
 
 
 
-       public ListHash<String, String> getChemicalCellsLanguage(){
-               return chemicalCellsLangListHash;
+       public HashMap<ItemStack, Integer> getChemicalCellsList(){
+               return chemicalCellsList;
        }