Java 类cpw.mods.fml.common.ICrashCallable 实例源码

项目:TFC-Tweaks    文件:TFCTweaks.java   
@Mod.EventHandler
public void construction(FMLConstructionEvent e)
{
    if (!DISABLE_LOADORDER)
    {
        Helper.doLoadOrderHaxing();
        FMLCommonHandler.instance().registerCrashCallable(new ICrashCallable()
        {
            public String call() throws Exception
            {
                return "PLEASE TRY TO START THE GAME AT LEAST TWICE. The load order modifications we do only kick in after a reload.";
            }

            public String getLabel()
            {
                return MODID;
            }
        });
    }

    FMLCommonHandler.instance().registerCrashCallable(new ICrashCallable()
    {
        public String call() throws Exception
        {
            return String.format("FluidContainerRegistryCT: %d / %d; FluidRegistryCT: %d / %d", FluidContainerRegistryCT.done, FluidContainerRegistryCT.DONE, FluidRegistryCT.done, FluidRegistryCT.DONE);
        }

        public String getLabel()
        {
            return MODID + "-ASM";
        }
    });
}
项目:Dimensional-Pockets    文件:DPAnalytics.java   
/**
 * Creates a shutdown hook that looks for crashes
 */
public void initShutdownHook() {
    FMLCommonHandler.instance().registerCrashCallable(new ICrashCallable() {
        @Override
        public String call() throws Exception {
            hasRegisteredCrash = true;
            return analytics.isActive() ? ("Will analyze crash-log before shutdown and send it to the " + Reference.MOD_NAME + " developer") : "[inactive]";
        }

        @Override
        public String getLabel() {
            return CRASH_CHECK_LABEL;
        }
    });

    // startup check. 1) to initialize the crash analyzer. 2) to get a crashlog we might not had the time to check yet
    checkCrashLogs();

    Runtime.getRuntime().addShutdownHook(new Thread("DPAnalytics-ShutdownHook") {
        @Override
        public void run() {
            if (analytics.isActive()) {
                if (hasRegisteredCrash) {
                    checkCrashLogs();
                } else {
                    System.out.println("No crash, we are good.");
                }
            }
        }
    });
}
项目:MLIA    文件:CrashReportCategory.java   
public void func_71500_a(String label, ICrashCallable callable) {

    }