MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / checkSaveLocation

Method checkSaveLocation

src/main/java/gregapi/GT_API_Proxy.java:187–211  ·  view source on GitHub ↗

saves Data whenever Save File Location changes or if aForceSave is passed, usually by the minutely Autosave.

(File aSaveLocation, boolean aForceSave)

Source from the content-addressed store, hash-verified

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) {

Callers 3

onWorldLoadMethod · 0.95
onServerTickMethod · 0.95

Calls 7

onServerSaveMethod · 0.95
onServerSaveMethod · 0.95
onServerLoadMethod · 0.95
onServerLoadMethod · 0.95
printlnMethod · 0.80
equalsMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected