Merge pull request #2621 from wagyourtail/replaymodfix-master

fix replaymod crash (on newer versions)
This commit is contained in:
Leijurv 2022-02-02 00:15:50 -08:00 committed by GitHub
commit b52de9b197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,14 @@ public class WorldProvider implements IWorldProvider, Helper {
directory = new File(directory, "baritone");
readme = directory;
} else { // Otherwise, the server must be remote...
String folderName = mc.getCurrentServerData().serverIP;
String folderName;
if (mc.getCurrentServerData() != null) {
folderName = mc.getCurrentServerData().serverIP;
} else {
//replaymod causes null currentServerData and false singleplayer.
currentWorld = null;
return;
}
if (SystemUtils.IS_OS_WINDOWS) {
folderName = folderName.replace(":", "_");
}