mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-08-03 03:17:22 -04:00
fix(mojang api): use new endpoint for Username->UUID resolution
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
b90cda5eef
commit
eefe0375af
@ -446,7 +446,7 @@ void SkinManageDialog::on_userBtn_clicked()
|
||||
auto uuidLoop = makeShared<WaitTask>();
|
||||
auto profileLoop = makeShared<WaitTask>();
|
||||
|
||||
auto getUUID = Net::Download::makeByteArray("https://api.mojang.com/users/profiles/minecraft/" + user, uuidOut);
|
||||
auto getUUID = Net::Download::makeByteArray("https://api.minecraftservices.com/minecraft/profile/lookup/name/" + user, uuidOut);
|
||||
auto getProfile = Net::Download::makeByteArray(QUrl(), profileOut);
|
||||
auto downloadSkin = Net::Download::makeFile(QUrl(), path);
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user