OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/chemicraft/chemicraft into Chang... Change(Sys)
authormozipi <mozipi@users.sourceforge.jp>
Tue, 5 Mar 2013 00:41:56 +0000 (09:41 +0900)
committermozipi <mozipi@users.sourceforge.jp>
Tue, 5 Mar 2013 00:41:56 +0000 (09:41 +0900)
1  2 
common/pcc/chemicraft/ChemiCraft.java

@@@ -53,7 -53,7 +53,7 @@@ import cpw.mods.fml.common.registry.Gam
   */
  @Mod(modid = "chemiCraft", name = "ChemiCraft", version = "beta")
  @NetworkMod(clientSideRequired = true, serverSideRequired = true, versionBounds = "1.4.6", channels = "chemicraft", packetHandler = PacketHandler.class)
 -public class ChemiCraft {
 +public class ChemiCraft implements Runnable {
  
        public static final String[] ATOMSNAME = {
                "Hydrogen", "Helium", "Lithium", "Beryllium", "Boron", "Carbon", "Nitrogen", "Oxygen", "Fluorine", "Neon", "Sodium", "Magnesium", "Aluminium", "Silicon",
        private ChemiCraftAPI api = ChemiCraftAPI.instance();
        private ChemiCraftData chemicalData = new ChemiCraftData();
  
 +      /**
 +       * このMODのスレッド
 +       */
 +      private Thread thread;
 +
 +      /**
 +       * Eventのインスタンス(PostInit以降)
 +       */
 +      private FMLPostInitializationEvent event;
 +
        @Mod.PreInit
        public void chemiPreLoadMethod(final FMLPreInitializationEvent event) {
                Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
  
        @Mod.PostInit
        public void chemiPostLoadMethod(final FMLPostInitializationEvent event) {
 -              this.settingProcessing(event);
 -              this.apiProcessing(event);
 -              this.debug(event);
 +              this.thread = new Thread(this);
 +              this.event = event;
 +              try {
 +                      Thread.sleep(5000);
 +              } catch (InterruptedException e1) {
 +                      e1.printStackTrace();
 +              }
 +              this.thread.start();
 +              try {
 +                      this.thread.join();
 +              } catch (InterruptedException e) {
 +                      e.printStackTrace();
 +              }
 +              proxy.registerRenderInformation();
 +              Thread.yield();
 +      }
 +
 +      @Override
 +      public void run() {
 +              while (true) {
 +                      if (proxy != null && instance != null) {
 +                              this.settingProcessing(event);
 +                              this.apiProcessing(event);
 +                              this.debug(event);
 +                              break;
 +                      }
 +              }
        }
  
        private void settingProcessing(final FMLPostInitializationEvent event) {
                // GUIを追加します
                NetworkRegistry.instance().registerGuiHandler(instance, proxy);
  
 -              // 描画関係の読み込み
 -              proxy.registerRenderInformation();
 -
                //化学作業台類のレシピを追加します
                GameRegistry.addRecipe(new ItemStack(this.blockPyrolysisTable),
                                new Object[]{
                api.addAtomOresLanguage("Chrysoberyl", "金緑石", "ja_JP");
  
                // ホウ素
-               api.addAtomOres("Ulexite", new String[]{"Na", "Ca", "B", "O"}, new Integer[]{1, 1, 5, 6}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50);   // NaCaB5O6(OH)6・5H2O
+               api.addAtomOres("Ulexite", new String[]{"Na", "Ca", "B", "O", "H"}, new Integer[]{1, 1, 5, 17, 16}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50);   // NaCaB5O6(OH)6・5H2O
                api.addAtomOresLanguage("Ulexite", "ウレキサイト", "ja_JP");
  
                // フッ素
                api.addAtomOresLanguage("RockSalt", "岩塩", "ja_JP");
  
                // マグネシウム
-               api.addAtomOres("Dolomite", new String[]{"Ca", "Mg"}, new Integer[]{1, 1}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // CaMg(CO3)2
+               api.addAtomOres("Dolomite", new String[]{"Ca", "Mg", "C", "O"}, new Integer[]{1, 1, 2, 6}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // CaMg(CO3)2
                api.addAtomOresLanguage("Dolomite", "苦灰石", "ja_JP");
                api.addAtomOres("Magnesite", new String[]{"Mg", "C", "O"}, new Integer[]{1, 1, 3}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // MgCO3
                api.addAtomOresLanguage("Magnesite", "菱苦土石", "ja_JP");
  
                // アルミニウム
-               api.addAtomOres("Gibbsite", new String[]{"Al"}, new Integer[]{3}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Al(OH)3
+               api.addAtomOres("Gibbsite", new String[]{"Al", "O", "H"}, new Integer[]{3, 3, 3}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Al(OH)3
                api.addAtomOresLanguage("Gibbsite", "ギブス石", "ja_JP");
                api.addAtomOres("Ruby", new String[]{"Al", "O"}, new Integer[]{2, 3}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Al2O3
                api.addAtomOresLanguage("Ruby", "ルビー", "ja_JP");
                api.addAtomOresLanguage("Quartz", "石英", "ja_JP");
  
                // リン
-               api.addAtomOres("Fluorapatite", new String[]{"Ca"}, new Integer[]{5}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Ca5(PO4)3F
+               api.addAtomOres("Fluorapatite", new String[]{"Ca", "P", "O", "F"}, new Integer[]{5, 3, 12, 1}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Ca5(PO4)3F
                api.addAtomOresLanguage("Fluorapatite", "フッ素リン灰石", "ja_JP");
-               api.addAtomOres("Chlorapatite", new String[]{"Ca"}, new Integer[]{5}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Ca5(PO4)3Cl
+               api.addAtomOres("Chlorapatite", new String[]{"Ca", "P", "O", "Cl"}, new Integer[]{5, 3, 12, 1}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Ca5(PO4)3Cl
                api.addAtomOresLanguage("Chlorapatite", "塩素燐灰石", "ja_JP");
-               api.addAtomOres("Hydroxylapatite", new String[]{"Ca"}, new Integer[]{5}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Ca5(PO4)3(OH)
+               api.addAtomOres("Hydroxylapatite", new String[]{"Ca", "P", "O", "H"}, new Integer[]{5, 3, 13, 1}, this.atomOresID[api.getAtomOresLastIndex()], 5, 1, 50); // Ca5(PO4)3(OH)
                api.addAtomOresLanguage("Hydroxylapatite", "水酸燐灰石", "ja_JP");
  
                // カリウム
                                new ItemStack(Item.bucketWater),
                                new ItemStack(Item.bucketWater),
                                new ItemStack(Item.bucketWater),
 -              }, 
 -              new ItemStack(this.itemChemicalCells, 1, 0), 
 +              },
 +              new ItemStack(this.itemChemicalCells, 1, 0),
                null);
  
                //手榴弾の追加
        }
  
        private void debug(final FMLPostInitializationEvent event) {
 -              //DebugTickingの追加
                this.proxy.registerTickHandler();
                this.api.addCompound("Debug");
                this.api.settingCompoundHandler("Debug", new CompoundDebug());
  
 -              /*
 -               * TWDebug
 -               */
                this.api.addToolAndWeaponRecipe(new ItemStack[] {
                                new ItemStack(Block.stone, 1, 1)
                },