From d6ac0983de1cf229874959861bebb31f1b87a21d Mon Sep 17 00:00:00 2001 From: Henry Le Grys Date: Fri, 25 Dec 2020 00:49:55 +0000 Subject: [PATCH] Fix forge loaders being named wrong & warning for wrong loader version --- .../builder/loaders/ModernForgeLoaderProcessor.java | 11 +++++++++-- .../loader/profiles/ModernForgeInstallProfile.java | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/launcher-builder/src/main/java/com/skcraft/launcher/builder/loaders/ModernForgeLoaderProcessor.java b/launcher-builder/src/main/java/com/skcraft/launcher/builder/loaders/ModernForgeLoaderProcessor.java index 0814bee..cd8648b 100644 --- a/launcher-builder/src/main/java/com/skcraft/launcher/builder/loaders/ModernForgeLoaderProcessor.java +++ b/launcher-builder/src/main/java/com/skcraft/launcher/builder/loaders/ModernForgeLoaderProcessor.java @@ -47,8 +47,8 @@ public class ModernForgeLoaderProcessor implements ILoaderProcessor { VersionInfo.class); VersionManifest version = manifest.getVersionManifest(); - if (version.getId() != null) { - loaderName = version.getId(); + if (info.getId() != null) { + loaderName = info.getId(); } // Copy game arguments @@ -89,6 +89,13 @@ public class ModernForgeLoaderProcessor implements ILoaderProcessor { ModernForgeInstallProfile profile = mapper.readValue(data, ModernForgeInstallProfile.class); + if (!profile.getMinecraft().equals(manifest.getGameVersion())) { + // TODO: Ideally this would show up as a Problem when running the check command. + // Getting the data from here to there is quite difficult, however. + log.warning(String.format("The Forge installer inside loaders/ is for Minecraft version %s; your " + + "manifest is set to %s.", profile.getMinecraft(), manifest.getGameVersion())); + } + // Import the libraries for the installer result.getProcessorLibraries().addAll(profile.getLibraries()); diff --git a/launcher/src/main/java/com/skcraft/launcher/model/loader/profiles/ModernForgeInstallProfile.java b/launcher/src/main/java/com/skcraft/launcher/model/loader/profiles/ModernForgeInstallProfile.java index 93594af..da79aca 100644 --- a/launcher/src/main/java/com/skcraft/launcher/model/loader/profiles/ModernForgeInstallProfile.java +++ b/launcher/src/main/java/com/skcraft/launcher/model/loader/profiles/ModernForgeInstallProfile.java @@ -24,6 +24,7 @@ public class ModernForgeInstallProfile { private List libraries; private List processors; private Map> data; + private String minecraft; public List toProcessorEntries(final String loaderName) { return Lists.transform(getProcessors(), new Function() {