fix(mojang api): use new endpoint for Username->UUID resolution

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle
2025-07-26 18:41:34 +05:00
parent b90cda5eef
commit eefe0375af
2 changed files with 2 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ import java.util.Map;
@SuppressWarnings("unchecked")
public final class MojangApi {
public static String getUuid(String username) throws IOException {
try (InputStream in = new URL("https://api.mojang.com/users/profiles/minecraft/" + username).openStream()) {
try (InputStream in = new URL("https://api.minecraftservices.com/minecraft/profile/lookup/name/" + username).openStream()) {
Map<String, Object> map = (Map<String, Object>) JsonParser.parse(in);
return (String) map.get("id");
}