(FMLPreInitializationEvent aEvent)
| 149 | // Just add Calls to these from within your Mods load phases. |
| 150 | |
| 151 | public void onModPreInit(FMLPreInitializationEvent aEvent) { |
| 152 | if (mStartedPreInit) return; |
| 153 | try { |
| 154 | mProxy = getProxy(); |
| 155 | OUT.println(getModNameForLog() + ": ======================"); |
| 156 | ORD.println(getModNameForLog() + ": ======================"); |
| 157 | |
| 158 | loadRunnables("Before PreInit", mBeforePreInit); mBeforePreInit.clear(); mBeforePreInit = null; |
| 159 | |
| 160 | OUT.println(getModNameForLog() + ": PreInit-Phase started!"); |
| 161 | ORD.println(getModNameForLog() + ": PreInit-Phase started!"); |
| 162 | |
| 163 | mStartedPreInit = T; |
| 164 | sStartedPreInit++; |
| 165 | if (mProxy != null) mProxy.onProxyBeforePreInit(this, aEvent); |
| 166 | onModPreInit2(aEvent); |
| 167 | if (mProxy != null) mProxy.onProxyAfterPreInit(this, aEvent); |
| 168 | sFinishedPreInit++; |
| 169 | mFinishedPreInit = T; |
| 170 | |
| 171 | OUT.println(getModNameForLog() + ": PreInit-Phase finished!"); |
| 172 | ORD.println(getModNameForLog() + ": PreInit-Phase finished!"); |
| 173 | |
| 174 | if (!mCompatClasses.isEmpty()) { |
| 175 | UT.LoadingBar.start("Loading Compat (PreInit)", mCompatClasses.size()); |
| 176 | for (ICompat tCompat : mCompatClasses) { |
| 177 | String tString = tCompat.toString(); |
| 178 | UT.LoadingBar.step(UT.Code.stringValid(tString)?tString:"UNNAMED"); |
| 179 | try {tCompat.onPreLoad(aEvent);} catch(Throwable e) {e.printStackTrace(ERR);} |
| 180 | } |
| 181 | UT.LoadingBar.finish(); |
| 182 | } |
| 183 | |
| 184 | loadRunnables("After PreInit", mAfterPreInit); mAfterPreInit.clear(); mAfterPreInit = null; |
| 185 | |
| 186 | loadRunnables("Saving Configs", sConfigs); |
| 187 | |
| 188 | if (sFinishedPreInit >= sModCountUsingGTAPI) for (Abstract_Mod tMod : MODS_USING_GT_API) try {tMod.onModFinalPreInit(aEvent);} catch(Throwable e) {e.printStackTrace(ERR);} |
| 189 | |
| 190 | OUT.println(getModNameForLog() + ": ======================="); |
| 191 | ORD.println(getModNameForLog() + ": ======================="); |
| 192 | } catch(Throwable e) { |
| 193 | loadRunnables("Saving Configs after Exception!", sConfigs); |
| 194 | e.printStackTrace(ERR); |
| 195 | throw new RuntimeException(e); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | public void onModInit(FMLInitializationEvent aEvent) { |
| 200 | if (mStartedInit) return; |
no test coverage detected