OSDN Git Service

修正・変更
authorponkotate <ponkotate@users.sourceforge.jp>
Sat, 2 Mar 2013 10:01:36 +0000 (19:01 +0900)
committerponkotate <ponkotate@users.sourceforge.jp>
Sat, 2 Mar 2013 10:01:36 +0000 (19:01 +0900)
・電解台
・鉱石の仕様変更

common/pcc/chemicraft/ChemiCraft.java
common/pcc/chemicraft/ChemiCraftAPI.java
common/pcc/chemicraft/system/CommonProxy.java
common/pcc/chemicraft/tileentity/TileEntityElectrolysisTable.java
common/pcc/chemicraft/util/ListHash.java
resources/pcc/chemicraft/items/items.png

index b8f54cc..9da513f 100644 (file)
@@ -277,7 +277,7 @@ public class ChemiCraft {
                this.itemCompounds = new ItemCompounds(this.compoundsID).setItemName("compounds");
                this.itemGasCollectingBottle = new ItemGasCollectingBottle(this.gasCollectingBottleID).setItemName("gasCollectingBottle").setIconIndex(0);
                this.itemAtomGrenade = new ItemAtomsGrenade(this.atomGrenadeID).setItemName("grenade").setIconIndex(1);
-               this.itemChemicalCells = new ItemChemiCell(this.chemicalCellsID).setItemName("chemiCell");
+               this.itemChemicalCells = new ItemChemiCell(this.chemicalCellsID).setItemName("chemiCell").setIconIndex(3);
 
                // BlockをMinecraftに登録します
                GameRegistry.registerBlock(this.blockPyrolysisTable, "BlockPyrolysisTable");
@@ -366,10 +366,6 @@ public class ChemiCraft {
                api.addAtomOresLanguage("Spodumene", "リチア輝石", "ja_JP");
 
                // ベリリウム
-               api.addAtomsOre("Beryl", this.atomsOreID[api.getAtomsOreIndex()], 5, 20, 50); // Be3Al2Si6O18
-               api.addAtomsOreLanguage("Beryl", "緑柱石", "ja_JP");
-               api.addAtomsOre("Chrysoberyl", this.atomsOreID[api.getAtomsOreIndex()], 5, 200, 50); // BeAl2O4
-               api.addAtomsOreLanguage("Chrysoberyl", "金緑石", "ja_JP");
                api.addAtomOres("Beryl", new String[]{"Be", "Al", "Si", "O"}, new Integer[]{3, 2, 6, 18}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Be3Al2Si6O18
                api.addAtomOresLanguage("Beryl", "緑柱石", "ja_JP");
                api.addAtomOres("Chrysoberyl", new String[]{"Be", "Al", "O"}, new Integer[]{1, 2, 4}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // BeAl2O4
@@ -442,6 +438,21 @@ public class ChemiCraft {
                this.api.addChemicalCombinationRecipe(new String[]{"H", "O", "Cl"}, new Integer[]{1, 2, 1}, new ItemStack(this.itemCompounds, 1, this.api.getCompound("ChlorousAcid")));
                this.api.addChemicalCombinationRecipe(new String[]{"H", "O"}, new Integer[]{2, 1}, new ItemStack(this.itemCompounds, 1, this.api.getCompound("Water")));
 
+               //化学電池の追加
+               this.api.addMaterialRecipe(new ItemStack[] {
+                               null,
+                               null,
+                               null,
+                               new ItemStack(this.itemAtoms, 1, ChemiCraftData.ZINC),
+                               null,
+                               new ItemStack(this.itemAtoms, 1, ChemiCraftData.COPPER),
+                               new ItemStack(Item.bucketWater),
+                               new ItemStack(Item.bucketWater),
+                               new ItemStack(Item.bucketWater),
+               }, 
+               new ItemStack(this.itemChemicalCells, 1, 0), 
+               null);
+
                //手榴弾の追加
                this.api.addMaterialRecipe(new ItemStack[] {
                                null,
@@ -458,21 +469,21 @@ public class ChemiCraft {
                new NBTRecipeGrenade()
                                );
 
-               this.api.addDecompositionRecipe(new ItemStack(Item.potion, 1, 0),
+               this.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.potion, 1, 0),
                                new Integer[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},
                                new Integer[] {2, 1});
 
-               this.api.addDecompositionRecipe(new ItemStack(this.itemCompounds, 1, this.api.getCompound("Water")),
+               this.api.addPyrolysisDecompositionRecipe(new ItemStack(this.itemCompounds, 1, this.api.getCompound("Water")),
                                new Integer[] {ChemiCraftData.HYDROGEN, ChemiCraftData.OXYGEN},
                                new Integer[] {2, 1});
 
                for (int i = 0; i < api.getAtomOresName().sizeKeysList(); i++){
-                       this.api.addDecompositionRecipe(new ItemStack(this.blockAtomOres[i / 16], 1, i - i / 16 * 16),
+                       this.api.addPyrolysisDecompositionRecipe(new ItemStack(this.blockAtomOres[i / 16], 1, i - i / 16 * 16),
                                        api.getAtomOresAtoms().get(api.getAtomOresName().getKeyList(i)),
                                        api.getAtomOresAmounts().get(api.getAtomOresName().getKeyList(i)));
                }
 
-               this.api.addDecompositionFuel(new ItemStack(Item.coal), 2000*8);
+               this.api.addPyrolysisDecompositionFuel(new ItemStack(Item.coal), 2000*8);
        }
 
        private void apiProcessing(final FMLPostInitializationEvent event) {
index 821bb97..bdddd39 100644 (file)
@@ -7,6 +7,7 @@ import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
 import pcc.chemicraft.gen.WorldGenAtomsOre;
 import pcc.chemicraft.system.ChemiCraftCraftingManager;
+import pcc.chemicraft.tileentity.TileEntityElectrolysisTable;
 import pcc.chemicraft.tileentity.TileEntityPyrolysisTable;
 import pcc.chemicraft.util.ChemicalNBTRecipe;
 import pcc.chemicraft.util.ICompoundHandler;
@@ -65,6 +66,12 @@ public class ChemiCraftAPI {
 
 
        /**
+        * 電池
+        */
+       private HashMap<ItemStack, Integer> chemicalCellsList = new HashMap<ItemStack, Integer>();
+
+
+       /**
         * 電池言語リスト
         */
        private ListHash<String, String> chemicalCellsLangListHash = new ListHash<String, String>();
@@ -76,9 +83,6 @@ public class ChemiCraftAPI {
        private ListHash<String, String> chemicalCellsNameListHash = new ListHash<String, String>();
 
 
-       private HashMap<ItemStack, Integer> chemicalCellsFuelList = new HashMap<ItemStack, Integer>();
-
-
 
        /**
         * 化合台の原子の数のリスト
@@ -181,7 +185,7 @@ public class ChemiCraftAPI {
 
 
        public void addAtomOres(String par1Name, String[] par2Atoms, Integer[] par3Amounts, int par4Id, int par5Size, int par6Frequency, int par7PosY){
-               addAtomOres(par1Name, ChemiCraftData.toAtoms(par2Atoms), par3Amounts, par7PosY, par7PosY, par7PosY, par7PosY);
+               addAtomOres(par1Name, ChemiCraftData.toAtoms(par2Atoms), par3Amounts, par4Id, par5Size, par6Frequency, par7PosY);
        }
 
 
@@ -204,7 +208,7 @@ public class ChemiCraftAPI {
         * @param par1Name
         */
        public void addChemicalCell(Item par1ChemicalCell, String par2Name, int par3OperationTime){
-               chemicalCellsFuelList.put(new ItemStack(par1ChemicalCell, 0, chemicalCellsNameListHash.sizeKeysList()), par3OperationTime);
+               chemicalCellsList.put(new ItemStack(par1ChemicalCell, 0, chemicalCellsNameListHash.sizeKeysList()), par3OperationTime);
                addChemicalCellLanguage(par2Name, "en_US", par2Name);
        }
 
@@ -272,7 +276,7 @@ public class ChemiCraftAPI {
         * @param itemstack 燃料のItemStack
         * @param burnTime 燃焼時間(tick * rate)
         */
-       public void addDecompositionFuel(ItemStack itemstack, int burnTime) {
+       public void addPyrolysisDecompositionFuel(ItemStack itemstack, int burnTime) {
                TileEntityPyrolysisTable.addFuel(itemstack, burnTime);
        }
 
@@ -283,7 +287,7 @@ public class ChemiCraftAPI {
         * @param integers 原子の元素番号の配列
         * @param integers2 原子のできる数の配列
         */
-       public void addDecompositionRecipe(ItemStack material, Integer[] integers, Integer[] integers2) {
+       public void addPyrolysisDecompositionRecipe(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]);
@@ -293,6 +297,16 @@ 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 素材
@@ -384,8 +398,8 @@ public class ChemiCraftAPI {
 
 
 
-       public HashMap<ItemStack, Integer> getChemicalCellsFuelList(){
-               return chemicalCellsFuelList;
+       public HashMap<ItemStack, Integer> getChemicalCellsList(){
+               return chemicalCellsList;
        }
 
 
index 00e2277..728a4a5 100644 (file)
@@ -5,11 +5,13 @@ import net.minecraft.tileentity.TileEntity;
 import net.minecraft.world.World;
 import pcc.chemicraft.container.ContainerChemicalCombinationTable;
 import pcc.chemicraft.container.ContainerChemicalCraftingTable;
+import pcc.chemicraft.container.ContainerElectrolysisTable;
 import pcc.chemicraft.container.ContainerPyrolysisTable;
 import pcc.chemicraft.container.ContainerToolAndWeaponCraftingTable;
 import pcc.chemicraft.debug.DebugTick;
 import pcc.chemicraft.tileentity.TileEntityChemicalCombinationTable;
 import pcc.chemicraft.tileentity.TileEntityChemicalCraftingTable;
+import pcc.chemicraft.tileentity.TileEntityElectrolysisTable;
 import pcc.chemicraft.tileentity.TileEntityPyrolysisTable;
 import pcc.chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
 import cpw.mods.fml.common.network.IGuiHandler;
@@ -34,6 +36,8 @@ public class CommonProxy implements IGuiHandler {
                TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
                if (tileEntity instanceof TileEntityPyrolysisTable) {
                        return new ContainerPyrolysisTable(player, (TileEntityPyrolysisTable) tileEntity);
+               }else if(tileEntity instanceof TileEntityElectrolysisTable){
+                       return new ContainerElectrolysisTable(player, (TileEntityElectrolysisTable) tileEntity);
                }else if(tileEntity instanceof TileEntityChemicalCombinationTable){
                        return new ContainerChemicalCombinationTable(player, (TileEntityChemicalCombinationTable) tileEntity);
                }else if(tileEntity instanceof TileEntityToolAndWeaponCraftingTable){
index 70a78ce..41a6dc5 100644 (file)
@@ -74,33 +74,6 @@ public class TileEntityElectrolysisTable extends TileEntity
        @Override
        public void updateEntity()
        {
-               boolean var1 = this.worldObj.canBlockSeeTheSky(xCoord, yCoord + 1, zCoord);
-               if (this.worldObj.getBlockId(xCoord, yCoord-1, zCoord) == Block.fire.blockID) {
-                       if (this.heat < 1700) {
-                               if (this.worldObj.isRaining() && var1 && !this.worldObj.isThundering()) {
-                                       this.heat += 0.1F;
-                               } else if (this.worldObj.isThundering() && var1) {
-                                       this.heat += 0.25F;
-                               } else {
-                                       this.heat += 0.5F;
-                               }
-                       } else {
-                               this.heat = 1700;
-                       }
-               } else {
-                       if (this.heat > 0) {
-                               if(this.worldObj.isRaining() && var1 && !this.worldObj.isThundering()) {
-                                       this.heat -= 0.25F;
-                               } else if(this.worldObj.isThundering() && var1) {
-                                       this.heat -= 0.5F;
-                               } else {
-                                       this.heat -= 0.05F;
-                               }
-                       } else {
-                               this.heat = 0;
-                       }
-               }
-
                if (this.fuelRestTime >= 0) {
                        this.burnTime += 10 * CENTER_HEAT / this.heat;
                        this.fuelRestTime -= 10 * CENTER_HEAT / this.heat;
@@ -113,7 +86,6 @@ public class TileEntityElectrolysisTable extends TileEntity
                                ItemStack materialItem = this.invm.getStackInSlot(0);
                                if (materialItem != null) {
                                        if (this.isInItemCheck(itemstackMaterial)) {
-                                               //var2 = true;
                                                if (itemstackMaterial.itemID == materialItem.itemID && itemstackMaterial.getItemDamage() == materialItem.getItemDamage()) {
                                                        this.inItem(itemstackMaterial);
                                                        if (materialItem.stackSize > 1) {
@@ -129,7 +101,7 @@ public class TileEntityElectrolysisTable extends TileEntity
                        this.burnTime = 0;
                }
 
-               boolean var3 = false;
+               boolean var1 = false;
                if (this.heat > MIN_HEAT) {
                        Iterator<ItemStack> itMaterial = recipeList.keySet().iterator();
                        while (itMaterial.hasNext()) {
@@ -137,17 +109,16 @@ public class TileEntityElectrolysisTable extends TileEntity
                                ItemStack materialItem = this.invm.getStackInSlot(0);
                                if (materialItem != null) {
                                        if (this.isInItemCheck(itemstackMaterial)) {
-                                               //var2 = true;
                                                if (itemstackMaterial.itemID == materialItem.itemID && itemstackMaterial.getItemDamage() == materialItem.getItemDamage()) {
-                                                       var3 = true;
+                                                       var1 = true;
                                                        if (this.fuelRestTime <= 0) {
-                                                               Iterator<ItemStack> itFuel = ChemiCraftAPI.instance().getChemicalCellsFuelList().keySet().iterator();
+                                                               Iterator<ItemStack> itFuel = ChemiCraftAPI.instance().getChemicalCellsList().keySet().iterator();
                                                                while (itFuel.hasNext()) {
                                                                        ItemStack itemstackFuel = itFuel.next();
                                                                        ItemStack fuelItem = this.invf.getStackInSlot(0);
                                                                        if (fuelItem != null) {
                                                                                if (itemstackFuel.itemID == fuelItem.itemID && itemstackFuel.getItemDamage() == fuelItem.getItemDamage()) {
-                                                                                       this.fuelRestTime = ChemiCraftAPI.instance().getChemicalCellsFuelList().get(itemstackFuel);
+                                                                                       this.fuelRestTime = ChemiCraftAPI.instance().getChemicalCellsList().get(itemstackFuel);
                                                                                        if (fuelItem.stackSize > 1) {
                                                                                                this.invf.setInventorySlotContents(0, new ItemStack(fuelItem.itemID, --fuelItem.stackSize, fuelItem.getItemDamage()));
                                                                                                break;
@@ -163,10 +134,9 @@ public class TileEntityElectrolysisTable extends TileEntity
                                        }
                                } else {
                                        this.burnTime = 0;
-                                       //var2 = false;
                                }
                        }
-                       if (!var3) {
+                       if (!var1) {
                                this.burnTime = 0;
                        }
                }
@@ -472,4 +442,8 @@ public class TileEntityElectrolysisTable extends TileEntity
                }
        }
 
+       public static void addRecipe(ItemStack material, ItemStack[] result) {
+               recipeList.put(material, result);
+       }
+
 }
index 04f9fb1..9040d1f 100644 (file)
@@ -9,31 +9,11 @@ import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
 
-/**
- * ListHashは型Kに対応したArrayListに型Eを追加する機能を提供します。<br>
- *
- * このクラスを作成すると、まず<br>
- * <pre>
- * HashMap&lt;K, ArrayList&lt;E&gt;&gt;
- * </pre>
- * が生成されます。<br>
- * 型KはHashMapやTreeMapを使った時とように使用します。<br>
- * 型EはArrayListの型を指定します。<br>
- * <br>
- * <h2>構造解説:</h2>
- * HashMapの型VがArrayListになっており、ArrayListの型Eがこのクラスの型Eになります。<br>
- * HashMapでは型Vを値として入れなければいけませんが、ListHashではこのクラスの型EをArrayListに入れることができます。<br>
- *
- * @author mozipi
- *
- * @param <K> Key
- * @param <E> Element
- */
 public class ListHash<K, E>
 {
    /**
     * @author Ponkotate version:1.0.0 dev
-    *
+    * 
     *         Create ArrayList in HashMap.
     */
 
index 39484a5..3ec284e 100644 (file)
Binary files a/resources/pcc/chemicraft/items/items.png and b/resources/pcc/chemicraft/items/items.png differ