@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"; } }); }
/** * 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."); } } } }); }
public void func_71500_a(String label, ICrashCallable callable) { }