removed helper methods from MojangApi
parent
30a13646fb
commit
c3a7118dee
|
@ -19,6 +19,7 @@ import amidst.gui.main.viewer.ViewerFacade;
|
|||
import amidst.gui.seedsearcher.SeedSearcher;
|
||||
import amidst.gui.seedsearcher.SeedSearcherWindow;
|
||||
import amidst.mojangapi.MojangApi;
|
||||
import amidst.mojangapi.file.LauncherProfile;
|
||||
import amidst.mojangapi.world.World;
|
||||
import amidst.settings.biomeprofile.BiomeProfileDirectory;
|
||||
import amidst.threading.ThreadMaster;
|
||||
|
@ -27,9 +28,16 @@ import amidst.threading.ThreadMaster;
|
|||
public class PerMainWindowInjector {
|
||||
@CalledOnlyBy(AmidstThread.EDT)
|
||||
private static String createVersionString(AmidstMetaData metadata, MojangApi mojangApi) {
|
||||
return metadata.getVersion().createLongVersionString() + " - Selected Profile: " + mojangApi.getProfileName()
|
||||
+ " - Minecraft Version " + mojangApi.getVersionId() + " (recognised: "
|
||||
+ mojangApi.getRecognisedVersionName() + ")";
|
||||
return new StringBuilder()
|
||||
.append(metadata.getVersion().createLongVersionString())
|
||||
.append(" - Selected Profile: ")
|
||||
.append(mojangApi.getLauncherProfile().map(LauncherProfile::getProfileName).orElse("unknown"))
|
||||
.append(" - Minecraft Version ")
|
||||
.append(mojangApi.getLauncherProfile().map(LauncherProfile::getVersionId).orElse("unknown"))
|
||||
.append(" (recognised: ")
|
||||
.append(mojangApi.getRecognisedVersionName())
|
||||
.append(")")
|
||||
.toString();
|
||||
}
|
||||
|
||||
private final Factory2<World, Actions, ViewerFacade> viewerFacadeFactory;
|
||||
|
|
|
@ -22,9 +22,6 @@ import amidst.parsing.FormatException;
|
|||
|
||||
@ThreadSafe
|
||||
public class MojangApi {
|
||||
private static final String UNKNOWN_PROFILE_NAME = "unknown";
|
||||
public static final String UNKNOWN_VERSION_ID = "unknown";
|
||||
|
||||
private final WorldBuilder worldBuilder;
|
||||
private final MinecraftInstallation minecraftInstallation;
|
||||
|
||||
|
@ -112,20 +109,11 @@ public class MojangApi {
|
|||
}
|
||||
}
|
||||
|
||||
public String getVersionId() {
|
||||
return getLauncherProfile().map(LauncherProfile::getVersionId).orElse(UNKNOWN_VERSION_ID);
|
||||
}
|
||||
|
||||
public String getRecognisedVersionName() {
|
||||
MinecraftInterface minecraftInterface = this.minecraftInterface;
|
||||
if (minecraftInterface != null) {
|
||||
return minecraftInterface.getRecognisedVersion().getName();
|
||||
} else {
|
||||
return RecognisedVersion.UNKNOWN.getName();
|
||||
}
|
||||
}
|
||||
|
||||
public String getProfileName() {
|
||||
return getLauncherProfile().map(LauncherProfile::getProfileName).orElse(UNKNOWN_PROFILE_NAME);
|
||||
return Optional
|
||||
.ofNullable(this.minecraftInterface)
|
||||
.map(MinecraftInterface::getRecognisedVersion)
|
||||
.map(RecognisedVersion::getName)
|
||||
.orElse(RecognisedVersion.UNKNOWN.getName());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue