-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UUID lookup is not working on MC 1.20.4+ (#232)
- Loading branch information
1 parent
da91095
commit 18d708d
Showing
1 changed file
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (C) 2020 Haowei Wen <[email protected]> and contributors | ||
* Copyright (C) 2024 Haowei Wen <[email protected]> and contributors | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
|
@@ -49,12 +49,15 @@ public QueryUUIDsFilter(YggdrasilClient mojangClient, YggdrasilClient customClie | |
|
||
@Override | ||
public boolean canHandle(String domain) { | ||
return domain.equals("api.mojang.com"); | ||
return domain.equals("api.mojang.com") || domain.equals("api.minecraftservices.com"); | ||
} | ||
|
||
@Override | ||
public Optional<Response> handle(String domain, String path, IHTTPSession session) throws IOException { | ||
if (domain.equals("api.mojang.com") && path.equals("/profiles/minecraft") && session.getMethod().equals("POST")) { | ||
if ( | ||
(domain.equals("api.mojang.com") && path.equals("/profiles/minecraft") && session.getMethod().equals("POST")) || | ||
(domain.equals("api.minecraftservices.com") && path.equals("/minecraft/profile/lookup/bulk/byname") && session.getMethod().equals("POST")) | ||
) { | ||
Set<String> request = new LinkedHashSet<>(); | ||
asJsonArray(parseJson(asString(asBytes(session.getInputStream())))) | ||
.forEach(element -> request.add(asJsonString(element))); | ||
|