fix: cannot update Forge for Minecraft 1.18 when "patches" lost in game version json. Closes #1262.

This commit is contained in:
huanghongxun 2022-01-02 01:07:39 +08:00
parent 451600448e
commit 10fea79a35

View File

@ -102,7 +102,10 @@ public final class ForgeInstallTask extends Task<Version> {
String originalMainClass = version.resolve(dependencyManager.getGameRepository()).getMainClass();
if (VersionNumber.VERSION_COMPARATOR.compare("1.13", remote.getGameVersion()) <= 0) {
// Forge 1.13 is not compatible with fabric.
if (!LibraryAnalyzer.VANILLA_MAIN.equals(originalMainClass) && !LibraryAnalyzer.MOD_LAUNCHER_MAIN.equals(originalMainClass) && !LibraryAnalyzer.LAUNCH_WRAPPER_MAIN.equals(originalMainClass))
if (!LibraryAnalyzer.VANILLA_MAIN.equals(originalMainClass)
&& !LibraryAnalyzer.MOD_LAUNCHER_MAIN.equals(originalMainClass)
&& !LibraryAnalyzer.LAUNCH_WRAPPER_MAIN.equals(originalMainClass)
&& !LibraryAnalyzer.BOOTSTRAP_LAUNCHER_MAIN.equals(originalMainClass))
throw new UnsupportedInstallationException(UNSUPPORTED_LAUNCH_WRAPPER);
} else {
// Forge 1.12 and older versions is compatible with vanilla and launchwrapper.