OSDN Git Service

修正・変更
authorponkotate <ponkotate@users.sourceforge.jp>
Sun, 31 Mar 2013 00:05:30 +0000 (09:05 +0900)
committerponkotate <ponkotate@users.sourceforge.jp>
Sun, 31 Mar 2013 00:05:30 +0000 (09:05 +0900)
・鉱石バグがあるので注意

13 files changed:
common/pcc/chemicraft/base/ChemiCraftBase.java
common/pcc/chemicraft/base/ChemiCraftBaseAPI.java
common/pcc/chemicraft/base/ChemiCraftRegisterBaseRecipe.java
common/pcc/chemicraft/base/ChemiCraftRegisterBlock.java
common/pcc/chemicraft/base/ChemiCraftRegisterChemicalRecipe.java
common/pcc/chemicraft/core/ChemiCraftAPI.java
common/pcc/chemicraft/core/ChemiCraftCore.java
common/pcc/chemicraft/core/ChemiCraftRegisterBlock.java
common/pcc/chemicraft/core/ChemiCraftRegisterCoreRecipe.java
common/pcc/chemicraft/core/ChemiCraftRegisterItem.java
common/pcc/chemicraft/core/item/ItemChemiCell.java
common/pcc/chemicraft/core/tileentity/TileEntityElectrolysisTable.java
common/pcc/chemicraft/util/AtomInfo.java

index aa483af..e6b9a4c 100644 (file)
@@ -13,6 +13,7 @@ import pcc.chemicraft.ChemiCraft;
 import pcc.chemicraft.ChemiCraftConfiguration;
 import pcc.chemicraft.ChemiCraftRegister;
 import pcc.chemicraft.base.creativetab.CreativeTabAtomOres;
+import pcc.chemicraft.base.gen.WorldGenAtomsOre;
 import pcc.chemicraft.base.system.CommonProxy;
 import pcc.chemicraft.base.system.PacketHandler;
 import pcc.chemicraft.core.ChemiCraftAPI;
@@ -28,6 +29,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
 import cpw.mods.fml.common.event.FMLPostInitializationEvent;
 import cpw.mods.fml.common.event.FMLPreInitializationEvent;
 import cpw.mods.fml.common.network.NetworkMod;
+import cpw.mods.fml.common.registry.GameRegistry;
 
 @Mod(modid = "ChemiCraftBase", name = "ChemiCraftBase", version = "beta")
 @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.4.6", channels = "chemicraftbase", packetHandler = PacketHandler.class)
@@ -200,6 +202,7 @@ public class ChemiCraftBase extends ChemiCraft
                        {
                                this.nameAuxiliary.addName(new ItemStack(blockAtomOres[i / 16], 0, i - i / 16 * 16), apiBase.getAtomOresLanguage().get(apiBase.getAtomOresName().getKeyList(i), j), apiBase.getAtomOresName().get(apiBase.getAtomOresName().getKeyList(i), j));
                                OreDictionary.registerOre("ore" + apiBase.getAtomOresName().getKeyList(i), new ItemStack(blockAtomOres[i / 16], 1, i - i / 16 * 16));
+                               GameRegistry.registerWorldGenerator(apiBase.getAtomOres().get(i));
                        }
                }
 
index 06d613d..0d1c47c 100644 (file)
@@ -5,6 +5,7 @@ import java.util.HashMap;
 
 import pcc.chemicraft.base.gen.EnumOreSpawnFrequency;
 import pcc.chemicraft.base.gen.WorldGenAtomsOre;
+import pcc.chemicraft.util.AtomInfo;
 import pcc.chemicraft.util.Formula;
 import pcc.chemicraft.util.ListHash;
 
index 491daa6..51afe5f 100644 (file)
@@ -26,17 +26,23 @@ public class ChemiCraftRegisterBaseRecipe extends ChemiCraftBaseRegister {
                /*
                 * 既存物のレシピ
                 */
-               this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.dirt), new Formula("SiI2O2"));
-               this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.sand), new Formula("SiIO"));
+               // Block
                this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.stone), new Formula("SiO2"));
-               this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.glass), new Formula("SiCO2"));
-               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.coal), new Formula("C"));
-               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreCoal), new Formula("C"));
-               this.mod.api.addElectrolysisDecompositionRecipe(new ItemStack(Item.bucketWater), new Formula("H2O"));
+               this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.dirt), new Formula("SiI2O2"));
                this.mod.api.addReversibleOfElectrolysis(new ItemStack(Block.wood), new Formula("C6H10O5"));
+               this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.glass), new Formula("SiCO2"));
                this.mod.api.addReversibleOfPyrolysis(new ItemStack(Block.tnt), new Formula("C7H5N3O6"));
-               this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.emerald), new Formula("Be3Al2Si6O18"));
+
+               // Item
+               this.mod.api.addElectrolysisDecompositionRecipe(new ItemStack(Item.bucketWater), new Formula("H2O"));
+               this.mod.api.addElectrolysisDecompositionRecipe(new ItemStack(Item.potion, 1, 0), new Formula("H2O"));
+               this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.sugar), new Formula("C12H22O11"));
+
+               // 鉱石
+               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Block.oreCoal), new Formula("C"));
+               this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(Item.coal), new Formula("C"));
                this.mod.api.addChemicalCombinationRecipe(new ItemStack(Item.diamond), new Formula("C64Si16"));
+               this.mod.api.addReversibleOfPyrolysis(new ItemStack(Item.emerald), new Formula("Be3Al2Si6O18"));
 
                /*
                 * 他Mod使用時レシピ
@@ -65,16 +71,14 @@ public class ChemiCraftRegisterBaseRecipe extends ChemiCraftBaseRegister {
                                );
 
                /*
-                * 分解台のレシピ
+                * 分解台のレシピ
                 */
-               this.mod.api.addElectrolysisDecompositionRecipe(new ItemStack(Item.potion, 1, 0), new Formula("H2O"));
-
                this.mod.api.addElectrolysisDecompositionRecipe(new ItemStack(ChemiCraftCore.instance.itemCompounds, 1, this.mod.api.getCompound("Water")),
                                new Formula("H2O"));
 
                for (int i = 0; i < this.mod.apiBase.getAtomOresName().sizeKeysList(); i++){
                        this.mod.api.addPyrolysisDecompositionRecipe(new ItemStack(this.mod.blockAtomOres[i / 16], 1, i - i / 16 * 16),
-                                       this.mod.apiBase.getAtomOresFormulas().get(this.mod.apiBase.getAtomOresName().getKeyList(i)));
+                       this.mod.apiBase.getAtomOresFormulas().get(this.mod.apiBase.getAtomOresName().getKeyList(i)));
                }
 
 
index 69315f1..0f6662b 100644 (file)
@@ -2,6 +2,7 @@ package pcc.chemicraft.base;
 
 import net.minecraft.block.Block;
 import net.minecraftforge.common.MinecraftForge;
+import pcc.chemicraft.base.gen.WorldGenAtomsOre;
 import pcc.chemicraft.base.ore.BlockAtomOres;
 import pcc.chemicraft.base.ore.ItemAtomOres;
 import cpw.mods.fml.common.registry.GameRegistry;
@@ -29,16 +30,6 @@ public class ChemiCraftRegisterBlock extends ChemiCraftBaseRegister {
                        MinecraftForge.setBlockHarvestLevel(this.mod.blockAtomOres[i], "pickaxe", 2);
                }
 
-               /*
-                * Minecraftに登録
-                */
-               
-
-               /*
-                * 名前登録
-                */
-               
-
        }
 
 }
index a4a35da..6030c7b 100644 (file)
@@ -19,11 +19,12 @@ public class ChemiCraftRegisterChemicalRecipe extends ChemiCraftBaseRegister
        {
                // 元素入手手段
 
+               // 鉱石群
                for (int i = 0; i < this.mod.chemicalData.ATOMSLIST.length; i++)
                {
                        if (AtomInfo.isSolid(i + 1) && !AtomInfo.isLanthanoid(i + 1) && !AtomInfo.isActinoid(i + 1))
                        {
-                               String var1 = ChemiCraftCore.ATOMSNAME[i] + "Ore";
+                               String var1 = ChemiCraftCore.ATOMSNAME[i] + " Ore";
                                this.mod.apiBase.addAtomOres(
                                                var1,
                                                new Formula(this.mod.chemicalData.ATOMSLIST[i]),
@@ -35,7 +36,7 @@ public class ChemiCraftRegisterChemicalRecipe extends ChemiCraftBaseRegister
 
                // ランタノイド鉱石
                this.mod.apiBase.addAtomOres(
-                               "LanthanoidOre",
+                               "Lanthanoid Ore",
                                new Formula("LaCePrNdPmSmEuGdTbDyHoErTmYbLu"),
                                this.mod.atomOresID[this.mod.apiBase.getAtomOresLastIndex()],
                                EnumOreSpawnFrequency.RARE);
@@ -44,7 +45,7 @@ public class ChemiCraftRegisterChemicalRecipe extends ChemiCraftBaseRegister
 
                // アクチノイド鉱石
                this.mod.apiBase.addAtomOres(
-                               "ActinoidOre",
+                               "Actinoid Ore",
                                new Formula("AcThPaUNpPuAmCmBkCfEsFmMdNoLr"),
                                this.mod.atomOresID[this.mod.apiBase.getAtomOresLastIndex()],
                                EnumOreSpawnFrequency.RARE);
index 49ebd56..2675206 100644 (file)
@@ -35,18 +35,6 @@ public class ChemiCraftAPI {
 
 
        /**
-        * 電池
-        */
-       private HashMap<ItemStack, Integer> chemicalCellsList = new HashMap<ItemStack, Integer>();
-
-
-       /**
-        * 電池名リスト
-        */
-       private ListHash<String, String> chemicalCellsNameListHash = new ListHash<String, String>();
-
-
-       /**
         * 化合台の原子の数のリスト
         */
        private ArrayList<Integer[]> chemicalCombinationAmounts = new ArrayList<Integer[]>();
@@ -98,6 +86,12 @@ public class ChemiCraftAPI {
 
 
        /**
+        * 電気分解燃料のリスト。
+        */
+       private HashMap<ItemStack, Integer> electrolysisFuelList = new HashMap<ItemStack, Integer>();
+
+
+       /**
         * 電気分解レシピのリスト
         */
        private HashMap<ItemStack, ItemStack[]> electrolysisRecipeList = new HashMap<ItemStack, ItemStack[]>();
@@ -140,34 +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,
-                                               1,
-                                               chemicalCellsNameListHash.sizeKeysList()),
-                                               par3OperationTime);
-               addChemicalCellLanguage(
-                               "en_US",
-                               par2Name);
-       }
-
-
-       /**
-        * 既に登録した電池の新しい名前・言語を追加します
-        * @param par1Name 英語名
-        * @param par2NewName 新しい名前
-        * @param par3Language 言語
-        */
-       public void addChemicalCellLanguage(String par1NewLanguage, String par2NewName){
-               chemicalCellsNameListHash.add(par1NewLanguage, par2NewName);
-       }
-
-
 
        /**
         * 化合レシピを追加します。materialの要素数は0<= n <= 16にしてください。
@@ -213,6 +179,19 @@ public class ChemiCraftAPI {
 
 
 
+       /**
+        * 電気分解台の燃料を追加します
+        * @param itemstack 燃料のItemStack
+        * @param burnTime 燃焼時間(tick * rate)
+        */
+       public void addElectrolysisDecompositionFuel(ItemStack itemstack, int burnTime) {
+               this.electrolysisFuelList.put(
+                               itemstack,
+                               burnTime);
+       }
+
+
+
        public void addElectrolysisDecompositionRecipe(ArrayList<ItemStack> material, Formula formula) {
                for (ItemStack item : material)
         {
@@ -370,16 +349,6 @@ public class ChemiCraftAPI {
 
 
 
-       public HashMap<ItemStack, Integer> getChemicalCellsList(){
-               return chemicalCellsList;
-       }
-
-
-       public ListHash<String, String> getChemicalCellsName(){
-               return chemicalCellsNameListHash;
-       }
-
-
        //以下システム関連//////////////////////////////////////////////////////
 
        public ArrayList<Integer[]> getChemicalCombinationAmounts(){
@@ -437,6 +406,13 @@ public class ChemiCraftAPI {
 
 
 
+       public HashMap<ItemStack, Integer> getElectrolysisFuelList()
+       {
+               return electrolysisFuelList;
+       }
+
+
+
        public HashMap<ItemStack, ItemStack[]> getElectrolysisRecipeList()
        {
                return electrolysisRecipeList;
index 501f79d..1698c16 100644 (file)
@@ -266,10 +266,6 @@ public class ChemiCraftCore extends ChemiCraft{
                // GUIを追加します
                NetworkRegistry.instance().registerGuiHandler(instance, proxy);
 
-               //電池を追加します
-               this.api.addChemicalCell(this.itemChemicalCells, "ChemicalCell", 1000);
-               this.api.addChemicalCellLanguage("ja_JP", "化学電池");
-
                this.api.addPyrolysisDecompositionFuel(new ItemStack(Item.coal), 2000*8);
        }
 
@@ -288,18 +284,6 @@ public class ChemiCraftCore extends ChemiCraft{
                        }
                }
 
-               Iterator<String> langCellItr = this.api.getChemicalCellsName().keySet().iterator();
-               while (langCellItr.hasNext()) {
-                       String langCell = langCellItr.next();
-                       ArrayList<String> names = this.api.getChemicalCellsName().get(langCell);
-                       for (int i = 0; i < names.size(); i++) {
-                               LanguageRegistry.instance().addNameForObject(
-                                               new ItemStack(this.itemChemicalCells, 1, i),
-                                               langCell,
-                                               names.get(i));
-                       }
-               }
-
        }
 
 
index 45c3988..71c449d 100644 (file)
@@ -36,11 +36,13 @@ public class ChemiCraftRegisterBlock extends ChemiCraftCoreRegister {
                                setResistance(0.0F).
                                setStepSound(Block.soundStoneFootstep).
                                setBlockName("ChemicalCombinationTable");
+               /*
                this.mod.blockToolAndWeaponCraftingTable = new BlockToolAndWeaponCraftingTable(this.mod.toolAndWeaponCraftingTableID, 3, Material.ground).
                                setHardness(2.0F).
                                setResistance(0.0F).
                                setStepSound(Block.soundStoneFootstep).
                                setBlockName("ToolAndWeaponCraftingTable");
+               */
                this.mod.blockChemicalCraftingTable = new BlockChemicalCraftingTable(this.mod.chemicalCraftingTableID, 4, Material.ground).
                                setHardness(2.0F).
                                setResistance(0.0F).
@@ -52,7 +54,7 @@ public class ChemiCraftRegisterBlock extends ChemiCraftCoreRegister {
                 */
                GameRegistry.registerBlock(this.mod.blockPyrolysisTable, "BlockPyrolysisTable");
                GameRegistry.registerBlock(this.mod.blockChemicalCombinationTable, "BlockChemicalCombinationTable");
-               GameRegistry.registerBlock(this.mod.blockToolAndWeaponCraftingTable, "BlockToolAndWeaponCraftingTable");
+               // GameRegistry.registerBlock(this.mod.blockToolAndWeaponCraftingTable, "BlockToolAndWeaponCraftingTable");
                GameRegistry.registerBlock(this.mod.blockChemicalCraftingTable, "BlockMaterialCraftingTable");
                GameRegistry.registerBlock(this.mod.blockElectrolysisTable, "BlockElectrolysisTable");
 
@@ -63,8 +65,8 @@ public class ChemiCraftRegisterBlock extends ChemiCraftCoreRegister {
                this.mod.nameAuxiliary.addName(this.mod.blockPyrolysisTable, "ja_JP", "熱分解台");
                this.mod.nameAuxiliary.addName(this.mod.blockChemicalCombinationTable, "ChemicalCombinationTable");
                this.mod.nameAuxiliary.addName(this.mod.blockChemicalCombinationTable, "ja_JP", "化合台");
-               this.mod.nameAuxiliary.addName(this.mod.blockToolAndWeaponCraftingTable, "ToolAndWeaponCraftingTable");
-               this.mod.nameAuxiliary.addName(this.mod.blockToolAndWeaponCraftingTable, "ja_JP", "ツール&武器製作台");
+               // this.mod.nameAuxiliary.addName(this.mod.blockToolAndWeaponCraftingTable, "ToolAndWeaponCraftingTable");
+               // this.mod.nameAuxiliary.addName(this.mod.blockToolAndWeaponCraftingTable, "ja_JP", "ツール&武器製作台");
                this.mod.nameAuxiliary.addName(this.mod.blockChemicalCraftingTable, "ChemicalCraftingTable");
                this.mod.nameAuxiliary.addName(this.mod.blockChemicalCraftingTable, "ja_JP", "素材製作台");
                this.mod.nameAuxiliary.addName(this.mod.blockElectrolysisTable, "ElectrolysisTable");
index f592ad4..01bb2c6 100644 (file)
@@ -36,6 +36,7 @@ public class ChemiCraftRegisterCoreRecipe extends ChemiCraftCoreRegister {
                        Character.valueOf('A'), new ItemStack(Block.obsidian),
                });
 
+               /*
                GameRegistry.addRecipe(new ItemStack(this.mod.blockToolAndWeaponCraftingTable),
                                new Object[]{
                        "XYX", "ZAZ", "ZZZ",
@@ -44,6 +45,7 @@ public class ChemiCraftRegisterCoreRecipe extends ChemiCraftCoreRegister {
                        Character.valueOf('Z'), new ItemStack(Block.stone),
                        Character.valueOf('A'), new ItemStack(Item.pickaxeSteel),
                });
+               */
 
                GameRegistry.addRecipe(new ItemStack(this.mod.blockChemicalCraftingTable),
                                new Object[]{
index 55fdb35..b7ae662 100644 (file)
@@ -38,6 +38,7 @@ public class ChemiCraftRegisterItem extends ChemiCraftCoreRegister {
                this.mod.nameAuxiliary.addName(this.mod.itemGasCollectingBottle, "ja_JP", "集気瓶");
                this.mod.nameAuxiliary.addName(this.mod.itemChemicalCells, "ChemicalCell");
                this.mod.nameAuxiliary.addName(this.mod.itemChemicalCells, "ja_JP",  "化学電池");
+               this.mod.api.addElectrolysisDecompositionFuel(new ItemStack(this.mod.itemChemicalCells), 1000);
                this.mod.nameAuxiliary.addName(this.mod.itemPear, "Pear");
                this.mod.nameAuxiliary.addName(this.mod.itemPear, "ja_JP",  "梨");
 
index e314f01..7e93c5c 100644 (file)
@@ -17,32 +17,12 @@ public class ItemChemiCell extends Item
        {
                super(par1);
                this.maxStackSize = 64;
-               this.setHasSubtypes(true);
-               this.setMaxDamage(0);
                this.setCreativeTab(ChemiCraftCore.instance.creativeTabChemiCraft);
        }
 
 
 
        @Override
-       public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List){
-               for(int type = 0; type < ChemiCraftAPI.instance().getChemicalCellsName().sizeKeysList(); type++)
-               {
-                       par3List.add(new ItemStack(par1, 1, type));
-                       this.setIconIndex(type);
-               }
-       }
-
-
-
-       @Override
-       public String getItemNameIS(ItemStack par1ItemStack){
-               return super.getItemName() + "." + ChemiCraftAPI.instance().getChemicalCellsName().getKeyList(par1ItemStack.getItemDamage());
-       }
-
-
-
-       @Override
        public String getTextureFile(){
                return ChemiCraft.ITEM_TEXTURE;
        }
index 0ae55ba..be4c866 100644 (file)
@@ -108,13 +108,13 @@ public class TileEntityElectrolysisTable extends TileEntity implements IEnergySi
                                                if (itemstackMaterial.itemID == materialItem.itemID && itemstackMaterial.getItemDamage() == materialItem.getItemDamage()) {
                                                        var1 = true;
                                                        if (this.fuelRestTime <= 0) {
-                                                               Iterator<ItemStack> itFuel = ChemiCraftAPI.instance().getChemicalCellsList().keySet().iterator();
+                                                               Iterator<ItemStack> itFuel = ChemiCraftAPI.instance().getElectrolysisFuelList().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().getChemicalCellsList().get(itemstackFuel);
+                                                                                       this.fuelRestTime = ChemiCraftAPI.instance().getElectrolysisFuelList().get(itemstackFuel);
                                                                                        if (fuelItem.stackSize > 1) {
                                                                                                this.invf.setInventorySlotContents(0, new ItemStack(fuelItem.itemID, --fuelItem.stackSize, fuelItem.getItemDamage()));
                                                                                                break;
index 3028a27..8db2250 100644 (file)
@@ -1,7 +1,9 @@
 package pcc.chemicraft.util;
 
+import net.minecraft.block.Block;
 import net.minecraft.entity.player.EntityPlayer;
 import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.LanguageRegistry;
 import cpw.mods.fml.relauncher.Side;
 import cpw.mods.fml.relauncher.SideOnly;
 
@@ -186,6 +188,12 @@ public final class AtomInfo {
 
 
 
+       public static boolean isExisting(String par1){
+               return false;
+       }
+
+
+
        /**
         * 引数に指定されたBiomeと同等か比較します
         * @param biomeName 比較するBiomeの名前