From be8c41d7d4057e6ad3cc44a240c2723da017f28d Mon Sep 17 00:00:00 2001
From: firetrqck <140627932+firetrqck@users.noreply.github.com>
Date: Mon, 7 Aug 2023 18:25:45 -0400
Subject: [PATCH 1/8] doc: Better comment GetGuildExample.java
---
.../net/hypixel/api/example/GetGuildExample.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
index f6a6c168..622db45c 100644
--- a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
@@ -22,7 +22,7 @@ public class GetGuildExample {
public static void main(String[] args) {
/*
* Make sure you have a HypixelAPI object set up. You can see how this is done by going to
- * the ExampleUtil class.
+ * the ExampleUtil class (ExampleUtil.java) .
*
* See the finally{} block below for how to shutdown this API once you're all done.
*/
@@ -36,17 +36,17 @@ public static void main(String[] args) {
try {
/*
* We'll be fetching the guild's stats using its ID for this example, but guilds can
- * also be looked up using their name, or one of their members' Minecraft UUIDs.
+ * also be looked up by their name, or one of their member's Minecraft UUIDs.
* - HypixelAPI.getGuildByName(String)
* - HypixelAPI.getGuildByPlayer(UUID)
*/
String guildId = ExampleUtil.GUILD_ID;
/*
- * Here, we store the response from the API in our variable.
+ * Here, we store the response from the API.
*
* We call `.get()` at the end so that we can use the reply in the same thread.
- * The downside is that the current thread freezes (or "blocks") until the API responds.
+ * The downside is that this is synchronous operation.
* If this is a problem for you, instead use:
*
* .whenComplete((apiReply, error) -> {
@@ -61,7 +61,7 @@ public static void main(String[] args) {
System.err.println("Oh no, our API request failed!");
/*
- * If an ExecutionException is thrown, it's typically because of an API error.
+ * If an ExecutionException is an arbitary error, typically because of an API error.
* Use `getCause()` to determine what the actual problem is.
*/
e.getCause().printStackTrace();
@@ -127,8 +127,8 @@ public static void main(String[] args) {
/*
* Finally, we'll print some information about each member in the guild.
*
- * This might print out A LOT, so you may want to comment the following line out if you're
- * focusing on some of the guild's other info.
+ * This might print out upto 125 seperate usernames, so you may want to comment the following line out if you're
+ * focusing on other info.
*/
printGuildMembers(guild.getMembers());
}
From cefffd261315818fc17bea858fd718d0bc681c95 Mon Sep 17 00:00:00 2001
From: firetrqck <140627932+firetrqck@users.noreply.github.com>
Date: Tue, 8 Aug 2023 08:13:53 -0400
Subject: [PATCH 2/8] small accuracy fix for guild members
125 is a in game limit on how many people can join a guild in hypixel, the endpoint can theoretically return infinite.
---
.../main/java/net/hypixel/api/example/GetGuildExample.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
index 622db45c..4c5067d9 100644
--- a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
@@ -127,8 +127,9 @@ public static void main(String[] args) {
/*
* Finally, we'll print some information about each member in the guild.
*
- * This might print out upto 125 seperate usernames, so you may want to comment the following line out if you're
- * focusing on other info.
+ * This might print out a lot usernames(in theory infinity,
+ * practically upto 125, the *current* in game member limit),
+ * so you may want to comment the following line out if you're focusing on other info.
*/
printGuildMembers(guild.getMembers());
}
From dd121a9d034ac0e5784ed011bdf65b22ef5cf271 Mon Sep 17 00:00:00 2001
From: firetrqck <140627932+firetrqck@users.noreply.github.com>
Date: Tue, 8 Aug 2023 08:16:36 -0400
Subject: [PATCH 3/8] Remove unnecessary file name linking
---
.../src/main/java/net/hypixel/api/example/GetGuildExample.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
index 4c5067d9..3b52defd 100644
--- a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
@@ -21,8 +21,7 @@ public class GetGuildExample {
public static void main(String[] args) {
/*
- * Make sure you have a HypixelAPI object set up. You can see how this is done by going to
- * the ExampleUtil class (ExampleUtil.java) .
+ * Make sure you have a HypixelAPI object set up. You can see how this is done in the ExampleUtil class.
*
* See the finally{} block below for how to shutdown this API once you're all done.
*/
From 6213af72ac37523231f2e1a7c89f72eb620f93cb Mon Sep 17 00:00:00 2001
From: firetrqck <140627932+firetrqck@users.noreply.github.com>
Date: Tue, 8 Aug 2023 08:59:47 -0400
Subject: [PATCH 4/8] Update with AspectOfJerry's suggestion
---
.../main/java/net/hypixel/api/example/GetGuildExample.java | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
index 3b52defd..f1513651 100644
--- a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
@@ -125,10 +125,8 @@ public static void main(String[] args) {
/*
* Finally, we'll print some information about each member in the guild.
- *
- * This might print out a lot usernames(in theory infinity,
- * practically upto 125, the *current* in game member limit),
- * so you may want to comment the following line out if you're focusing on other info.
+ * This could potentially potentially print out A LOT(based on the size of the guild in question)
+ * You may want to comment this out if you're focusing on other information.
*/
printGuildMembers(guild.getMembers());
}
From 204082db42300e9dfb3effb5214d80583c7b91fd Mon Sep 17 00:00:00 2001
From: firetrqck <140627932+firetrqck@users.noreply.github.com>
Date: Tue, 8 Aug 2023 09:13:36 -0400
Subject: [PATCH 5/8] Improve README page
---
hypixel-api-example/README.md | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/hypixel-api-example/README.md b/hypixel-api-example/README.md
index 417f1b68..84739515 100644
--- a/hypixel-api-example/README.md
+++ b/hypixel-api-example/README.md
@@ -1,3 +1,35 @@
# HypixelAPI Java Examples
-This codebase serves as examples for how to integrate the HypixelAPI into your project.
\ No newline at end of file
+This codebase serves as examples for how to integrate the HypixelAPI into your project.
+
+## A small overview of where to find things
+
+- The main/shared API initalization and global constant defention is in [ExampleUtil](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/ExampleUtil.java)
+
+ ExampleUtil also defines the ` getTestConsumer` an often seen error handler, that prints out the response if sucess, and throws if failure.
+ Note: When it prints for sucess, it prints out a stringfied version of the object/response.
+- An example of getting a list of active and qued boosters is in [GetBoostersExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetBoostersExample.java)
+
+ Stringfied response can be found [here](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-core/src/main/java/net/hypixel/api/reply/BoostersReply.java#L87C1-L99C6)
+- An example of getting the current player count is in [GetCountsExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetCountsExample.java)
+- An example of getting information about a guild is in [GetGuildExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java)
+
+ Information includes: guild members usernames, the guilds name and tag, gexp breakdown, level, their ranks, and more!
+- An example of getting the current leaderboards is in [GetLeaderboardsExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetLeaderboardsExample.java)
+
+ Stringfied response can be found [here](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-core/src/main/java/net/hypixel/api/reply/LeaderboardsReply.java#L55C1-L63C10)
+- An example of getting pet information can be found [here, in GetPetsExample](https://github.com/firetrqck/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPetsExample.java)
+
+ Information includes pet rarity, rarity colors, wheter a player posses that pet, and more!
+- An example of getting player information can be found in [GetPlayerExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPlayerExample.java)
+
+ Information includes their: UUID, network level(exact), rank, mc version, and more!
+- An example of getting the current punishment stats can be found in [GetPunishmentStatsExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPunishmentStatsExample.java)
+- An example of getting recent games of a UUID(in the example, hypixel's) can be found in [GetRecentGamesExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetRecentGamesExample.java)
+
+- An example of getting a games challenges can be found in [GetResourceExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetResourceExample.java)
+- An example of getting a player's status can be found in [GetStatusExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetStatusExample.java)
+
+ Note: this is not a reliable indicator of online status, as in game a player can run `/status offline` to set their status to offline
+
+
From 6359624f160765f2d62fc31092a019a89da239d0 Mon Sep 17 00:00:00 2001
From: firetrqck <140627932+firetrqck@users.noreply.github.com>
Date: Tue, 8 Aug 2023 09:15:31 -0400
Subject: [PATCH 6/8] more small doc tweaks in GetGuildExample
---
.../src/main/java/net/hypixel/api/example/GetGuildExample.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
index f1513651..5b83d5b2 100644
--- a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
@@ -125,7 +125,7 @@ public static void main(String[] args) {
/*
* Finally, we'll print some information about each member in the guild.
- * This could potentially potentially print out A LOT(based on the size of the guild in question)
+ * This could potentially potentially print out A LOT(depending on the guild's size)
* You may want to comment this out if you're focusing on other information.
*/
printGuildMembers(guild.getMembers());
From e7aac1b0ab42d4b5a535096d3d76f050af18a467 Mon Sep 17 00:00:00 2001
From: firetrqck <140627932+firetrqck@users.noreply.github.com>
Date: Tue, 8 Aug 2023 10:27:55 -0400
Subject: [PATCH 7/8] fix small grammatical issues in README
---
hypixel-api-example/README.md | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/hypixel-api-example/README.md b/hypixel-api-example/README.md
index 84739515..51652819 100644
--- a/hypixel-api-example/README.md
+++ b/hypixel-api-example/README.md
@@ -1,35 +1,35 @@
# HypixelAPI Java Examples
-This codebase serves as examples for how to integrate the HypixelAPI into your project.
+This codebase serves as an example of how to integrate the HypixelAPI into your project.
## A small overview of where to find things
-- The main/shared API initalization and global constant defention is in [ExampleUtil](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/ExampleUtil.java)
+- The main/shared API initalization and global constant defention are in [ExampleUtil](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/ExampleUtil.java)
- ExampleUtil also defines the ` getTestConsumer` an often seen error handler, that prints out the response if sucess, and throws if failure.
- Note: When it prints for sucess, it prints out a stringfied version of the object/response.
-- An example of getting a list of active and qued boosters is in [GetBoostersExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetBoostersExample.java)
+ ExampleUtil also defines the `getTestConsumer` an often seen error handler, that prints out the response if sucess, and throws if failure.
+ Note: A stringified version of the response object will be printed on sucess
+- An example of getting the list of active and qued boosters is in [GetBoostersExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetBoostersExample.java)t
Stringfied response can be found [here](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-core/src/main/java/net/hypixel/api/reply/BoostersReply.java#L87C1-L99C6)
- An example of getting the current player count is in [GetCountsExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetCountsExample.java)
- An example of getting information about a guild is in [GetGuildExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java)
- Information includes: guild members usernames, the guilds name and tag, gexp breakdown, level, their ranks, and more!
+ Response data includes the guild's name,tag, gexp breakdown, level and more!
- An example of getting the current leaderboards is in [GetLeaderboardsExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetLeaderboardsExample.java)
- Stringfied response can be found [here](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-core/src/main/java/net/hypixel/api/reply/LeaderboardsReply.java#L55C1-L63C10)
+ A stringfied response can be found [here](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-core/src/main/java/net/hypixel/api/reply/LeaderboardsReply.java#L55C1-L63C10)
- An example of getting pet information can be found [here, in GetPetsExample](https://github.com/firetrqck/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPetsExample.java)
- Information includes pet rarity, rarity colors, wheter a player posses that pet, and more!
+ Response data includes pet rarity, rarity colors, whether a player posses that pet, and more!
- An example of getting player information can be found in [GetPlayerExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPlayerExample.java)
- Information includes their: UUID, network level(exact), rank, mc version, and more!
+ Response data includes the players: UUID, network level(exact), rank, mc version, and more!
- An example of getting the current punishment stats can be found in [GetPunishmentStatsExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetPunishmentStatsExample.java)
-- An example of getting recent games of a UUID(in the example, hypixel's) can be found in [GetRecentGamesExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetRecentGamesExample.java)
+- An example of getting recent games of a UUID(using hypixel's as an example) can be found in [GetRecentGamesExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetRecentGamesExample.java)
- An example of getting a games challenges can be found in [GetResourceExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetResourceExample.java)
- An example of getting a player's status can be found in [GetStatusExample](https://github.com/HypixelDev/PublicAPI/blob/master/hypixel-api-example/src/main/java/net/hypixel/api/example/GetStatusExample.java)
- Note: this is not a reliable indicator of online status, as in game a player can run `/status offline` to set their status to offline
+ Note: this is not a perfectc indicator of online status, as in game a player can run `/status offline` to set their status to offline
From d4f220da03016dac2c007f89e275bd05fd322681 Mon Sep 17 00:00:00 2001
From: firetrqck <140627932+firetrqck@users.noreply.github.com>
Date: Tue, 8 Aug 2023 13:42:02 -0400
Subject: [PATCH 8/8] Update with some better grammar and more accesible
language
---
.../main/java/net/hypixel/api/example/GetGuildExample.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
index 5b83d5b2..d848b5b6 100644
--- a/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
+++ b/hypixel-api-example/src/main/java/net/hypixel/api/example/GetGuildExample.java
@@ -35,7 +35,7 @@ public static void main(String[] args) {
try {
/*
* We'll be fetching the guild's stats using its ID for this example, but guilds can
- * also be looked up by their name, or one of their member's Minecraft UUIDs.
+ * also be looked up by their name, or one of their members' Minecraft UUIDs.
* - HypixelAPI.getGuildByName(String)
* - HypixelAPI.getGuildByPlayer(UUID)
*/
@@ -45,7 +45,7 @@ public static void main(String[] args) {
* Here, we store the response from the API.
*
* We call `.get()` at the end so that we can use the reply in the same thread.
- * The downside is that this is synchronous operation.
+ * The downside is that this is synchronous, and blocks the thread untill the API responds.
* If this is a problem for you, instead use:
*
* .whenComplete((apiReply, error) -> {