Forbid user from installing both Forge 1.13 and OptiFine simultaneously
This commit is contained in:
@@ -83,11 +83,6 @@ public final class ForgeInstallTask extends TaskResult<Version> {
|
||||
return Collections.singleton(dependency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRelyingOnDependencies() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (VersionNumber.VERSION_COMPARATOR.compare("1.13", remote.getGameVersion()) <= 0)
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.jackhuang.hmcl.download.forge;
|
||||
|
||||
import org.jackhuang.hmcl.download.DefaultDependencyManager;
|
||||
import org.jackhuang.hmcl.download.game.GameLibrariesTask;
|
||||
import org.jackhuang.hmcl.download.optifine.OptiFineInstallTask;
|
||||
import org.jackhuang.hmcl.game.*;
|
||||
import org.jackhuang.hmcl.task.Task;
|
||||
import org.jackhuang.hmcl.task.TaskResult;
|
||||
@@ -122,6 +123,9 @@ public class ForgeNewInstallTask extends TaskResult<Version> {
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
if ("net.minecraft.launchwrapper.Launch".equals(version.getMainClass()))
|
||||
throw new OptiFineInstallTask.UnsupportedOptiFineInstallationException();
|
||||
|
||||
Path temp = Files.createTempDirectory("forge_installer");
|
||||
int finished = 0;
|
||||
try (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(installer)) {
|
||||
|
||||
@@ -66,6 +66,9 @@ public final class OptiFineInstallTask extends TaskResult<Version> {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
if ("cpw.mods.modlauncher.Launcher".equals(version.getMainClass()))
|
||||
throw new UnsupportedOptiFineInstallationException();
|
||||
|
||||
String remoteVersion = remote.getGameVersion() + "_" + remote.getSelfVersion();
|
||||
|
||||
Library library = new Library(
|
||||
@@ -90,4 +93,6 @@ public final class OptiFineInstallTask extends TaskResult<Version> {
|
||||
dependencies.add(dependencyManager.checkLibraryCompletionAsync(version.setLibraries(libraries)));
|
||||
}
|
||||
|
||||
public static class UnsupportedOptiFineInstallationException extends UnsupportedOperationException {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user