saves Data whenever Save File Location changes or if aForceSave is passed, usually by the minutely Autosave.
(File aSaveLocation, boolean aForceSave)
| 185 | * saves Data whenever Save File Location changes or if aForceSave is passed, usually by the minutely Autosave. |
| 186 | */ |
| 187 | public boolean checkSaveLocation(File aSaveLocation, boolean aForceSave) { |
| 188 | boolean tSave = (aForceSave || aSaveLocation == null), tLoad = (mSaveLocation == null); |
| 189 | // Did Save Files swap secretly? Can happen in Singleplayer with the popular Forge Monopoly Bug: "Go directly to the Main Menu. Do not enter your World. Do not collect 200 Blocks." |
| 190 | if (CODE_CLIENT && aSaveLocation != null && !aSaveLocation.equals(mSaveLocation)) tSave = tLoad = T; |
| 191 | |
| 192 | if (tSave && mSaveLocation != null) { |
| 193 | // Only print this if it is not the minutely Autosave. |
| 194 | if (aSaveLocation == null) OUT.println("Saving World! " + mSaveLocation.getName());// else DEB.println("Autosave! " + mSaveLocation.getName()); |
| 195 | // Make the Folder to drop the Save Files into. |
| 196 | new File(mSaveLocation, "gregtech").mkdirs(); |
| 197 | // Call the Save Function in all the things that need it. |
| 198 | GarbageGT.onServerSave(mSaveLocation); |
| 199 | MultiTileEntityRegistry.onServerSave(mSaveLocation); |
| 200 | } |
| 201 | mSaveLocation = aSaveLocation; |
| 202 | if (tLoad && mSaveLocation != null) { |
| 203 | OUT.println("Loading World! " + mSaveLocation.getName()); |
| 204 | // Make the Folder to uhh wait why is that needed? Probably helps preventing Issues though, so why not. |
| 205 | new File(mSaveLocation, "gregtech").mkdirs(); |
| 206 | // Call the Load Function in all the things that need it. |
| 207 | GarbageGT.onServerLoad(mSaveLocation); |
| 208 | MultiTileEntityRegistry.onServerLoad(mSaveLocation); |
| 209 | } |
| 210 | return tSave || tLoad; |
| 211 | } |
| 212 | |
| 213 | @Override |
| 214 | public void onProxyBeforeServerStarted(Abstract_Mod aMod, FMLServerStartedEvent aEvent) { |
no test coverage detected