mirror of
https://github.com/TotalFreedomMC/OpenInv.git
synced 2024-12-22 16:05:03 +00:00
Reworked UUID logic
This commit is contained in:
parent
4f40459b96
commit
e4c23a777e
1 changed files with 10 additions and 20 deletions
|
@ -40,33 +40,23 @@ public class UUIDUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UUID getUUIDOf(String name) {
|
public static UUID getUUIDOf(String name) {
|
||||||
UUID uuid;
|
|
||||||
Player player = getPlayer(name);
|
Player player = getPlayer(name);
|
||||||
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
uuid = player.getUniqueId();
|
return player.getUniqueId();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (Bukkit.getServer().getOnlineMode()) {
|
|
||||||
if (!Bukkit.getServer().isPrimaryThread()) {
|
|
||||||
UUIDFetcher fetcher = new UUIDFetcher(Arrays.asList(name));
|
|
||||||
Map<String, UUID> response;
|
|
||||||
|
|
||||||
try {
|
if (Bukkit.getServer().getOnlineMode() && !Bukkit.getServer().isPrimaryThread()) {
|
||||||
response = fetcher.call();
|
UUIDFetcher fetcher = new UUIDFetcher(Arrays.asList(name));
|
||||||
uuid = response.get(name.toLowerCase());
|
try {
|
||||||
}
|
Map<String, UUID> response = fetcher.call();
|
||||||
catch (Exception e) {
|
return response.get(name.toLowerCase());
|
||||||
uuid = getUUIDLocally(name);
|
}
|
||||||
}
|
catch (Exception ignored) {
|
||||||
} else {
|
//Fallthrough to end of method
|
||||||
uuid = getUUIDLocally(name);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uuid = getUUIDLocally(name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return uuid;
|
return getUUIDLocally(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue