Fix compatibility with older guava versions like Minecraft < 1.19

This commit is contained in:
games647
2023-03-31 13:06:12 +02:00
parent 487bc24a8a
commit 546bbede0b

View File

@ -40,7 +40,6 @@ import com.github.games647.fastlogin.core.storage.MySQLStorage;
import com.github.games647.fastlogin.core.storage.SQLStorage; import com.github.games647.fastlogin.core.storage.SQLStorage;
import com.github.games647.fastlogin.core.storage.SQLiteStorage; import com.github.games647.fastlogin.core.storage.SQLiteStorage;
import com.google.common.base.Ticker; import com.google.common.base.Ticker;
import com.google.common.net.HostAndPort;
import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariConfig;
import java.io.IOException; import java.io.IOException;
@ -126,8 +125,8 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
antiBot = createAntiBotService(config.getSection("anti-bot")); antiBot = createAntiBotService(config.getSection("anti-bot"));
Set<Proxy> proxies = config.getStringList("proxies") Set<Proxy> proxies = config.getStringList("proxies")
.stream() .stream()
.map(HostAndPort::fromString) .map(proxy -> proxy.split(":"))
.map(proxy -> new InetSocketAddress(proxy.getHostText(), proxy.getPort())) .map(proxy -> new InetSocketAddress(proxy[0], Integer.parseInt(proxy[1])))
.map(sa -> new Proxy(Type.HTTP, sa)) .map(sa -> new Proxy(Type.HTTP, sa))
.collect(toSet()); .collect(toSet());
@ -269,6 +268,7 @@ public class FastLoginCore<P extends C, C, T extends PlatformPlugin<C>> {
return passwordGenerator; return passwordGenerator;
} }
@SuppressWarnings("unused")
public void setPasswordGenerator(PasswordGenerator<P> passwordGenerator) { public void setPasswordGenerator(PasswordGenerator<P> passwordGenerator) {
this.passwordGenerator = passwordGenerator; this.passwordGenerator = passwordGenerator;
} }