diff --git a/hypixel-api-core/src/main/java/net/hypixel/api/HypixelAPI.java b/hypixel-api-core/src/main/java/net/hypixel/api/HypixelAPI.java index 8483187a..1bd195e5 100644 --- a/hypixel-api-core/src/main/java/net/hypixel/api/HypixelAPI.java +++ b/hypixel-api-core/src/main/java/net/hypixel/api/HypixelAPI.java @@ -215,6 +215,28 @@ public CompletableFuture getSkyBlockProfile(String profile ); } + /** + * @param player uuid of a player. + * @return the future + */ + public CompletableFuture getSkyBlockProfiles(UUID player) { + return get(SkyBlockProfilesReply.class, "skyblock/profiles", + HTTPQueryParams.create() + .add("uuid", player) + ); + } + + /** + * @param player uuid of a player in string format, can be both dashed or undashed. + * @return the future + */ + public CompletableFuture getSkyBlockProfiles(String player) { + return get(SkyBlockProfilesReply.class, "skyblock/profiles", + HTTPQueryParams.create() + .add("uuid", player) + ); + } + public CompletableFuture getSkyBlockNews() { return get(SkyBlockNewsReply.class, "skyblock/news"); } diff --git a/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockProfilesReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockProfilesReply.java new file mode 100644 index 00000000..0e5b1923 --- /dev/null +++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockProfilesReply.java @@ -0,0 +1,24 @@ +package net.hypixel.api.reply.skyblock; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import net.hypixel.api.reply.AbstractReply; + +public class SkyBlockProfilesReply extends AbstractReply { + private JsonElement profiles; + + public JsonArray getProfiles() { + if (profiles == null || profiles.isJsonNull()) { + return null; + } else { + return profiles.getAsJsonArray(); + } + } + + @Override + public String toString() { + return "SkyBlockProfilesReply{" + + "profiles=" + profiles + + "} " + super.toString(); + } +} diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockProfilesExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockProfilesExample.java new file mode 100644 index 00000000..feecad85 --- /dev/null +++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockProfilesExample.java @@ -0,0 +1,10 @@ +package net.hypixel.api.example.skyblock; + +import net.hypixel.api.example.ExampleUtil; + +public class GetSkyBlockProfilesExample { + public static void main(String[] args) { + ExampleUtil.API.getSkyBlockProfiles(ExampleUtil.HYPIXEL).whenComplete(ExampleUtil.getTestConsumer()); + ExampleUtil.await(); + } +}