OSDN Git Service

鉱石追加用クラス・API等を追加or更新
[chemicraft/chemicraft.git] / common / pcc / chemicraft / ChemiCraftAPI.java
index 84a25c6..ca4ed8b 100644 (file)
@@ -4,10 +4,12 @@ import java.util.ArrayList;
 import java.util.HashMap;
 
 import net.minecraft.item.ItemStack;
+import pcc.chemicraft.gen.WorldGenAtomsOre;
 import pcc.chemicraft.system.ChemiCraftCraftingManager;
 import pcc.chemicraft.tileentity.TileEntityPyrolysisTable;
 import pcc.chemicraft.util.ChemicalNBTRecipe;
 import pcc.chemicraft.util.ICompoundHandler;
+import pcc.chemicraft.util.ListHash;
 import pcc.chemicraft.util.MaterialRecipe;
 
 
@@ -95,7 +97,7 @@ public class ChemiCraftAPI {
        /**
         * 鉱石名リスト
         */
-       private ArrayList<String> atomsOreNameList = new ArrayList<String>();
+       private ListHash<String, String> atomsOreNameListHash = new ListHash<String, String>();
 
 
        /**
@@ -105,27 +107,15 @@ public class ChemiCraftAPI {
 
 
        /**
-        * é\89±ç\9f³ã\83¡ã\82¿ã\83\87ã\83¼ã\82¿リスト
+        * é\89±ç\9f³ã\81®è¨\80èª\9eリスト
         */
-       private ArrayList<Integer> atomsOreMetaList = new ArrayList<Integer>();
+       private ListHash<String, String> atomsOreLangListHash = new ListHash<String, String>();
 
 
        /**
-        * 鉱石リスト
+        * 鉱石リスト
         */
-       private ArrayList<Integer> atomsOreSizeList = new ArrayList<Integer>();
-
-
-       /**
-        * 鉱石頻度リスト
-        */
-       private ArrayList<Integer> atomsOreFrequencyList = new ArrayList<Integer>();
-
-
-       /**
-        * 鉱石Y座標リスト
-        */
-       private ArrayList<Integer> atomsOrePosYList = new ArrayList<Integer>();
+       private ArrayList<WorldGenAtomsOre> atomsOres = new ArrayList<WorldGenAtomsOre>();
 
 
 
@@ -293,21 +283,30 @@ public class ChemiCraftAPI {
         * @param frequency 生成頻度
         * @param posY Y座標
         */
-       public void addAtomsOre(String name, int id, int size, int frequency, int posY){
-               addAtomsOre(name, id, 0, size, frequency, posY);
+       public void addAtomsOre(String par1Name, int par2Id, int par3Size, int par4Frequency, int par5PosY){
+               addAtomsOre(par1Name, par2Id, 0, par3Size, par4Frequency, par5PosY);
        }
 
 
-       public void addAtomsOre(String name, int id, int meta, int size, int frequency, int posY){
-               atomsOreNameList.add(name);
-               atomsOreIDList.add(id);
-               atomsOreMetaList.add(meta);
-               atomsOreSizeList.add(size);
-               atomsOreFrequencyList.add(frequency);
-               atomsOrePosYList.add(posY);
+       public void addAtomsOre(String par1Name, int par2Id, int par3Meta, int par4Size, int par5Frequency, int par6PosY){
+               atomsOreNameListHash.add(par1Name, par1Name);
+               atomsOreIDList.add(par2Id);
+               atomsOreLangListHash.add(par1Name, "en_US");
+               atomsOres.add(new WorldGenAtomsOre(par2Id, par3Meta, par4Size, par5Frequency, par6PosY));
        }
 
 
+       /**
+        * 既に登録した鉱石の新しい名前・言語を追加します
+        * @param par1Name 英語名
+        * @param par2NewName 新しい名前
+        * @param par3Language 言語
+        */
+       public void addAtomsOreLanguage(String par1Name, String par2NewName, String par3Language){
+               atomsOreNameListHash.add(par1Name, par2NewName);
+               atomsOreLangListHash.add(par1Name, par3Language);
+       }
+
        
        //以下システム関連//////////////////////////////////////////////////////
 
@@ -395,8 +394,8 @@ public class ChemiCraftAPI {
 
 
 
-       public ArrayList<String> getAtomsOreNameList(){
-               return atomsOreNameList;
+       public ListHash<String, String> getAtomsOreNameListHash(){
+               return atomsOreNameListHash;
        }
 
 
@@ -407,26 +406,14 @@ public class ChemiCraftAPI {
 
 
 
-       public ArrayList<Integer> getAtomsOreMetaList(){
-               return atomsOreMetaList;
-       }
-
-
-
-       public ArrayList<Integer> getAtomsOreSizeList(){
-               return atomsOreSizeList;
-       }
-
-
-
-       public ArrayList<Integer> getAtomsOreFrequencyList(){
-               return atomsOreFrequencyList;
+       public ListHash<String, String> getAtomsOreLangListHash(){
+               return atomsOreLangListHash;
        }
 
 
 
-       public ArrayList<Integer> getAtomsOrePosYList(){
-               return atomsOrePosYList;
+       public ArrayList<WorldGenAtomsOre> getAtomsOres(){
+               return atomsOres;
        }