mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
maybe fix velocity query exception
This commit is contained in:
1 file changed
+2
-3
@@ -147,7 +147,7 @@ public final class CarbonServerVelocity implements CarbonServer, ForwardingAudie
|
||||
try {
|
||||
final @Nullable JsonObject json = this.queryMojang(new URI("https://api.mojang.com/users/profiles/minecraft/" + username));
|
||||
|
||||
return FastUuidSansHyphens.parseUuid(json.get("uuid").getAsString());
|
||||
return FastUuidSansHyphens.parseUuid(json.get("id").getAsString());
|
||||
} catch (final URISyntaxException exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
@@ -188,8 +188,7 @@ public final class CarbonServerVelocity implements CarbonServer, ForwardingAudie
|
||||
this.client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
final String mojangResponse = response.body();
|
||||
|
||||
final JsonArray jsonArray = this.gson.fromJson(mojangResponse, JsonObject.class).getAsJsonArray();
|
||||
return (JsonObject) jsonArray.get(1);
|
||||
return this.gson.fromJson(mojangResponse, JsonObject.class);
|
||||
} catch (IOException | InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user