Revert "add: accept authlib-injector artifact in current working directory"

This reverts commit 02cb2a3fb1.
This commit is contained in:
yushijinhun
2020-08-07 17:23:27 +08:00
committed by Yuhui Huang
parent 00b945f6e3
commit ae63b9712e
2 changed files with 1 additions and 11 deletions

View File

@@ -40,7 +40,6 @@ import org.jackhuang.hmcl.auth.yggdrasil.YggdrasilAccountFactory;
import org.jackhuang.hmcl.task.Schedulers;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
@@ -244,12 +243,7 @@ public final class Accounts {
private static AuthlibInjectorArtifactProvider createAuthlibInjectorArtifactProvider() {
String authlibinjectorLocation = System.getProperty("hmcl.authlibinjector.location");
if (authlibinjectorLocation == null) {
Path currentDirectory = Paths.get(".");
Path artifactsDirectory = AuthlibInjectorDownloader.isArtifactsDirectory(currentDirectory)
? currentDirectory
: Metadata.HMCL_DIRECTORY;
return new AuthlibInjectorDownloader(artifactsDirectory, DownloadProviders::getDownloadProvider);
return new AuthlibInjectorDownloader(Metadata.HMCL_DIRECTORY, DownloadProviders::getDownloadProvider);
} else {
LOG.info("Using specified authlib-injector: " + authlibinjectorLocation);
return new SimpleAuthlibInjectorArtifactProvider(Paths.get(authlibinjectorLocation));

View File

@@ -127,10 +127,6 @@ public class AuthlibInjectorDownloader implements AuthlibInjectorArtifactProvide
}
}
public static boolean isArtifactsDirectory(Path artifactsDirectory) {
return Files.exists(artifactsDirectory.resolve("authlib-injector.jar"));
}
private static class AuthlibInjectorVersionInfo {
@SerializedName("build_number")
public int buildNumber;