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
27 changes: 27 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 @@ -9,6 +9,7 @@
import net.hypixel.api.http.HypixelHttpResponse;
import net.hypixel.api.reply.*;
import net.hypixel.api.reply.skyblock.*;
import net.hypixel.api.reply.skyblock.bingo.SkyBlockBingoDataReply;
import net.hypixel.api.util.PropertyFilter;
import net.hypixel.api.util.ResourceType;
import net.hypixel.api.util.Utilities;
Expand Down Expand Up @@ -250,6 +251,32 @@ public CompletableFuture<SkyBlockProfilesReply> getSkyBlockProfiles(String playe
);
}

/**
* Request the bingo data of a provided player. See <a href="https://api.hypixel.net/#tag/SkyBlock/paths/~1skyblock~1bingo/get">/skyblock/bingo</a>
*
* @param player uuid of a player.
* @return CompletableFuture containing a {@link SkyBlockBingoDataReply}
*/
public CompletableFuture<SkyBlockBingoDataReply> getSkyblockBingoData(UUID player) {
return get(SkyBlockBingoDataReply.class, "skyblock/bingo",
HTTPQueryParams.create()
.add("uuid", player)
);
}

/**
* Request the bingo data of a provided player. See <a href="https://api.hypixel.net/#tag/SkyBlock/paths/~1skyblock~1bingo/get">/skyblock/bingo</a>
*
* @param player uuid of a player in string format, can be both dashed or undashed.
* @return CompletableFuture containing a {@link SkyBlockBingoDataReply}
*/
public CompletableFuture<SkyBlockBingoDataReply> getSkyblockBingoData(String player) {
return get(SkyBlockBingoDataReply.class, "skyblock/bingo",
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,33 @@
package net.hypixel.api.reply.skyblock.bingo;

import com.google.gson.annotations.SerializedName;

import java.util.List;

public class BingoEventData {
private int key;
private int points;
@SerializedName("completed_goals")
private List<String> completedGoals;

public int getKey() {
return key;
}

public int getPoints() {
return points;
}

public List<String> getCompletedGoals() {
return completedGoals;
}

@Override
public String toString() {
return "BingoEventData{" +
"key=" + key +
", points=" + points +
", completedGoals=" + completedGoals +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.hypixel.api.reply.skyblock.bingo;

import net.hypixel.api.reply.AbstractReply;

import java.util.List;

public class SkyBlockBingoDataReply extends AbstractReply {
private List<BingoEventData> events;

public List<BingoEventData> getEvents() {
return events;
}

@Override
public String toString() {
return "SkyBlockBingoPlayerDataReply{" +
"events=" + events +
"} " + 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 GetSkyBlockBingoDataExample {
public static void main(String[] args) {
ExampleUtil.API.getSkyblockBingoData(ExampleUtil.HYPIXEL).whenComplete(ExampleUtil.getTestConsumer());
ExampleUtil.await();
}
}