(FMLPostInitializationEvent aEvent)
| 244 | } |
| 245 | |
| 246 | public void onModPostInit(FMLPostInitializationEvent aEvent) { |
| 247 | if (mStartedPostInit) return; |
| 248 | try { |
| 249 | OUT.println(getModNameForLog() + ": ======================="); |
| 250 | ORD.println(getModNameForLog() + ": ======================="); |
| 251 | |
| 252 | loadRunnables("Before PostInit", mBeforePostInit); mBeforePostInit.clear(); mBeforePostInit = null; |
| 253 | |
| 254 | OUT.println(getModNameForLog() + ": PostInit-Phase started!"); |
| 255 | ORD.println(getModNameForLog() + ": PostInit-Phase started!"); |
| 256 | |
| 257 | mStartedPostInit = T; |
| 258 | sStartedPostInit++; |
| 259 | if (mProxy != null) mProxy.onProxyBeforePostInit(this, aEvent); |
| 260 | onModPostInit2(aEvent); |
| 261 | if (mProxy != null) mProxy.onProxyAfterPostInit(this, aEvent); |
| 262 | sFinishedPostInit++; |
| 263 | mFinishedPostInit = T; |
| 264 | |
| 265 | OUT.println(getModNameForLog() + ": PostInit-Phase finished!"); |
| 266 | ORD.println(getModNameForLog() + ": PostInit-Phase finished!"); |
| 267 | |
| 268 | if (!mCompatClasses.isEmpty()) { |
| 269 | UT.LoadingBar.start("Loading Compat (PostInit)", mCompatClasses.size()); |
| 270 | for (ICompat tCompat : mCompatClasses) { |
| 271 | String tString = tCompat.toString(); |
| 272 | UT.LoadingBar.step(UT.Code.stringValid(tString)?tString:"UNNAMED"); |
| 273 | try {tCompat.onPostLoad(aEvent);} catch(Throwable e) {e.printStackTrace(ERR);} |
| 274 | } |
| 275 | UT.LoadingBar.finish(); |
| 276 | } |
| 277 | |
| 278 | loadRunnables("After PostInit", mAfterPostInit); mAfterPostInit.clear(); mAfterPostInit = null; |
| 279 | |
| 280 | loadRunnables("Finalize", mFinalize); mFinalize.clear(); mFinalize = null; |
| 281 | |
| 282 | if (sFinishedPostInit >= sModCountUsingGTAPI) for (Abstract_Mod tMod : MODS_USING_GT_API) try {tMod.onModFinalPostInit(aEvent);} catch(Throwable e) {e.printStackTrace(ERR);} |
| 283 | |
| 284 | sFinalized++; |
| 285 | mFinalized = T; |
| 286 | |
| 287 | if (sFinalized >= sModCountUsingGTAPI) { |
| 288 | CR.stopBuffering(); |
| 289 | } |
| 290 | |
| 291 | loadRunnables("Saving Configs", sConfigs); |
| 292 | |
| 293 | OUT.println(getModNameForLog() + ": ========================"); |
| 294 | ORD.println(getModNameForLog() + ": ========================"); |
| 295 | } catch(Throwable e) { |
| 296 | loadRunnables("Saving Configs after Exception!", sConfigs); |
| 297 | e.printStackTrace(ERR); |
| 298 | throw new RuntimeException(e); |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | public void onModServerStarting(FMLServerStartingEvent aEvent) { |
| 303 | loadRunnables(mBeforeServerStarting); |
no test coverage detected