use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class BedWarsStats method getPreview.
@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
ArrayList<StatsDisplayItem> items = new ArrayList<>();
JsonHolder bedwars = player.getStats(GameType.BEDWARS);
items.add(new DisplayLine(bold("Coins: ", bedwars.optInt("coins")), Color.WHITE.getRGB()));
items.add(new DisplayLine(bold("Kills: ", bedwars.optInt("kills_bedwars")), Color.WHITE.getRGB()));
items.add(new DisplayLine(bold("Deaths: ", bedwars.optInt("deaths_bedwars")), Color.WHITE.getRGB()));
items.add(new DisplayLine(bold("Wins: ", bedwars.optInt("wins_bedwars")), Color.WHITE.getRGB()));
items.add(new DisplayLine(bold("Losses: ", bedwars.optInt("losses_bedwars")), Color.WHITE.getRGB()));
items.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(bedwars.optInt("kills_bedwars"), bedwars.optInt("deaths_bedwars"))), Color.WHITE.getRGB()));
items.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(bedwars.optInt("wins_bedwars"), bedwars.optInt("losses_bedwars"))), Color.WHITE.getRGB()));
items.add(new DisplayLine(""));
items.add(new DisplayLine(bold("Bedwars level: ", WebsiteUtils.getBedwarsLevel(bedwars.optInt("Experience") + bedwars.optInt("Experience_new")))));
items.add(new DisplayLine(bold("Beds Broken: ", bedwars.optInt("beds_broken_bedwars"))));
items.add(new DisplayLine(""));
items.add(new DisplayLine(bold("Final Kills: ", bedwars.optInt("final_kills_bedwars"))));
items.add(new DisplayLine(bold("Final Deaths: ", bedwars.optInt("final_deaths_bedwars"))));
items.add(new DisplayLine(bold("Final K/D: ", WebsiteUtils.buildRatio(bedwars.optInt("final_kills_bedwars"), bedwars.optInt("final_deaths_bedwars")))));
items.add(new DisplayLine(bold("Final Kill / Normal deaths: ", WebsiteUtils.buildRatio(bedwars.optInt("final_kills_bedwars"), bedwars.optInt("deaths_bedwars")))));
return items;
}
use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class BedWarsStats method getDeepStats.
@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
List<StatsDisplayItem> preview = getPreview(player);
preview.add(new DisplayLine(""));
List<String[]> lines = new ArrayList<>();
JsonHolder bedwars = player.getStats(GameType.BEDWARS);
String[] bedwarsnames = { "Solo", "Doubles", "3v3v3v3", "4v4v4v4" };
String[] bedwarsBackend = { "eight_one", "eight_two", "four_three", "four_four" };
lines.add(new String[] { "Mode", "Kills", "Deaths", "Wins", "Losses", "Final Kills", "Final Deaths", "Beds Broken", "K/D", "Final K/D", "W/L" });
for (int i = 0; i < bedwarsnames.length; i++) {
lines.add(new String[] { bedwarsnames[i], WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_kills_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_deaths_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_wins_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_losses_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_final_kills_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_final_deaths_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_beds_broken_bedwars")), WebsiteUtils.buildRatio(bedwars.optInt(bedwarsBackend[i] + "_kills_bedwars"), bedwars.optInt(bedwarsBackend[i] + "_deaths_bedwars")), WebsiteUtils.buildRatio(bedwars.optInt(bedwarsBackend[i] + "_final_kills_bedwars"), bedwars.optInt(bedwarsBackend[i] + "_final_deaths_bedwars")), WebsiteUtils.buildRatio(bedwars.optInt(bedwarsBackend[i] + "_wins_bedwars"), bedwars.optInt(bedwarsBackend[i] + "_losses_bedwars")) });
}
preview.add(new DisplayTable(lines));
return preview;
}
use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class GeneralStats method getDeepStats.
@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
List<StatsDisplayItem> items = getPreview(player);
JsonHolder giftm = player.getGiftMeta();
items.add(new DisplayLine(""));
items.add(new DisplayLine(bold("Gift given: ", giftm.optInt("realBundlesGiven"))));
items.add(new DisplayLine(bold("Gift received: ", giftm.optInt("realBundlesReceived"))));
items.add(new DisplayLine(""));
if (player.has("mostRecentGameType")) {
items.add(new DisplayLine(bold("Most recent played: ", player.mostRecentGame().getName())));
items.add(new DisplayLine(""));
}
items.add(new DisplayLine(bold("Rewards Claimed: ", player.getInt("totalRewards"))));
items.add(new DisplayLine(bold("Daily Rewards Claimed: ", player.getInt("totalDailyRewards"))));
items.add(new DisplayLine(bold("Best Rewards Streak: ", player.getInt("rewardHighScore"))));
items.add(new DisplayLine(bold("Current reward streak: ", player.getInt("rewardScore"))));
items.add(new DisplayLine(""));
items.add(new DisplayLine(bold("Times voted: ", player.getInt("voting#total"))));
items.add(new DisplayLine(""));
JsonHolder petss2 = player.getRoot().optJSONObject("petStats");
List<String[]> strings = new ArrayList<>();
strings.add(new String[] { "Name", "Level" });
for (String in : petss2.getKeys()) {
JsonHolder tmp = petss2.optJSONObject(in);
Pet pet = new Pet(tmp);
String name;
if (tmp.has("name"))
name = tmp.optString("name");
else
name = in.replace("_", " ").toLowerCase();
strings.add(new String[] { name, Integer.toString(pet.level) });
}
items.add(new DisplayLine("Pets", Color.WHITE.getRGB(), 2));
items.add(new DisplayTable(strings));
return items;
}
use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class MurderMysteryStats method getPreview.
@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
List<StatsDisplayItem> preview = new ArrayList<>();
JsonHolder stats = player.getStats(GameType.MURDER_MYSTERY);
preview.add(new DisplayLine(""));
preview.add(new DisplayLine("General"));
preview.add(new DisplayLine(bold("Coins: ", stats.optInt("coins"))));
preview.add(new DisplayLine(""));
preview.add(new DisplayLine("Overall Stats"));
preview.add(new DisplayLine(bold("Kills: ", stats.optInt("kills"))));
preview.add(new DisplayLine(bold("Wins: ", stats.optInt("wins"))));
preview.add(new DisplayLine(bold("Deaths: ", stats.optInt("deaths"))));
preview.add(new DisplayLine(bold("Bow Kills: ", stats.optInt("bow_kills"))));
preview.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(stats.optInt("kills"), stats.optInt("deaths")))));
preview.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(stats.optInt("wins"), stats.optInt("deaths")))));
return preview;
}
use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class MurderMysteryStats method getDeepStats.
@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
List<StatsDisplayItem> preview = getPreview(player);
JsonHolder stats = player.getStats(GameType.MURDER_MYSTERY);
preview.add(new DisplayLine(""));
preview.add(new DisplayLine("Classic Stats"));
preview.add(new DisplayLine(bold("Kills: ", stats.optInt("kills_MURDER_CLASSIC"))));
preview.add(new DisplayLine(bold("Wins: ", stats.optInt("wins_MURDER_CLASSIC"))));
preview.add(new DisplayLine(bold("Deaths: ", stats.optInt("deaths_MURDER_CLASSIC"))));
preview.add(new DisplayLine(bold("Bow Kills: ", stats.optInt("bow_kills"))));
preview.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(stats.optInt("kills_MURDER_CLASSIC"), stats.optInt("deaths_MURDER_CLASSIC")))));
preview.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(stats.optInt("wins_MURDER_CLASSIC"), stats.optInt("deaths_MURDER_CLASSIC")))));
preview.add(new DisplayLine(""));
preview.add(new DisplayLine("Hardcore Stats"));
preview.add(new DisplayLine(bold("Kills: ", stats.optInt("kills_MURDER_HARDCORE"))));
preview.add(new DisplayLine(bold("Wins: ", stats.optInt("wins_MURDER_HARDCORE"))));
preview.add(new DisplayLine(bold("Deaths: ", stats.optInt("deaths_MURDER_HARDCORE"))));
preview.add(new DisplayLine(bold("Bow Kills: ", stats.optInt("bow_kills"))));
preview.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(stats.optInt("kills_MURDER_HARDCORE"), stats.optInt("deaths_MURDER_HARDCORE")))));
preview.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(stats.optInt("wins_MURDER_HARDCORE"), stats.optInt("deaths_MURDER_HARDCORE")))));
preview.add(new DisplayLine(""));
preview.add(new DisplayLine("Assassins Stats"));
preview.add(new DisplayLine(bold("Kills: ", stats.optInt("kills_MURDER_ASSASSINS"))));
preview.add(new DisplayLine(bold("Wins: ", stats.optInt("wins_MURDER_ASSASSINS"))));
preview.add(new DisplayLine(bold("Deaths: ", stats.optInt("deaths_MURDER_ASSASSINS"))));
preview.add(new DisplayLine(bold("Bow Kills: ", stats.optInt("bow_kills"))));
preview.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(stats.optInt("kills_MURDER_ASSASSINS"), stats.optInt("deaths_MURDER_ASSASSINS")))));
preview.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(stats.optInt("wins_MURDER_ASSASSINS"), stats.optInt("deaths_MURDER_ASSASSINS")))));
String[] murderMysteryModes = { "All", "Classic", "Assassins", "Hardcore" };
String[] murderMysteryNames = { "", "_MURDER_CLASSIC", "_MURDER_ASSASIANS", "_MURDER_HARDCORE" };
List<String[]> lines = new ArrayList<>();
preview.add(new DisplayLine(""));
lines.add(new String[] { "Mode", "Kills", "Wins", "Deaths", "Hero", "Bow Kills" });
for (int i = 0; i < murderMysteryModes.length; i++) {
String name = murderMysteryModes[i];
String seed = murderMysteryNames[i];
lines.add(new String[] { name, String.valueOf(stats.optInt("kills" + seed)), String.valueOf(stats.optInt("wins" + seed)), String.valueOf(stats.optInt("deaths" + seed)), String.valueOf(stats.optInt("was_hero" + seed)), String.valueOf(stats.optInt("bow_kills" + seed)) });
}
preview.add(new DisplayTable(lines));
return preview;
}
Aggregations