Added helper method for checking offline UUID's.

This commit is contained in:
Aust1n46 2021-02-12 16:39:33 -06:00
parent bd6c5d0987
commit ffc54bebaf

View File

@ -93,4 +93,13 @@ public class UUIDFetcher implements Callable<Map<String, UUID>> { //unimplemente
public static UUID getUUIDOf(String name) throws Exception { public static UUID getUUIDOf(String name) throws Exception {
return new UUIDFetcher(Arrays.asList(name)).call().get(name); return new UUIDFetcher(Arrays.asList(name)).call().get(name);
} }
}
/**
* Returns whether the passed UUID is a v3 UUID. Offline UUIDs are v3, online are v4.
* @param uuid the UUID to check
* @return whether the UUID is a v3 UUID & thus is offline
*/
public static boolean uuidIsOffline(UUID uuid) {
return uuid.version() == 3;
}
}