diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/PremiumPlaceholder.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/PremiumPlaceholder.java index 6838c48a..d293c14a 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/PremiumPlaceholder.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/PremiumPlaceholder.java @@ -31,7 +31,7 @@ public class PremiumPlaceholder extends PlaceholderHook { } } - return null; + return ""; } public static void register(FastLoginBukkit plugin) { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java index 782a7e66..ecd8f59b 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java @@ -11,6 +11,7 @@ import java.io.IOException; import java.net.InetSocketAddress; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Collections; import java.util.Set; import java.util.UUID; import java.util.logging.Level; @@ -112,6 +113,6 @@ public class BungeeCordListener implements PluginMessageListener { plugin.getLogger().log(Level.SEVERE, "Failed to retrieve proxy Id. Disabling BungeeCord support", ex); } - return null; + return Collections.emptySet(); } } diff --git a/bungee/pom.xml b/bungee/pom.xml index c2875308..c27e7429 100644 --- a/bungee/pom.xml +++ b/bungee/pom.xml @@ -21,6 +21,11 @@ vik1395-repo https://vik1395.github.io/repo.vik1395.me/repositories + + + luck-repo + https://ci.lucko.me/plugin/repository/everything + diff --git a/core/src/main/java/com/github/games647/fastlogin/core/mojang/MojangApiConnector.java b/core/src/main/java/com/github/games647/fastlogin/core/mojang/MojangApiConnector.java index b7f23240..0446a2db 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/mojang/MojangApiConnector.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/mojang/MojangApiConnector.java @@ -30,6 +30,7 @@ import java.util.logging.Logger; import java.util.regex.Pattern; import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLSocketFactory; public class MojangApiConnector { @@ -48,7 +49,7 @@ public class MojangApiConnector { private final Iterator proxies; private final Map requests = CommonUtil.buildCache(10, -1); - private final BalancedSSLFactory sslFactory; + private final SSLSocketFactory sslFactory; private final int rateLimit; private long lastRateLimit; @@ -96,9 +97,7 @@ public class MojangApiConnector { if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) { String line = reader.readLine(); - if (!"null".equals(line)) { - return CommonUtil.parseId(getUUIDFromJson(line)); - } + return getUUIDFromJson(line); } } else if (connection.getResponseCode() == RATE_LIMIT_CODE) { logger.info("RATE_LIMIT REACHED"); @@ -120,7 +119,7 @@ public class MojangApiConnector { return false; } - private String getUUIDFromJson(String json) { + private UUID getUUIDFromJson(String json) { boolean isArray = json.startsWith("["); Player mojangPlayer; @@ -131,11 +130,7 @@ public class MojangApiConnector { } String id = mojangPlayer.getId(); - if ("null".equals(id)) { - return null; - } - - return id; + return CommonUtil.parseId(id); } protected HttpsURLConnection getConnection(String url, Proxy proxy) throws IOException { @@ -158,9 +153,9 @@ public class MojangApiConnector { return getConnection(url, Proxy.NO_PROXY); } - private BalancedSSLFactory buildAddresses(Logger logger, Collection localAddresses) { + private SSLSocketFactory buildAddresses(Logger logger, Collection localAddresses) { if (localAddresses.isEmpty()) { - return null; + return HttpsURLConnection.getDefaultSSLSocketFactory(); } else { Set addresses = Sets.newHashSet(); for (String localAddress : localAddresses) {