OSDN Git Service

tc
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / ChemiCraftBase.java
index dfa7dd1..cf7dbe2 100644 (file)
@@ -1,5 +1,7 @@
 package pcc.chemicraft.base;
 
+import java.util.List;
+
 import net.minecraft.block.Block;
 import net.minecraft.creativetab.CreativeTabs;
 import net.minecraft.item.Item;
@@ -14,11 +16,15 @@ import pcc.chemicraft.base.creativetab.CreativeTabAtomOres;
 import pcc.chemicraft.base.system.CommonProxy;
 import pcc.chemicraft.base.system.PacketHandler;
 import pcc.chemicraft.core.ChemiCraftAPI;
+import cpw.mods.fml.common.Loader;
 import cpw.mods.fml.common.Mod;
+import cpw.mods.fml.common.ModContainer;
+import cpw.mods.fml.common.LoaderState.ModState;
 import cpw.mods.fml.common.Mod.Instance;
 import cpw.mods.fml.common.Mod.PostInit;
 import cpw.mods.fml.common.Mod.PreInit;
 import cpw.mods.fml.common.SidedProxy;
+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;
@@ -127,6 +133,23 @@ public class ChemiCraftBase extends ChemiCraft
                                break;
                        }
                }
+
+               Thread loadCheckThread = new Thread() {
+                       @Override
+                       public void run() {
+                               while (true) {
+                                       List<ModContainer> mod = Loader.instance().getModList();
+                                       ModContainer finalMod = mod.get(mod.size()-1);
+                                       ModState finalModState = Loader.instance().getModState(finalMod);
+                                       if (finalModState == ModState.AVAILABLE) {
+                                               apiProcessing((FMLPostInitializationEvent) event);
+                                               break;
+                                       }
+                               }
+                       }
+               };
+               loadCheckThread.start();
+
        }
 
        /**
@@ -139,11 +162,11 @@ public class ChemiCraftBase extends ChemiCraft
                Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
                cfg.load();
 
-               Property baseBlockID = cfg.get("BlockID", "Base of Block ID", 2900);
+               Property baseBlockID = cfg.get("BlockID", "Base of Block ID", 2500);
                Property baseItemID = cfg.get("ItemID", "Base of Item ID", 25500);
 
                ChemiCraftConfiguration ccfgBlock = new ChemiCraftConfiguration(baseBlockID.getInt());
-               ChemiCraftConfiguration ccfgItem = new ChemiCraftConfiguration(baseBlockID.getInt());
+               ChemiCraftConfiguration ccfgItem = new ChemiCraftConfiguration(baseItemID.getInt());
 
                for (int i = 0; i < atomOresID.length; i++) {
                        this.atomOresID[i] = ccfgBlock.additionID();