mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-04-20 01:27:07 +00:00
Add NameFetcher#nameHistoryFromUuid for backward-compatibility
This commit is contained in:
parent
f598f5bf2d
commit
161eb5d136
@ -17,6 +17,8 @@ import com.squareup.okhttp.Request;
|
|||||||
import com.squareup.okhttp.ResponseBody;
|
import com.squareup.okhttp.ResponseBody;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class NameFetcher {
|
public class NameFetcher {
|
||||||
@ -27,6 +29,12 @@ public class NameFetcher {
|
|||||||
NameFetcher.httpClient = httpClient;
|
NameFetcher.httpClient = httpClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<String> nameHistoryFromUuid(UUID uuid) throws IOException {
|
||||||
|
String name = getName(uuid);
|
||||||
|
if (name == null) return Collections.emptyList();
|
||||||
|
return Collections.singletonList(name);
|
||||||
|
}
|
||||||
|
|
||||||
public static String getName(UUID uuid) throws IOException {
|
public static String getName(UUID uuid) throws IOException {
|
||||||
String url = "https://playerdb.co/api/player/minecraft/" + uuid.toString();
|
String url = "https://playerdb.co/api/player/minecraft/" + uuid.toString();
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
|
Loading…
Reference in New Issue
Block a user