Search in sources :

Example 31 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine 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;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) DisplayTable(cc.hyperium.handlers.handlers.stats.display.DisplayTable) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 32 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine 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;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) DisplayTable(cc.hyperium.handlers.handlers.stats.display.DisplayTable) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 33 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine 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;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem)

Example 34 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine 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;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 35 with DisplayLine

use of cc.hyperium.handlers.handlers.stats.display.DisplayLine 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;
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Aggregations

DisplayLine (cc.hyperium.handlers.handlers.stats.display.DisplayLine)44 StatsDisplayItem (cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem)43 JsonHolder (cc.hyperium.utils.JsonHolder)42 ArrayList (java.util.ArrayList)32 DisplayTable (cc.hyperium.handlers.handlers.stats.display.DisplayTable)10 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 Pet (club.sk1er.website.Pet)1 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 GameType (net.hypixel.api.GameType)1