diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/NameFetcher.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/NameFetcher.java index f58cdc9..eff8fdf 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/NameFetcher.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/NameFetcher.java @@ -17,10 +17,7 @@ import java.net.URLConnection; import java.util.*; public class NameFetcher { - private static Map> cache = new HashMap<>(); - public static List nameHistoryFromUuid(UUID uuid) { - if (cache.containsKey(uuid)) return cache.get(uuid); URLConnection connection; try { connection = new URL("https://api.mojang.com/user/profiles/" @@ -30,7 +27,6 @@ public class NameFetcher { Type listType = new TypeToken>() { }.getType(); List list = new Gson().fromJson(text, listType); - cache.put(uuid, list); return list; } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java index 516197c..e5fecc6 100644 --- a/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java +++ b/src/main/java/com/imaginarycode/minecraft/redisbungee/util/UUIDTranslator.java @@ -162,7 +162,7 @@ public final class UUIDTranslator { // That didn't work. Let's ask Mojang. This call may fail, because Mojang is insane. String name; try { - name = new NameFetcher(Collections.singletonList(player)).call().get(player); + name = NameFetcher.nameHistoryFromUuid(player).get(0); } catch (Exception e) { plugin.getLogger().log(Level.SEVERE, "Unable to fetch name from Mojang for " + player, e); return null;