This commit is contained in:
huanghongxun
2020-06-26 21:25:26 +08:00
parent 1208d6dabc
commit bd18355a1a

View File

@@ -138,6 +138,7 @@ public class DefaultLauncher extends Launcher {
Proxy proxy = options.getProxy();
if (proxy != null && StringUtils.isBlank(options.getProxyUser()) && StringUtils.isBlank(options.getProxyPass())) {
InetSocketAddress address = (InetSocketAddress) options.getProxy().address();
if (address != null) {
String host = address.getHostString();
int port = address.getPort();
if (proxy.type() == Proxy.Type.HTTP) {
@@ -150,6 +151,7 @@ public class DefaultLauncher extends Launcher {
res.add("-DsocksProxyPort=" + port);
}
}
}
LinkedList<String> classpath = new LinkedList<>();
for (Library library : version.getLibraries())
@@ -202,6 +204,7 @@ public class DefaultLauncher extends Launcher {
if (options.getProxy() != null) {
InetSocketAddress address = (InetSocketAddress) options.getProxy().address();
if (address != null) {
res.add("--proxyHost");
res.add(address.getHostString());
res.add("--proxyPort");
@@ -213,6 +216,7 @@ public class DefaultLauncher extends Launcher {
res.add(options.getProxyPass());
}
}
}
if (StringUtils.isNotBlank(options.getMinecraftArgs()))
res.addAllWithoutParsing(StringUtils.tokenize(options.getMinecraftArgs()));