Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Garden & Museum API Path #666

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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 @@ -208,6 +208,28 @@ public CompletableFuture<IPetRepository> getPetRepository() {
.thenApply(PetRepositoryImpl::new);
}

/**
* @param profile Profile ID of which you are requesting the Garden for.
* @return the future
*/
public CompletableFuture<SkyBlockGardenReply> getSkyBlockGarden(String profile) {
return get(true, SkyBlockGardenReply.class, "skyblock/garden",
HTTPQueryParams.create()
.add("profile", profile)
);
}

/**
* @param profile Profile ID of which you are requesting the Museum for.
* @return the future
*/
public CompletableFuture<SkyBlockMuseumReply> getSkyblockMuseum(String profile) {
return get(true, SkyBlockMuseumReply.class, "skyblock/museum",
HTTPQueryParams.create()
.add("profile", profile)
);
}

public CompletableFuture<SkyBlockProfileReply> getSkyBlockProfile(String profile) {
return get(true, SkyBlockProfileReply.class, "skyblock/profile",
HTTPQueryParams.create()
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.JsonElement;
import com.google.gson.JsonObject;
import net.hypixel.api.reply.RateLimitedReply;

public class SkyBlockGardenReply extends RateLimitedReply {
private JsonElement garden;

public JsonObject getGarden() {
if (garden == null || garden.isJsonNull()) {
return null;
} else {
return garden.getAsJsonObject();
}
}

@Override
public String toString() {
return "SkyBlockGardenReply{" +
"profile=" + garden +
"} " + super.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package net.hypixel.api.reply.skyblock;

import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import net.hypixel.api.reply.RateLimitedReply;

public class SkyBlockMuseumReply extends RateLimitedReply {
private JsonElement members;

public JsonObject getMuseum() {
if (members == null || members.isJsonNull()) {
return null;
} else {
return members.getAsJsonObject();
}
}

@Override
public String toString() {
return "SkyBlockMuseumReply{" +
"profile=" + members +
"} " + super.toString();
}
}