mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-07 19:11:48 -04:00
parent
78f080b6cc
commit
8efdc536ee
@ -333,7 +333,8 @@ public final class LauncherHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Task<JavaVersion> checkGameState(Profile profile, VersionSetting setting, Version version) {
|
private static Task<JavaVersion> checkGameState(Profile profile, VersionSetting setting, Version version) {
|
||||||
GameVersionNumber gameVersion = GameVersionNumber.asGameVersion(profile.getRepository().getGameVersion(version));
|
LibraryAnalyzer analyzer = LibraryAnalyzer.analyze(version, profile.getRepository().getGameVersion(version).orElse(null));
|
||||||
|
GameVersionNumber gameVersion = GameVersionNumber.asGameVersion(analyzer.getVersion(LibraryAnalyzer.LibraryType.MINECRAFT));
|
||||||
|
|
||||||
if (setting.isNotCheckJVM()) {
|
if (setting.isNotCheckJVM()) {
|
||||||
return Task.composeAsync(() -> setting.getJavaVersion(gameVersion, version))
|
return Task.composeAsync(() -> setting.getJavaVersion(gameVersion, version))
|
||||||
@ -417,7 +418,6 @@ public final class LauncherHelper {
|
|||||||
JavaVersionConstraint violatedMandatoryConstraint = null;
|
JavaVersionConstraint violatedMandatoryConstraint = null;
|
||||||
List<JavaVersionConstraint> violatedSuggestedConstraints = null;
|
List<JavaVersionConstraint> violatedSuggestedConstraints = null;
|
||||||
|
|
||||||
LibraryAnalyzer analyzer = LibraryAnalyzer.analyze(version, gameVersion.toString());
|
|
||||||
for (JavaVersionConstraint constraint : JavaVersionConstraint.ALL) {
|
for (JavaVersionConstraint constraint : JavaVersionConstraint.ALL) {
|
||||||
if (constraint.appliesToVersion(gameVersion, version, javaVersion, analyzer)) {
|
if (constraint.appliesToVersion(gameVersion, version, javaVersion, analyzer)) {
|
||||||
if (!constraint.checkJava(gameVersion, version, javaVersion)) {
|
if (!constraint.checkJava(gameVersion, version, javaVersion)) {
|
||||||
|
@ -104,8 +104,13 @@ final class GameVersion {
|
|||||||
if (minecraft != null) {
|
if (minecraft != null) {
|
||||||
try (InputStream is = gameJar.getInputStream(minecraft)) {
|
try (InputStream is = gameJar.getInputStream(minecraft)) {
|
||||||
Optional<String> result = getVersionOfClassMinecraft(is);
|
Optional<String> result = getVersionOfClassMinecraft(is);
|
||||||
if (result.isPresent())
|
if (result.isPresent()) {
|
||||||
|
String version = result.get();
|
||||||
|
if (version.startsWith("Beta ")) {
|
||||||
|
result = Optional.of("b" + version.substring("Beta ".length()));
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user