Fix third party profile parsing
This commit is contained in:
1 parent
642c1621ad
commit
5f9802d589
3 files changed
+22
-4
No files matched your search
@@ -69,8 +69,17 @@ public class MojangApiBukkit extends MojangApiConnector {
|
||||
|
||||
@Override
|
||||
protected UUID getUUIDFromJson(String json) {
|
||||
JSONObject userData = (JSONObject) JSONValue.parse(json);
|
||||
String uuid = (String) userData.get("id");
|
||||
boolean isArray = json.startsWith("[");
|
||||
|
||||
JSONObject mojangPlayer;
|
||||
if (isArray) {
|
||||
JSONArray array = (JSONArray) JSONValue.parse(json);
|
||||
mojangPlayer = (JSONObject) array.get(0);
|
||||
} else {
|
||||
mojangPlayer = (JSONObject) JSONValue.parse(json);
|
||||
}
|
||||
|
||||
String uuid = (String) mojangPlayer.get("id");
|
||||
return FastLoginCore.parseId(uuid);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user