Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions hypixel-api-core/src/main/java/net/hypixel/api/HypixelAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,28 @@ public CompletableFuture<SkyBlockProfileReply> getSkyBlockProfile(String profile
);
}

/**
* @param player uuid of a player.
* @return the future
*/
public CompletableFuture<SkyBlockProfilesReply> 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<SkyBlockProfilesReply> getSkyBlockProfiles(String player) {
return get(SkyBlockProfilesReply.class, "skyblock/profiles",
HTTPQueryParams.create()
.add("uuid", player)
);
}

public CompletableFuture<SkyBlockNewsReply> getSkyBlockNews() {
return get(SkyBlockNewsReply.class, "skyblock/news");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -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();
}
}