From 9e72e77c664aee530c136173b2093037c88e81a5 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 9 Apr 2014 04:16:49 +1200 Subject: [PATCH] Read desc Wait. If the disguise is not able to fetch a UUID. Don't bother making the lookup happen again when someone sees it again. Also, we only cares about one name. The name we called the fetcher with! --- .../disguise/utilities/DisguiseUtilities.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 3e53c74a..e523860e 100644 --- a/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -318,15 +318,9 @@ public class DisguiseUtilities { final HashMap map = fetcher.call(); Bukkit.getScheduler().scheduleSyncDelayedTask(libsDisguises, new Runnable() { public void run() { - if (!map.containsKey(playerName)) { + if (map.containsKey(playerName)) { if (namesUuids.containsKey(playerName) && namesUuids.get(playerName) == null) { - namesUuids.remove(playerName); - } - } else { - for (String name : map.keySet()) { - if (namesUuids.containsKey(name) && namesUuids.get(name) == null) { - namesUuids.put(name, map.get(name).toString()); - } + namesUuids.put(playerName, map.get(playerName).toString()); } if (DisguiseUtilities.isDisguiseInUse(disguise)) { DisguiseUtilities.refreshTrackers((TargetedDisguise) disguise);