mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 14:38:51 +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 {
|
try {
|
||||||
final @Nullable JsonObject json = this.queryMojang(new URI("https://api.mojang.com/users/profiles/minecraft/" + username));
|
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) {
|
} catch (final URISyntaxException exception) {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -188,8 +188,7 @@ public final class CarbonServerVelocity implements CarbonServer, ForwardingAudie
|
|||||||
this.client.send(request, HttpResponse.BodyHandlers.ofString());
|
this.client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||||
final String mojangResponse = response.body();
|
final String mojangResponse = response.body();
|
||||||
|
|
||||||
final JsonArray jsonArray = this.gson.fromJson(mojangResponse, JsonObject.class).getAsJsonArray();
|
return this.gson.fromJson(mojangResponse, JsonObject.class);
|
||||||
return (JsonObject) jsonArray.get(1);
|
|
||||||
} catch (IOException | InterruptedException e) {
|
} catch (IOException | InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in new issue
Block a user