OSDN Git Service

Merge branch 'master' of https://scm.sourceforge.jp/gitroot/chemicraft/chemicraft
authorponkotate <ponkotate@users.sourceforge.jp>
Sat, 9 Mar 2013 01:38:21 +0000 (10:38 +0900)
committerponkotate <ponkotate@users.sourceforge.jp>
Sat, 9 Mar 2013 01:38:21 +0000 (10:38 +0900)
Conflicts:
common/pcc/chemicraft/ChemiCraftAPI.java

common/pcc/chemicraft/ChemiCraft.java
common/pcc/chemicraft/ChemiCraftAPI.java
common/pcc/chemicraft/gen/EnumOreSpawnFrequency.java
common/pcc/chemicraft/item/ItemDust.java
resources/pcc/chemicraft/entityParticles/dust.png [new file with mode: 0644]

index 2c22393..ff38197 100644 (file)
@@ -536,11 +536,6 @@ public class ChemiCraft implements Runnable {
                                250,
                                5,
                                true);
-               /*
-               EntityRegistry.registerGlobalEntityID(EntityDust.class,
-                               "Dust",
-                               ModLoader.getUniqueEntityId());
-                               */
 
                this.api.addPyrolysisDecompositionFuel(new ItemStack(Item.coal), 2000*8);
        }
index 6046d9f..b1285d8 100644 (file)
@@ -38,13 +38,13 @@ public class ChemiCraftAPI {
        /**
         * 鉱石別元素数リスト
         */
-       private ArrayList<Integer[]> atomOresAmountsList = new ArrayList<Integer[]>();
+       private HashMap<String, Integer[]> atomOresAmountsHash = new HashMap<String, Integer[]>();
 
 
        /**
         * 鉱石別元素リスト
         */
-       private ArrayList<Integer[]> atomOresAtomsList = new ArrayList<Integer[]>();
+       private HashMap<String, Integer[]> atomOresAtomsHash = new HashMap<String, Integer[]>();
 
 
        /**
@@ -67,15 +67,15 @@ public class ChemiCraftAPI {
 
 
        /**
-        * 電池言語リスト
+        * 電池
         */
-       private ListHash<String, String> chemicalCellsLangListHash = new ListHash<String, String>();
+       private HashMap<ItemStack, Integer> chemicalCellsList = new HashMap<ItemStack, Integer>();
 
 
        /**
-        * 電池
+        * 電池言語リスト
         */
-       private HashMap<ItemStack, Integer> chemicalCellsList = new HashMap<ItemStack, Integer>();
+       private ListHash<String, String> chemicalCellsLangListHash = new ListHash<String, String>();
 
 
        /**
@@ -177,28 +177,62 @@ public class ChemiCraftAPI {
         * @param par7PosY Y座標
         */
        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));
-               atomOresAtomsList.add(par2Atoms);
-               atomOresAmountsList.add(par3Amounts);
+               atomOresList.add(
+                               new WorldGenAtomsOre(
+                                               par4Id,
+                                               getAtomOresMetaOfLastIndex(),
+                                               par5Size,
+                                               par6Frequency,
+                                               par7PosY));
+               atomOresAtomsHash.put(par1Name, par2Atoms);
+               atomOresAmountsHash.put(par1Name, 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);
+       /**
+        * 鉱石を追加します
+        * @param par1Name 鉱石名
+        * @param par2Atoms 元素
+        * @param par3Amounts 元素数
+        * @param par4Id ID
+        * @param par5Size 量
+        * @param par6Frequency 頻度
+        * @param par7PosY Y座標
+        */
+       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);
        }
 
 
 
-       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);
+       /**
+        * 鉱石を追加します
+        * @param par1Name 鉱石名
+        * @param par2Atoms 元素
+        * @param par3Amounts 元素数
+        * @param par4Id ID
+        * @param par5Size 量
+        * @param par6Frequency 頻度
+        * @param par7PosY Y座標
+        */
+       public void addAtomOres(String par1Name, String[] par2Atoms, Integer[] par3Amounts, int par4Id, int par5Size, EnumOreSpawnFrequency par6Enum){
+               addAtomOres(
+                               par1Name,
+                               ChemiCraftData.toAtoms(par2Atoms),
+                               par3Amounts,
+                               par4Id,
+                               par5Size,
+                               par6Enum.getFrequency(),
+                               par6Enum.getPosY());
        }
 
 
@@ -210,8 +244,10 @@ public class ChemiCraftAPI {
         * @param par3Language 言語
         */
        public void addAtomOresLanguage(String par1Name, String par2NewName, String par3Language){
-               atomOresNameListHash.add(par1Name, par2NewName);
-               atomOresLangListHash.add(par1Name, par3Language);
+               atomOresNameListHash.add(par1Name,
+                               par2NewName);
+               atomOresLangListHash.add(par1Name,
+                               par3Language);
        }
 
 
@@ -221,12 +257,19 @@ public class ChemiCraftAPI {
         * @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);
+               chemicalCellsList.put(
+                               new ItemStack(
+                                               par1ChemicalCell,
+                                               0,
+                                               chemicalCellsNameListHash.sizeKeysList()),
+                                               par3OperationTime);
+               addChemicalCellLanguage(
+                               par2Name,
+                               "en_US",
+                               par2Name);
        }
 
 
-
        /**
         * 既に登録した電池の新しい名前・言語を追加します
         * @param par1Name 英語名
@@ -279,29 +322,12 @@ public class ChemiCraftAPI {
 
 
        public void addCompoundLanguage(String lang, String englishName, String langName){
-               compoundsNameListHash.add(englishName, langName);
-               compoundsLangListHash.add(englishName, lang);
-       }
-
-
-
-       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));
+               compoundsNameListHash.add(
+                               englishName,
+                               langName);
+               compoundsLangListHash.add(
+                               englishName,
+                               lang);
        }
 
 
@@ -312,11 +338,12 @@ public class ChemiCraftAPI {
         * @param burnTime 燃焼時間(tick * rate)
         */
        public void addPyrolysisDecompositionFuel(ItemStack itemstack, int burnTime) {
-               TileEntityPyrolysisTable.addFuel(itemstack, burnTime);
+               TileEntityPyrolysisTable.addFuel(
+                               itemstack,
+                               burnTime);
        }
 
 
-
        /**
         * 分解台のレシピを追加します
         * @param material 素材
@@ -324,11 +351,52 @@ public class ChemiCraftAPI {
         * @param integers2 原子のできる数の配列
         */
        public void addPyrolysisDecompositionRecipe(ItemStack material, Integer[] integers, Integer[] integers2) {
-               ItemStack[] itemstacks = new ItemStack[integers.length];
+               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]);
+               }
+               TileEntityPyrolysisTable.addRecipe(
+                               material,
+                               itemstacks);
+       }
+
+
+
+       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]);
+                       itemstacks[i] =
+                                       new ItemStack(
+                                                       ChemiCraft.instance.itemAtoms,
+                                                       integers2[i],
+                                                       integers[i]);
                }
-               TileEntityPyrolysisTable.addRecipe(material, itemstacks);
+               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));
        }
 
 
@@ -340,7 +408,12 @@ public class ChemiCraftAPI {
         * @param nbtRecipe NBT(Nullの場合はなし)
         */
        public void addSharplessMaterialRecipe(ItemStack[] materials, ItemStack result, ChemicalNBTRecipe nbtRecipe){
-               materialRecipe.add(new MaterialRecipe(result, materials, nbtRecipe, true));
+               materialRecipe.add(
+                               new MaterialRecipe(
+                                               result,
+                                               materials,
+                                               nbtRecipe,
+                                               true));
        }
 
 
@@ -373,17 +446,17 @@ public class ChemiCraftAPI {
                return atomOresList;
        }
 
-       
+
        //以下システム関連//////////////////////////////////////////////////////
 
-       public ArrayList<Integer[]> getAtomOresAmounts(){
-               return atomOresAmountsList;
+       public HashMap<String, Integer[]> getAtomOresAmounts(){
+               return atomOresAmountsHash;
        }
 
 
 
-       public ArrayList<Integer[]> getAtomOresAtoms(){
-               return atomOresAtomsList;
+       public HashMap<String, Integer[]> getAtomOresAtoms(){
+               return atomOresAtomsHash;
        }
 
 
@@ -412,14 +485,14 @@ public class ChemiCraftAPI {
 
 
 
-       public ListHash<String, String> getChemicalCellsLanguage(){
-               return chemicalCellsLangListHash;
+       public HashMap<ItemStack, Integer> getChemicalCellsList(){
+               return chemicalCellsList;
        }
 
 
 
-       public HashMap<ItemStack, Integer> getChemicalCellsList(){
-               return chemicalCellsList;
+       public ListHash<String, String> getChemicalCellsLanguage(){
+               return chemicalCellsLangListHash;
        }
 
 
index 7947a7d..ae99dbd 100644 (file)
@@ -6,23 +6,29 @@ package pcc.chemicraft.gen;
  */
 public enum EnumOreSpawnFrequency {
 
-       HIGH(10),
-       NORMAL(5),
-       LOW(3),
-       RARE(1);
-       
+       HIGH(10, 256),
+       NORMAL(5, 64),
+       LOW(3, 30),
+       RARE(1, 15);
+
        /**
         * 鉱石の生成頻度
         */
        private short frequency;
-       
+
+       /**
+        * 鉱石の生成最高高度
+        */
+       private short posY;
+
        /**
         * @param par1 鉱石の生成頻度
         */
-       private EnumOreSpawnFrequency(int par1) {
+       private EnumOreSpawnFrequency(int par1, int par2) {
                this.frequency = (short) par1;
+               this.posY = (short) par2;
        }
-       
+
        /**
         * 鉱石の生成頻度を返します
         * @return 鉱石の生成頻度
@@ -30,5 +36,14 @@ public enum EnumOreSpawnFrequency {
        public short getFrequency() {
                return this.frequency;
        }
-       
+
+       /**
+        * 鉱石の生成最高高度を変えします
+        * @return 鉱石の生成最高高度
+        */
+       public short getPosY() {
+               return this.posY;
+       }
+
+
 }
index 6a0cd3b..9b17cac 100644 (file)
@@ -18,12 +18,17 @@ public class ItemDust extends Item {
        @Override
        public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
                        EntityPlayer par3EntityPlayer) {
-               par2World.spawnEntityInWorld(new EntityDust(par2World,
-                               par3EntityPlayer.posX,
-                               par3EntityPlayer.posY,
-                               par3EntityPlayer.posZ));
+
+
+               if (!par2World.isRemote) {
+                       par2World.spawnEntityInWorld(new EntityDust(par2World,
+                                       par3EntityPlayer.posX,
+                                       par3EntityPlayer.posY,
+                                       par3EntityPlayer.posZ));
+                       par1ItemStack.stackSize--;
+               }
                return par1ItemStack;
        }
 
-       
+
 }
diff --git a/resources/pcc/chemicraft/entityParticles/dust.png b/resources/pcc/chemicraft/entityParticles/dust.png
new file mode 100644 (file)
index 0000000..58404a8
Binary files /dev/null and b/resources/pcc/chemicraft/entityParticles/dust.png differ