From 975fa80b0c24fcc16692eb547cba30095500cfe0 Mon Sep 17 00:00:00 2001 From: HacktheTime Date: Thu, 22 Aug 2024 19:59:47 +0200 Subject: [PATCH 1/4] added Garden API Path --- .../main/java/net/hypixel/api/HypixelAPI.java | 10 ++++++++ .../reply/skyblock/SkyBlockGardenReply.java | 24 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockGardenReply.java 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 942cf1b9..f8c7cde0 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 @@ -208,6 +208,16 @@ public CompletableFuture getPetRepository() { .thenApply(PetRepositoryImpl::new); } + /** + * @param profile Profile ID of which you are requesting the Garden for. + * @return the future + */ + public CompletableFuture getSkyBlockGarden(String profile) { + return get(true, SkyBlockGardenReply.class, "skyblock/garden", + HTTPQueryParams.create() + .add("profile", profile) + ); + } public CompletableFuture getSkyBlockProfile(String profile) { return get(true, SkyBlockProfileReply.class, "skyblock/profile", HTTPQueryParams.create() diff --git a/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockGardenReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockGardenReply.java new file mode 100644 index 00000000..3367fa97 --- /dev/null +++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockGardenReply.java @@ -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(); + } +} From 376dff6b96ba23b5ffd432784239c445bd3127ae Mon Sep 17 00:00:00 2001 From: HacktheTime Date: Wed, 4 Sep 2024 09:00:23 +0200 Subject: [PATCH 2/4] added Museum API Path --- .../main/java/net/hypixel/api/HypixelAPI.java | 12 ++++++++++ .../reply/skyblock/SkyBlockMuseumReply.java | 24 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java 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 f8c7cde0..37f7784b 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 @@ -218,6 +218,18 @@ public CompletableFuture getSkyBlockGarden(String profile) .add("profile", profile) ); } + + /** + * @param profile Profile ID of which you are requesting the Museum for. + * @return the future + */ + public CompletableFuture getSkyblockMuseum(String profile) { + return get(true, SkyBlockMuseumReply.class, "skyblock/museum", + HTTPQueryParams.create() + .add("profile", profile) + ); + } + public CompletableFuture getSkyBlockProfile(String profile) { return get(true, SkyBlockProfileReply.class, "skyblock/profile", HTTPQueryParams.create() diff --git a/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java new file mode 100644 index 00000000..6950c78a --- /dev/null +++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java @@ -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 museum; + + public JsonObject getGarden() { + if (museum == null || museum.isJsonNull()) { + return null; + } else { + return museum.getAsJsonObject(); + } + } + + @Override + public String toString() { + return "SkyBlockMuseumReply{" + + "profile=" + museum + + "} " + super.toString(); + } +} From 56fa07f33352f5d27c11ba27fee5afddca8a9859 Mon Sep 17 00:00:00 2001 From: HacktheTime Date: Thu, 5 Sep 2024 18:51:29 +0200 Subject: [PATCH 3/4] fixed method name saying getGarden instead of getMuseum --- .../net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java index 6950c78a..ae56a9a4 100644 --- a/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java +++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java @@ -7,7 +7,7 @@ public class SkyBlockMuseumReply extends RateLimitedReply { private JsonElement museum; - public JsonObject getGarden() { + public JsonObject getMuseum() { if (museum == null || museum.isJsonNull()) { return null; } else { From 85d537d149af96298bd26f29dea941e17573fe0c Mon Sep 17 00:00:00 2001 From: HacktheTime Date: Thu, 5 Sep 2024 22:25:47 +0200 Subject: [PATCH 4/4] possible bug fix for museum --- .../hypixel/api/reply/skyblock/SkyBlockMuseumReply.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java index ae56a9a4..137477f9 100644 --- a/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java +++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockMuseumReply.java @@ -5,20 +5,20 @@ import net.hypixel.api.reply.RateLimitedReply; public class SkyBlockMuseumReply extends RateLimitedReply { - private JsonElement museum; + private JsonElement members; public JsonObject getMuseum() { - if (museum == null || museum.isJsonNull()) { + if (members == null || members.isJsonNull()) { return null; } else { - return museum.getAsJsonObject(); + return members.getAsJsonObject(); } } @Override public String toString() { return "SkyBlockMuseumReply{" + - "profile=" + museum + + "profile=" + members + "} " + super.toString(); } }