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
2 changed files with 2 additions and 2 deletions
|
@ -446,7 +446,7 @@ void SkinManageDialog::on_userBtn_clicked()
|
||||||
auto uuidLoop = makeShared<WaitTask>();
|
auto uuidLoop = makeShared<WaitTask>();
|
||||||
auto profileLoop = 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 getProfile = Net::Download::makeByteArray(QUrl(), profileOut);
|
||||||
auto downloadSkin = Net::Download::makeFile(QUrl(), path);
|
auto downloadSkin = Net::Download::makeFile(QUrl(), path);
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ import java.util.Map;
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final class MojangApi {
|
public final class MojangApi {
|
||||||
public static String getUuid(String username) throws IOException {
|
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);
|
Map<String, Object> map = (Map<String, Object>) JsonParser.parse(in);
|
||||||
return (String) map.get("id");
|
return (String) map.get("id");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue