use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class ArenaStats method getDeepStats.
@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
List<StatsDisplayItem> items = getPreview(player);
items.add(new DisplayLine(""));
List<String[]> tableItems = new ArrayList<>();
JsonHolder arena = player.getStats(GameType.ARENA);
tableItems.add(new String[] { "Mode", "Kills", "Deaths", "Wins", "Losses", "Healed", "K/D", "W/L" });
String[] names = new String[] { "1v1", "2v2", "4v4" };
for (String name : names) {
tableItems.add(new String[] { name, WebsiteUtils.comma(arena.optInt("kills_" + name)), WebsiteUtils.comma(arena.optInt("deaths_" + name)), WebsiteUtils.comma(arena.optInt("wins_" + name)), WebsiteUtils.comma(arena.optInt("losses_" + name)), WebsiteUtils.comma(arena.optInt("healed_" + name)), WebsiteUtils.buildRatio(arena.optInt("kills_" + name), arena.optInt("deaths_" + name)), WebsiteUtils.buildRatio(arena.optInt("wins_" + name), arena.optInt("losses_" + name)) });
}
items.add(new DisplayTable(tableItems));
return items;
}
use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class BlitzStats method getDeepStats.
@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
List<StatsDisplayItem> preview = getPreview(player);
preview.add(new DisplayLine(""));
List<String[]> lines = new ArrayList<>();
lines.add(new String[] { "Kit", "Level" });
JsonHolder blitz = player.getStats(GameType.SURVIVAL_GAMES);
for (String st : WebsiteUtils.blitz_kits) {
String tmp1 = null;
if (!st.contains("Hype")) {
tmp1 = st.replace(" ", "").toLowerCase();
} else {
tmp1 = st.toLowerCase();
}
if (blitz.has(tmp1))
lines.add(new String[] { st, WebsiteUtils.numeral(blitz.optInt(tmp1) + 1) });
}
preview.add(new DisplayTable(lines));
return preview;
}
use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class DuelsStats method getPreview.
@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
List<StatsDisplayItem> preview = super.getPreview(player);
preview.add(new DisplayLine(""));
JsonHolder stats = player.getStats(GameType.DUELS);
preview.add(new DisplayLine(bold("Tournament Wins: ", Arrays.stream(tournaments).mapToInt(tournament -> stats.optInt(tournament + "_wins")).sum())));
return preview;
}
use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class MegaWallsStats method getPreview.
@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
List<StatsDisplayItem> stats = new ArrayList<>();
JsonHolder megaWalls = player.getStats(GameType.WALLS3);
stats.add(new DisplayLine(bold("Coins: ", megaWalls.optInt("coins"))));
stats.add(new DisplayLine(bold("Kills: ", megaWalls.optInt("kills"))));
stats.add(new DisplayLine(bold("Deaths: ", megaWalls.optInt("deaths"))));
stats.add(new DisplayLine(bold("Wins: ", megaWalls.optInt("wins"))));
stats.add(new DisplayLine(bold("Losses: ", megaWalls.optInt("losses"))));
return stats;
}
use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.
the class PaintballStats method getDeepStats.
@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
List<StatsDisplayItem> stats = getPreview(player);
JsonHolder paintball = player.getStats(GameType.PAINTBALL);
SimpleDateFormat hhmmss = new SimpleDateFormat("HH:mm:ss");
stats.add(new DisplayLine(""));
stats.add(new DisplayLine(bold("Shots fired: ", paintball.optInt("shots_fired"))));
stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(paintball.optInt("kills"), paintball.optInt("deaths")))));
stats.add(new DisplayLine(bold("Shot / kill: ", WebsiteUtils.buildRatio(paintball.optInt("shots_fired"), paintball.optInt("kills")))));
hhmmss.setTimeZone(TimeZone.getTimeZone("GMT"));
stats.add(new DisplayLine(bold("Time in forcefield (HH-MM-SS): ", hhmmss.format(new Date(1000 * paintball.optInt("forcefieldTime"))))));
return stats;
}
Aggregations