games;
private int playerCount;
diff --git a/Java/src/main/java/net/hypixel/api/reply/FindGuildReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/FindGuildReply.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/reply/FindGuildReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/FindGuildReply.java
diff --git a/Java/src/main/java/net/hypixel/api/reply/FriendsReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/FriendsReply.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/reply/FriendsReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/FriendsReply.java
diff --git a/Java/src/main/java/net/hypixel/api/reply/GuildReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/GuildReply.java
similarity index 98%
rename from Java/src/main/java/net/hypixel/api/reply/GuildReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/GuildReply.java
index 3eef7a21..862079f4 100644
--- a/Java/src/main/java/net/hypixel/api/reply/GuildReply.java
+++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/GuildReply.java
@@ -113,7 +113,7 @@ public String toString() {
'}';
}
- public class Member {
+ public static class Member {
private UUID uuid;
private String rank;
private ZonedDateTime joined;
diff --git a/Java/src/main/java/net/hypixel/api/reply/KeyReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/KeyReply.java
similarity index 99%
rename from Java/src/main/java/net/hypixel/api/reply/KeyReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/KeyReply.java
index be90dea2..26654ab8 100644
--- a/Java/src/main/java/net/hypixel/api/reply/KeyReply.java
+++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/KeyReply.java
@@ -1,6 +1,7 @@
package net.hypixel.api.reply;
import com.google.gson.annotations.SerializedName;
+
import java.util.UUID;
public class KeyReply extends AbstractReply {
diff --git a/Java/src/main/java/net/hypixel/api/reply/LeaderboardsReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/LeaderboardsReply.java
similarity index 97%
rename from Java/src/main/java/net/hypixel/api/reply/LeaderboardsReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/LeaderboardsReply.java
index fe2e6b8b..74e7d45e 100644
--- a/Java/src/main/java/net/hypixel/api/reply/LeaderboardsReply.java
+++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/LeaderboardsReply.java
@@ -1,6 +1,6 @@
package net.hypixel.api.reply;
-import net.hypixel.api.util.GameType;
+import net.hypixel.api.data.type.GameType;
import java.util.List;
import java.util.Map;
diff --git a/Java/src/main/java/net/hypixel/api/reply/PlayerReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/PlayerReply.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/reply/PlayerReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/PlayerReply.java
diff --git a/Java/src/main/java/net/hypixel/api/reply/WatchdogStatsReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/PunishmentStatsReply.java
similarity index 95%
rename from Java/src/main/java/net/hypixel/api/reply/WatchdogStatsReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/PunishmentStatsReply.java
index 5b0bc5bd..cbe7567e 100644
--- a/Java/src/main/java/net/hypixel/api/reply/WatchdogStatsReply.java
+++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/PunishmentStatsReply.java
@@ -2,7 +2,7 @@
import com.google.gson.annotations.SerializedName;
-public class WatchdogStatsReply extends AbstractReply {
+public class PunishmentStatsReply extends AbstractReply {
@SerializedName("staff_rollingDaily")
private int staffRollingDaily;
@SerializedName("staff_total")
diff --git a/Java/src/main/java/net/hypixel/api/reply/RecentGamesReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/RecentGamesReply.java
similarity index 95%
rename from Java/src/main/java/net/hypixel/api/reply/RecentGamesReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/RecentGamesReply.java
index 5c4a82ee..ecac2e54 100644
--- a/Java/src/main/java/net/hypixel/api/reply/RecentGamesReply.java
+++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/RecentGamesReply.java
@@ -1,8 +1,9 @@
package net.hypixel.api.reply;
+import net.hypixel.api.data.type.GameType;
+
import java.time.ZonedDateTime;
import java.util.List;
-import net.hypixel.api.util.GameType;
public class RecentGamesReply extends AbstractReply {
@@ -40,7 +41,7 @@ public ZonedDateTime getStartDate() {
/**
* @return Game played during this session
- * @see net.hypixel.api.util.GameType
+ * @see GameType
*/
public GameType getGameType() {
return gameType;
diff --git a/Java/src/main/java/net/hypixel/api/reply/StatusReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/StatusReply.java
similarity index 76%
rename from Java/src/main/java/net/hypixel/api/reply/StatusReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/StatusReply.java
index e8f48245..5aaee3f7 100644
--- a/Java/src/main/java/net/hypixel/api/reply/StatusReply.java
+++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/StatusReply.java
@@ -1,8 +1,7 @@
package net.hypixel.api.reply;
-import net.hypixel.api.util.GameType;
-
-import java.util.Optional;
+import com.google.gson.annotations.SerializedName;
+import net.hypixel.api.data.type.ServerType;
public class StatusReply extends AbstractReply {
@@ -23,7 +22,7 @@ public String toString() {
"} " + super.toString();
}
- public class Session {
+ public static class Session {
/**
* Boolean if player is online.
@@ -32,12 +31,12 @@ public class Session {
private boolean online;
/**
- * GameType could be null if a new game has been released
- * and GameType is not yet added to {@link GameType}.
+ * ServerType could be null if a new game/lobby has been released and type is not yet added.
*
* This will NOT throw an exception.
*/
- private GameType gameType;
+ @SerializedName("gameType")
+ private ServerType serverType;
/**
* Mode of game being played
@@ -55,8 +54,8 @@ public boolean isOnline() {
return online;
}
- public GameType getGameType() {
- return gameType;
+ public ServerType getServerType() {
+ return serverType;
}
public String getMode() {
@@ -71,7 +70,7 @@ public String getMap() {
public String toString() {
return "Session{" +
"online=" + online +
- ", gameType=" + gameType +
+ ", serverType=" + serverType +
", mode=" + mode +
", map=" + map +
"}";
diff --git a/Java/src/main/java/net/hypixel/api/reply/skyblock/ResourceReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/ResourceReply.java
similarity index 93%
rename from Java/src/main/java/net/hypixel/api/reply/skyblock/ResourceReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/ResourceReply.java
index 438c7265..ff2f0b29 100644
--- a/Java/src/main/java/net/hypixel/api/reply/skyblock/ResourceReply.java
+++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/ResourceReply.java
@@ -5,8 +5,8 @@
public class ResourceReply extends AbstractReply {
- private long lastUpdated;
- private JsonObject response;
+ private final long lastUpdated;
+ private final JsonObject response;
public ResourceReply(JsonObject response) {
this.response = response;
@@ -26,6 +26,7 @@ public JsonObject getResponse() {
/**
* Gets unix time when the resource was updated.
* Will return -1 if last updated was not included in response
+ *
* @return long unix time
*/
public long getLastUpdated() {
diff --git a/Java/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockAuctionsReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockAuctionsReply.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockAuctionsReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockAuctionsReply.java
diff --git a/Java/src/main/java/net/hypixel/api/reply/skyblock/BazaarReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockBazaarReply.java
similarity index 84%
rename from Java/src/main/java/net/hypixel/api/reply/skyblock/BazaarReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockBazaarReply.java
index ae9e2f36..6e18d051 100644
--- a/Java/src/main/java/net/hypixel/api/reply/skyblock/BazaarReply.java
+++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockBazaarReply.java
@@ -6,7 +6,7 @@
import java.util.List;
import java.util.Map;
-public class BazaarReply extends AbstractReply {
+public class SkyBlockBazaarReply extends AbstractReply {
private long lastUpdated;
private Map products;
@@ -76,11 +76,11 @@ public String toString() {
public class Summary {
- private int amount;
+ private long amount;
private double pricePerUnit;
- private int orders;
+ private long orders;
- public int getAmount() {
+ public long getAmount() {
return amount;
}
@@ -88,7 +88,7 @@ public double getPricePerUnit() {
return pricePerUnit;
}
- public int getOrders() {
+ public long getOrders() {
return orders;
}
@@ -105,22 +105,14 @@ public String toString() {
public class Status {
private String productId;
-
private double sellPrice;
-
- private int sellVolume;
-
- private int sellMovingWeek;
-
- private int sellOrders;
-
+ private long sellVolume;
+ private long sellMovingWeek;
+ private long sellOrders;
private double buyPrice;
-
- private int buyVolume;
-
- private int buyMovingWeek;
-
- private int buyOrders;
+ private long buyVolume;
+ private long buyMovingWeek;
+ private long buyOrders;
public String getProductId() {
return productId;
@@ -130,15 +122,15 @@ public double getSellPrice() {
return sellPrice;
}
- public int getSellVolume() {
+ public long getSellVolume() {
return sellVolume;
}
- public int getSellMovingWeek() {
+ public long getSellMovingWeek() {
return sellMovingWeek;
}
- public int getSellOrders() {
+ public long getSellOrders() {
return sellOrders;
}
@@ -146,15 +138,15 @@ public double getBuyPrice() {
return buyPrice;
}
- public int getBuyVolume() {
+ public long getBuyVolume() {
return buyVolume;
}
- public int getBuyMovingWeek() {
+ public long getBuyMovingWeek() {
return buyMovingWeek;
}
- public int getBuyOrders() {
+ public long getBuyOrders() {
return buyOrders;
}
diff --git a/Java/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockNewsReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockNewsReply.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockNewsReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockNewsReply.java
index 6bfd7bad..d1942496 100644
--- a/Java/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockNewsReply.java
+++ b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockNewsReply.java
@@ -1,7 +1,7 @@
package net.hypixel.api.reply.skyblock;
-import com.google.gson.JsonElement;
import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
import net.hypixel.api.reply.AbstractReply;
public class SkyBlockNewsReply extends AbstractReply {
diff --git a/Java/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockProfileReply.java b/hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockProfileReply.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockProfileReply.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/reply/skyblock/SkyBlockProfileReply.java
diff --git a/Java/src/main/java/net/hypixel/api/util/Banner.java b/hypixel-api-core/src/main/java/net/hypixel/api/util/Banner.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/util/Banner.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/util/Banner.java
diff --git a/Java/src/main/java/net/hypixel/api/util/ILeveling.java b/hypixel-api-core/src/main/java/net/hypixel/api/util/ILeveling.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/util/ILeveling.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/util/ILeveling.java
diff --git a/Java/src/main/java/net/hypixel/api/util/Rarity.java b/hypixel-api-core/src/main/java/net/hypixel/api/util/Rarity.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/util/Rarity.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/util/Rarity.java
diff --git a/Java/src/main/java/net/hypixel/api/util/ResourceType.java b/hypixel-api-core/src/main/java/net/hypixel/api/util/ResourceType.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/util/ResourceType.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/util/ResourceType.java
diff --git a/Java/src/main/java/net/hypixel/api/util/Utilities.java b/hypixel-api-core/src/main/java/net/hypixel/api/util/Utilities.java
similarity index 100%
rename from Java/src/main/java/net/hypixel/api/util/Utilities.java
rename to hypixel-api-core/src/main/java/net/hypixel/api/util/Utilities.java
diff --git a/hypixel-api-example/README.md b/hypixel-api-example/README.md
new file mode 100644
index 00000000..417f1b68
--- /dev/null
+++ b/hypixel-api-example/README.md
@@ -0,0 +1,3 @@
+# HypixelAPI Java Examples
+
+This codebase serves as examples for how to integrate the HypixelAPI into your project.
\ No newline at end of file
diff --git a/Example/pom.xml b/hypixel-api-example/pom.xml
similarity index 56%
rename from Example/pom.xml
rename to hypixel-api-example/pom.xml
index 7982fc48..8de6e66f 100644
--- a/Example/pom.xml
+++ b/hypixel-api-example/pom.xml
@@ -2,11 +2,14 @@
+
+ hypixel-api
+ net.hypixel
+ 4.0.0-SNAPSHOT
+
4.0.0
- Example
- net.hypixel
- 2.0.0
+ hypixel-api-example
true
@@ -25,18 +28,22 @@
-
-
- Hypixel
- https://repo.hypixel.net/repository/Hypixel/
-
-
-
net.hypixel
- HypixelAPI
- 3.0.0
+ hypixel-api-transport-apache
+ 4.0.0-SNAPSHOT
+
+
+ com.konghq
+ unirest-java
+ 3.11.09
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.13
-
+
+
\ No newline at end of file
diff --git a/Example/src/main/java/net/hypixel/example/ExampleUtil.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/ExampleUtil.java
similarity index 71%
rename from Example/src/main/java/net/hypixel/example/ExampleUtil.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/ExampleUtil.java
index cd7f810d..94190af6 100644
--- a/Example/src/main/java/net/hypixel/example/ExampleUtil.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/ExampleUtil.java
@@ -1,6 +1,7 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
import net.hypixel.api.HypixelAPI;
+import net.hypixel.api.apache.ApacheHttpClient;
import net.hypixel.api.reply.AbstractReply;
import java.util.UUID;
@@ -8,7 +9,12 @@
public class ExampleUtil {
- public static final HypixelAPI API = new HypixelAPI(UUID.fromString("64bd424e-ccb0-42ed-8b66-6e42a135afb4")); // arbitrary key, replace with your own to test
+ public static final HypixelAPI API;
+
+ static {
+ String key = System.getProperty("apiKey", "64bd424e-ccb0-42ed-8b66-6e42a135afb4"); // arbitrary key, replace with your own to test or use the property
+ API = new HypixelAPI(new ApacheHttpClient(UUID.fromString(key)));
+ }
public static final UUID HYPIXEL = UUID.fromString("f7c77d99-9f15-4a66-a87d-c4a51ef30d19");
diff --git a/Example/src/main/java/net/hypixel/example/GetBoostersExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetBoostersExample.java
similarity index 85%
rename from Example/src/main/java/net/hypixel/example/GetBoostersExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/GetBoostersExample.java
index 46b59b8a..190ccd78 100644
--- a/Example/src/main/java/net/hypixel/example/GetBoostersExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetBoostersExample.java
@@ -1,4 +1,4 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
public class GetBoostersExample {
public static void main(String[] args) {
diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetCountsExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetCountsExample.java
new file mode 100644
index 00000000..9f7f32c3
--- /dev/null
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetCountsExample.java
@@ -0,0 +1,8 @@
+package net.hypixel.api.example;
+
+public class GetCountsExample {
+ public static void main(String[] args) {
+ ExampleUtil.API.getCounts().whenComplete(ExampleUtil.getTestConsumer());
+ ExampleUtil.await();
+ }
+}
diff --git a/Example/src/main/java/net/hypixel/example/GetFriendsExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetFriendsExample.java
similarity index 86%
rename from Example/src/main/java/net/hypixel/example/GetFriendsExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/GetFriendsExample.java
index 5d6c3375..470ffac0 100644
--- a/Example/src/main/java/net/hypixel/example/GetFriendsExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetFriendsExample.java
@@ -1,4 +1,4 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
public class GetFriendsExample {
public static void main(String[] args) {
diff --git a/Example/src/main/java/net/hypixel/example/GetGuildExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
similarity index 87%
rename from Example/src/main/java/net/hypixel/example/GetGuildExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
index 394e1ebd..91997b7c 100644
--- a/Example/src/main/java/net/hypixel/example/GetGuildExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
@@ -1,4 +1,4 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
public class GetGuildExample {
public static void main(String[] args) {
diff --git a/Example/src/main/java/net/hypixel/example/GetLeaderboardsExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetLeaderboardsExample.java
similarity index 86%
rename from Example/src/main/java/net/hypixel/example/GetLeaderboardsExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/GetLeaderboardsExample.java
index 5ee203e6..cd7e5096 100644
--- a/Example/src/main/java/net/hypixel/example/GetLeaderboardsExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetLeaderboardsExample.java
@@ -1,4 +1,4 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
public class GetLeaderboardsExample {
public static void main(String[] args) {
diff --git a/Example/src/main/java/net/hypixel/example/GetPlayerExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPlayerExample.java
similarity index 87%
rename from Example/src/main/java/net/hypixel/example/GetPlayerExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/GetPlayerExample.java
index bb45390e..22ba58af 100644
--- a/Example/src/main/java/net/hypixel/example/GetPlayerExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPlayerExample.java
@@ -1,4 +1,4 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
public class GetPlayerExample {
public static void main(String[] args) {
diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPunishmentStatsExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPunishmentStatsExample.java
new file mode 100644
index 00000000..34574991
--- /dev/null
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPunishmentStatsExample.java
@@ -0,0 +1,8 @@
+package net.hypixel.api.example;
+
+public class GetPunishmentStatsExample {
+ public static void main(String[] args) {
+ ExampleUtil.API.getPunishmentStats().whenComplete(ExampleUtil.getTestConsumer());
+ ExampleUtil.await();
+ }
+}
diff --git a/Example/src/main/java/net/hypixel/example/GetRecentGamesExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetRecentGamesExample.java
similarity index 87%
rename from Example/src/main/java/net/hypixel/example/GetRecentGamesExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/GetRecentGamesExample.java
index 62fbcc07..9dd5ed75 100644
--- a/Example/src/main/java/net/hypixel/example/GetRecentGamesExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetRecentGamesExample.java
@@ -1,4 +1,4 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
public class GetRecentGamesExample {
diff --git a/Example/src/main/java/net/hypixel/example/GetResourceExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetResourceExample.java
similarity index 88%
rename from Example/src/main/java/net/hypixel/example/GetResourceExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/GetResourceExample.java
index a6108ed7..a5c58f43 100644
--- a/Example/src/main/java/net/hypixel/example/GetResourceExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetResourceExample.java
@@ -1,4 +1,4 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
import net.hypixel.api.util.ResourceType;
diff --git a/Example/src/main/java/net/hypixel/example/GetStatusExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetStatusExample.java
similarity index 91%
rename from Example/src/main/java/net/hypixel/example/GetStatusExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/GetStatusExample.java
index 96ab615d..39f98226 100644
--- a/Example/src/main/java/net/hypixel/example/GetStatusExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetStatusExample.java
@@ -1,4 +1,4 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
public class GetStatusExample {
public static void main(String[] args) {
diff --git a/Example/src/main/java/net/hypixel/example/KeyInfoExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/KeyInfoExample.java
similarity index 85%
rename from Example/src/main/java/net/hypixel/example/KeyInfoExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/KeyInfoExample.java
index 5e9014f8..79b9951b 100644
--- a/Example/src/main/java/net/hypixel/example/KeyInfoExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/KeyInfoExample.java
@@ -1,4 +1,4 @@
-package net.hypixel.example;
+package net.hypixel.api.example;
public class KeyInfoExample {
public static void main(String[] args) {
diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetBazaarExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetBazaarExample.java
new file mode 100644
index 00000000..2424ba7a
--- /dev/null
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetBazaarExample.java
@@ -0,0 +1,10 @@
+package net.hypixel.api.example.skyblock;
+
+import net.hypixel.api.example.ExampleUtil;
+
+public class GetBazaarExample {
+ public static void main(String[] args) {
+ ExampleUtil.API.getSkyBlockBazaar().whenComplete(ExampleUtil.getTestConsumer());
+ ExampleUtil.await();
+ }
+}
diff --git a/Example/src/main/java/net/hypixel/example/skyblock/GetSkyBlockAuctionsExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockAuctionsExample.java
similarity index 88%
rename from Example/src/main/java/net/hypixel/example/skyblock/GetSkyBlockAuctionsExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockAuctionsExample.java
index 9881958a..789af16c 100644
--- a/Example/src/main/java/net/hypixel/example/skyblock/GetSkyBlockAuctionsExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockAuctionsExample.java
@@ -1,6 +1,6 @@
-package net.hypixel.example.skyblock;
+package net.hypixel.api.example.skyblock;
-import net.hypixel.example.ExampleUtil;
+import net.hypixel.api.example.ExampleUtil;
public class GetSkyBlockAuctionsExample {
public static void main(String[] args) {
diff --git a/Example/src/main/java/net/hypixel/example/skyblock/GetSkyBlockNewsExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockNewsExample.java
similarity index 70%
rename from Example/src/main/java/net/hypixel/example/skyblock/GetSkyBlockNewsExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockNewsExample.java
index 5a80d321..11c77b99 100644
--- a/Example/src/main/java/net/hypixel/example/skyblock/GetSkyBlockNewsExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockNewsExample.java
@@ -1,6 +1,6 @@
-package net.hypixel.example.skyblock;
+package net.hypixel.api.example.skyblock;
-import net.hypixel.example.ExampleUtil;
+import net.hypixel.api.example.ExampleUtil;
public class GetSkyBlockNewsExample {
public static void main(String[] args) {
diff --git a/Example/src/main/java/net/hypixel/example/skyblock/GetSkyBlockProfileExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockProfileExample.java
similarity index 90%
rename from Example/src/main/java/net/hypixel/example/skyblock/GetSkyBlockProfileExample.java
rename to hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockProfileExample.java
index 977e4ffd..d96b0eb7 100644
--- a/Example/src/main/java/net/hypixel/example/skyblock/GetSkyBlockProfileExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/skyblock/GetSkyBlockProfileExample.java
@@ -1,7 +1,7 @@
-package net.hypixel.example.skyblock;
+package net.hypixel.api.example.skyblock;
import com.google.gson.JsonElement;
-import net.hypixel.example.ExampleUtil;
+import net.hypixel.api.example.ExampleUtil;
import java.util.Map;
diff --git a/hypixel-api-transport-apache/README.md b/hypixel-api-transport-apache/README.md
new file mode 100644
index 00000000..1061a8fb
--- /dev/null
+++ b/hypixel-api-transport-apache/README.md
@@ -0,0 +1,45 @@
+Hypixel Public API - Apache Transport
+======
+
+### Usage
+
+```xml
+
+ net.hypixel
+ hypixel-api-transport-apache
+ 4.0.0
+
+```
+
+Can also be included with Gradle.
+
+```gradle
+dependencies {
+ implementation 'net.hypixel:hypixel-api-transport-apache:4.0.0'
+}
+```
+
+### Example code
+
+```java
+public class Main {
+ public static void main(String[] args) {
+ HypixelHttpClient client = new ApacheHttpClient(UUID.fromString("your-api-key-here"));
+ HypixelAPI hypixelAPI = new HypixelAPI(client);
+ hypixelAPI.getPlayerByName("Hypixel")
+ .exceptionally(throwable -> {
+ // Handle exceptions here
+ throwable.printStackTrace();
+ return null;
+ })
+ .thenAccept(System.out::println);
+ }
+}
+```
+
+### Dependencies
+
+This transport depends on the following:
+
+* [Google Gson library - 2.8.6](https://mvnrepository.com/artifact/com.google.code.gson/gson) (for hypixel-api-core)
+* [Apache HttpClient - 4.5.13](https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient)
\ No newline at end of file
diff --git a/hypixel-api-transport-apache/pom.xml b/hypixel-api-transport-apache/pom.xml
new file mode 100644
index 00000000..5262d978
--- /dev/null
+++ b/hypixel-api-transport-apache/pom.xml
@@ -0,0 +1,40 @@
+
+
+
+ hypixel-api
+ net.hypixel
+ 4.0.0-SNAPSHOT
+
+ 4.0.0
+
+ hypixel-api-transport-apache
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.8
+ 1.8
+
+
+
+
+
+
+
+ net.hypixel
+ hypixel-api-core
+ 4.0.0-SNAPSHOT
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.13
+
+
+
+
\ No newline at end of file
diff --git a/hypixel-api-transport-apache/src/main/java/net/hypixel/api/apache/ApacheHttpClient.java b/hypixel-api-transport-apache/src/main/java/net/hypixel/api/apache/ApacheHttpClient.java
new file mode 100644
index 00000000..c4600bb8
--- /dev/null
+++ b/hypixel-api-transport-apache/src/main/java/net/hypixel/api/apache/ApacheHttpClient.java
@@ -0,0 +1,60 @@
+package net.hypixel.api.apache;
+
+import net.hypixel.api.http.HypixelHttpClient;
+import net.hypixel.api.http.HypixelHttpResponse;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.util.EntityUtils;
+
+import java.io.IOException;
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+public class ApacheHttpClient implements HypixelHttpClient {
+
+ private final UUID apiKey;
+ private final ExecutorService executorService;
+ private final HttpClient httpClient;
+
+ public ApacheHttpClient(UUID apiKey) {
+ this.apiKey = apiKey;
+ this.executorService = Executors.newCachedThreadPool();
+ this.httpClient = HttpClientBuilder.create().setUserAgent(DEFAULT_USER_AGENT).build();
+ }
+
+ @Override
+ public CompletableFuture makeRequest(String url) {
+ return CompletableFuture.supplyAsync(() -> {
+ try {
+ HttpResponse response = this.httpClient.execute(new HttpGet(url));
+ return new HypixelHttpResponse(response.getStatusLine().getStatusCode(), EntityUtils.toString(response.getEntity(), "UTF-8"));
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }, this.executorService);
+ }
+
+ @Override
+ public CompletableFuture makeAuthenticatedRequest(String url) {
+ return CompletableFuture.supplyAsync(() -> {
+ HttpGet request = new HttpGet(url);
+ request.addHeader("API-Key", this.apiKey.toString());
+ try {
+ HttpResponse response = this.httpClient.execute(request);
+ return new HypixelHttpResponse(response.getStatusLine().getStatusCode(), EntityUtils.toString(response.getEntity(), "UTF-8"));
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }, this.executorService);
+ }
+
+ @Override
+ public void shutdown() {
+ this.executorService.shutdown();
+ }
+
+}
diff --git a/hypixel-api-transport-unirest/README.md b/hypixel-api-transport-unirest/README.md
new file mode 100644
index 00000000..7f7f8598
--- /dev/null
+++ b/hypixel-api-transport-unirest/README.md
@@ -0,0 +1,45 @@
+Hypixel Public API - Unirest Transport
+======
+
+### Usage
+
+```xml
+
+ net.hypixel
+ hypixel-api-transport-unirest
+ 4.0.0
+
+```
+
+Can also be included with Gradle.
+
+```gradle
+dependencies {
+ implementation 'net.hypixel:hypixel-api-transport-unirest:4.0.0'
+}
+```
+
+### Example code
+
+```java
+public class Main {
+ public static void main(String[] args) {
+ HypixelHttpClient client = new UnirestHttpClient(UUID.fromString("your-api-key-here"));
+ HypixelAPI hypixelAPI = new HypixelAPI(client);
+ hypixelAPI.getPlayerByName("Hypixel")
+ .exceptionally(throwable -> {
+ // Handle exceptions here
+ throwable.printStackTrace();
+ return null;
+ })
+ .thenAccept(System.out::println);
+ }
+}
+```
+
+### Dependencies
+
+This transport depends on the following:
+
+* [Google Gson library - 2.8.6](https://mvnrepository.com/artifact/com.google.code.gson/gson) (for hypixel-api-core)
+* [Unirest Java - 3.11.11](https://mvnrepository.com/artifact/com.konghq/unirest-java)
\ No newline at end of file
diff --git a/hypixel-api-transport-unirest/pom.xml b/hypixel-api-transport-unirest/pom.xml
new file mode 100644
index 00000000..a9c8dcee
--- /dev/null
+++ b/hypixel-api-transport-unirest/pom.xml
@@ -0,0 +1,40 @@
+
+
+
+ hypixel-api
+ net.hypixel
+ 4.0.0-SNAPSHOT
+
+ 4.0.0
+
+ hypixel-api-transport-unirest
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.8
+ 1.8
+
+
+
+
+
+
+
+ net.hypixel
+ hypixel-api-core
+ 4.0.0-SNAPSHOT
+
+
+ com.konghq
+ unirest-java
+ 3.11.11
+
+
+
+
\ No newline at end of file
diff --git a/hypixel-api-transport-unirest/src/main/java/net/hypixel/api/unirest/UnirestHttpClient.java b/hypixel-api-transport-unirest/src/main/java/net/hypixel/api/unirest/UnirestHttpClient.java
new file mode 100644
index 00000000..48690211
--- /dev/null
+++ b/hypixel-api-transport-unirest/src/main/java/net/hypixel/api/unirest/UnirestHttpClient.java
@@ -0,0 +1,33 @@
+package net.hypixel.api.unirest;
+
+import kong.unirest.Unirest;
+import net.hypixel.api.http.HypixelHttpClient;
+import net.hypixel.api.http.HypixelHttpResponse;
+
+import java.util.UUID;
+import java.util.concurrent.CompletableFuture;
+
+public class UnirestHttpClient implements HypixelHttpClient {
+
+ private final UUID apiKey;
+
+ public UnirestHttpClient(UUID apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ @Override
+ public CompletableFuture makeRequest(String url) {
+ return Unirest.get(url).header("User-Agent", DEFAULT_USER_AGENT).asStringAsync().thenApply(res -> new HypixelHttpResponse(res.getStatus(), res.getBody()));
+ }
+
+ @Override
+ public CompletableFuture makeAuthenticatedRequest(String url) {
+ return Unirest.get(url).header("User-Agent", DEFAULT_USER_AGENT).header("API-Key", this.apiKey.toString()).asStringAsync().thenApply(res -> new HypixelHttpResponse(res.getStatus(), res.getBody()));
+ }
+
+ @Override
+ public void shutdown() {
+ Unirest.shutDown();
+ }
+
+}
diff --git a/pom.xml b/pom.xml
index 0df9c032..facb75d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,13 +5,59 @@
4.0.0
net.hypixel
- PublicAPI
+ hypixel-api
pom
- 2.0-SNAPSHOT
+ 4.0.0-SNAPSHOT
- Example
- Java
+ hypixel-api-core
+ hypixel-api-example
+ hypixel-api-transport-apache
+ hypixel-api-transport-unirest
+
+
+ Hypixel
+ https://repo.hypixel.net/repository/Hypixel/
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 2.3.2
+
+ UTF-8
+ 1.8
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ 3.0.1
+
+
+ attach-sources
+
+ jar
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.0.1
+
+ none
+ true
+
+
+
+
+
\ No newline at end of file