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!
This commit is contained in:
libraryaddict 2014-04-09 04:16:49 +12:00
parent 5ab3061b20
commit 9e72e77c66

View File

@ -318,15 +318,9 @@ public class DisguiseUtilities {
final HashMap<String, UUID> map = fetcher.call(); final HashMap<String, UUID> map = fetcher.call();
Bukkit.getScheduler().scheduleSyncDelayedTask(libsDisguises, new Runnable() { Bukkit.getScheduler().scheduleSyncDelayedTask(libsDisguises, new Runnable() {
public void run() { public void run() {
if (!map.containsKey(playerName)) { if (map.containsKey(playerName)) {
if (namesUuids.containsKey(playerName) && namesUuids.get(playerName) == null) { if (namesUuids.containsKey(playerName) && namesUuids.get(playerName) == null) {
namesUuids.remove(playerName); namesUuids.put(playerName, map.get(playerName).toString());
}
} else {
for (String name : map.keySet()) {
if (namesUuids.containsKey(name) && namesUuids.get(name) == null) {
namesUuids.put(name, map.get(name).toString());
}
} }
if (DisguiseUtilities.isDisguiseInUse(disguise)) { if (DisguiseUtilities.isDisguiseInUse(disguise)) {
DisguiseUtilities.refreshTrackers((TargetedDisguise) disguise); DisguiseUtilities.refreshTrackers((TargetedDisguise) disguise);