add: forbids installation buttons for incompatible libraries. Closes #720.

This commit is contained in:
huanghongxun
2020-05-31 22:24:03 +08:00
parent 42d42e9750
commit a2ef477ae0
11 changed files with 254 additions and 189 deletions

View File

@@ -104,7 +104,7 @@ public final class ForgeInstallTask extends Task<Version> {
public void execute() throws IOException, VersionMismatchException, OptiFineInstallTask.UnsupportedOptiFineInstallationException {
String originalMainClass = version.resolve(dependencyManager.getGameRepository()).getMainClass();
if (VersionNumber.VERSION_COMPARATOR.compare("1.13", remote.getGameVersion()) <= 0) {
// Forge 1.13 is not compatible with any other libraries.
// 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))
throw new OptiFineInstallTask.UnsupportedOptiFineInstallationException();
} else {