aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-09-12 22:16:26 -0400
committerbowser0000 <bowser0000@gmail.com>2020-09-12 22:16:26 -0400
commit0bbf2635b76352c241dcfe0f85c14e2e9a73405b (patch)
tree69ba48cc72ea1f7773638e2c6fd3f6c4774f72bc /src/main/java/me/Danker
parent274ebcc8062617aa3d5a59b9bec4de4484c7c01f (diff)
downloadSkyblockMod-0bbf2635b76352c241dcfe0f85c14e2e9a73405b.tar.gz
SkyblockMod-0bbf2635b76352c241dcfe0f85c14e2e9a73405b.tar.bz2
SkyblockMod-0bbf2635b76352c241dcfe0f85c14e2e9a73405b.zip
Add amount of pets and guild members to commands
Diffstat (limited to 'src/main/java/me/Danker')
-rw-r--r--src/main/java/me/Danker/commands/GuildOfCommand.java3
-rw-r--r--src/main/java/me/Danker/commands/PetsCommand.java3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/commands/GuildOfCommand.java b/src/main/java/me/Danker/commands/GuildOfCommand.java
index 238ba81..dca1974 100644
--- a/src/main/java/me/Danker/commands/GuildOfCommand.java
+++ b/src/main/java/me/Danker/commands/GuildOfCommand.java
@@ -83,12 +83,14 @@ public class GuildOfCommand extends CommandBase {
String guildName = "N/A";
String guildMaster = "N/A";
+ int players = 0;
// Check if player is in guild
if (!guildResponse.get("guild").isJsonNull()) {
guildName = guildResponse.get("guild").getAsJsonObject().get("name").getAsString();
// Loop through members to find guildmaster
JsonArray guildMembers = guildResponse.get("guild").getAsJsonObject().get("members").getAsJsonArray();
+ players = guildMembers.size();
for (JsonElement member : guildMembers) {
JsonObject memberObject = member.getAsJsonObject();
String memberRank = memberObject.get("rank").getAsString();
@@ -109,6 +111,7 @@ public class GuildOfCommand extends CommandBase {
EnumChatFormatting.AQUA + " " + username + "'s Guild:\n" +
EnumChatFormatting.GREEN + " Guild: " + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + guildName + "\n" +
EnumChatFormatting.GREEN + " Guildmaster: " + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + guildMaster + "\n" +
+ EnumChatFormatting.GREEN + " Members: " + EnumChatFormatting.DARK_GREEN + EnumChatFormatting.BOLD + players + "\n" +
EnumChatFormatting.AQUA + " " + EnumChatFormatting.BOLD + "-------------------"));
}).start();
}
diff --git a/src/main/java/me/Danker/commands/PetsCommand.java b/src/main/java/me/Danker/commands/PetsCommand.java
index c697689..2ad196e 100644
--- a/src/main/java/me/Danker/commands/PetsCommand.java
+++ b/src/main/java/me/Danker/commands/PetsCommand.java
@@ -159,8 +159,9 @@ public class PetsCommand extends CommandBase {
}
}
+ int totalPets = commonPets.size() + uncommonPets.size() + rarePets.size() + epicPets.size() + legendaryPets.size();
String finalMessage = EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "-------------------\n" +
- EnumChatFormatting.AQUA + " " + username + "'s Pets:\n";
+ EnumChatFormatting.AQUA + " " + username + "'s Pets (" + totalPets + "):\n";
// Loop through pet rarities
for (JsonObject legPet : legendaryPets) {