Skip to content

Commit 975fa80

Browse files
committed
added Garden API Path
1 parent d9abe68 commit 975fa80

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

hypixel-api-core/src/main/java/net/hypixel/api/HypixelAPI.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,16 @@ public CompletableFuture<IPetRepository> getPetRepository() {
208208
.thenApply(PetRepositoryImpl::new);
209209
}
210210

211+
/**
212+
* @param profile Profile ID of which you are requesting the Garden for.
213+
* @return the future
214+
*/
215+
public CompletableFuture<SkyBlockGardenReply> getSkyBlockGarden(String profile) {
216+
return get(true, SkyBlockGardenReply.class, "skyblock/garden",
217+
HTTPQueryParams.create()
218+
.add("profile", profile)
219+
);
220+
}
211221
public CompletableFuture<SkyBlockProfileReply> getSkyBlockProfile(String profile) {
212222
return get(true, SkyBlockProfileReply.class, "skyblock/profile",
213223
HTTPQueryParams.create()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package net.hypixel.api.reply.skyblock;
2+
3+
import com.google.gson.JsonElement;
4+
import com.google.gson.JsonObject;
5+
import net.hypixel.api.reply.RateLimitedReply;
6+
7+
public class SkyBlockGardenReply extends RateLimitedReply {
8+
private JsonElement garden;
9+
10+
public JsonObject getGarden() {
11+
if (garden == null || garden.isJsonNull()) {
12+
return null;
13+
} else {
14+
return garden.getAsJsonObject();
15+
}
16+
}
17+
18+
@Override
19+
public String toString() {
20+
return "SkyBlockGardenReply{" +
21+
"profile=" + garden +
22+
"} " + super.toString();
23+
}
24+
}

0 commit comments

Comments
 (0)