OSDN Git Service

tc
[chemicraft/chemicraft.git] / common / pcc / chemicraft / core / ChemiCraftCore.java
index eaddef1..e062d58 100644 (file)
@@ -5,6 +5,7 @@ import java.util.Iterator;
 import java.util.List;
 
 import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
 import net.minecraft.creativetab.CreativeTabs;
 import net.minecraft.item.Item;
 import net.minecraft.item.ItemStack;
@@ -166,7 +167,7 @@ public class ChemiCraftCore extends ChemiCraft{
                Property coreItemID = cfg.get("ItemID", "Base of Item ID", 25000);
 
                ChemiCraftConfiguration ccfgBlock = new ChemiCraftConfiguration(coreBlockID.getInt());
-               ChemiCraftConfiguration ccfgItem = new ChemiCraftConfiguration(coreBlockID.getInt());
+               ChemiCraftConfiguration ccfgItem = new ChemiCraftConfiguration(coreItemID.getInt());
 
                this.pyrolysisTableID = ccfgBlock.additionID();
                this.electrolysisTableID = ccfgBlock.additionID();
@@ -178,6 +179,7 @@ public class ChemiCraftCore extends ChemiCraft{
                this.compoundsID = ccfgItem.additionID();
                this.gasCollectingBottleID = ccfgItem.additionID();
                this.chemicalCellsID = ccfgItem.additionID();
+               this.pearID = ccfgItem.additionID();
 
                Property guiPyrolysisTableIDProp = cfg.get("GUI", "GUIPyrolysisID", 1000);
                Property guiElectrolysisTableIDProp = cfg.get("GUI", "GUIElectrolysisTableIDProp", 1001);
@@ -242,6 +244,7 @@ public class ChemiCraftCore extends ChemiCraft{
                                        ModState finalModState = Loader.instance().getModState(finalMod);
                                        if (finalModState == ModState.AVAILABLE) {
                                                apiProcessing((FMLInitializationEvent) event);
+                                               break;
                                        }
                                }
                        }
@@ -263,7 +266,7 @@ public class ChemiCraftCore extends ChemiCraft{
                NetworkRegistry.instance().registerGuiHandler(instance, proxy);
 
                //電池を追加します
-               this.api.addChemicalCell(itemChemicalCells, "ChemicalCell", 1000);
+               this.api.addChemicalCell(this.itemChemicalCells, "ChemicalCell", 1000);
                this.api.addChemicalCellLanguage("ja_JP", "化学電池");
 
                this.api.addPyrolysisDecompositionFuel(new ItemStack(Item.coal), 2000*8);
@@ -283,20 +286,25 @@ public class ChemiCraftCore extends ChemiCraft{
                                                names.get(i));
                        }
                }
+
+               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));
+                       }
+               }
+
        }
 
 
 
        private void debug(final FMLInitializationEvent event) {
                this.proxy.registerTickHandler();
-               this.api.addCompound("Debug");
-               this.api.settingCompoundHandler("Debug", new CompoundDebug());
-
-               this.api.addToolAndWeaponRecipe(new ItemStack[] {
-                               new ItemStack(Block.stone, 1, 1)
-               },
-               new ItemStack(Block.dirt, 1, 0));
-
        }
 
 }