Search in sources :

Example 31 with StatsDisplayItem

use of cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem in project Hyperium by HyperiumClient.

the class ArenaStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    ArrayList<StatsDisplayItem> items = new ArrayList<>();
    JsonHolder arena = player.getStats(GameType.ARENA);
    items.add(new DisplayLine(bold("Coins: ", arena.optInt("coins"))));
    int kills = arena.optInt("kills_1v1") + arena.optInt("kills_2v2") + arena.optInt("kills_4v4");
    items.add(new DisplayLine(bold("Kills: ", kills), Color.WHITE.getRGB()));
    int deaths = arena.optInt("deaths_1v1") + arena.optInt("deaths_2v2") + arena.optInt("deaths_4v4");
    items.add(new DisplayLine(bold("Deaths: ", deaths), Color.WHITE.getRGB()));
    int wins = arena.optInt("wins_1v1") + arena.optInt("wins_2v2") + arena.optInt("wins_4v4");
    items.add(new DisplayLine(bold("Wins: ", wins), Color.WHITE.getRGB()));
    int losses = arena.optInt("losses_1v1") + arena.optInt("losses_2v2") + arena.optInt("losses_4v4");
    items.add(new DisplayLine(bold("Losses: ", losses), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(kills, deaths)), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(wins, losses)), Color.WHITE.getRGB()));
    return items;
}
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 32 with StatsDisplayItem

use of cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem 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 33 with StatsDisplayItem

use of cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem 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 34 with StatsDisplayItem

use of cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem 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 35 with StatsDisplayItem

use of cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem 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)

Aggregations

StatsDisplayItem (cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem)45 DisplayLine (cc.hyperium.handlers.handlers.stats.display.DisplayLine)43 JsonHolder (cc.hyperium.utils.JsonHolder)42 ArrayList (java.util.ArrayList)33 DisplayTable (cc.hyperium.handlers.handlers.stats.display.DisplayTable)10 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 GuiBlock (cc.hyperium.gui.GuiBlock)1 Pet (club.sk1er.website.Pet)1 HypixelApiGuild (club.sk1er.website.api.requests.HypixelApiGuild)1 ExecutionException (java.util.concurrent.ExecutionException)1 GameType (net.hypixel.api.GameType)1 ScaledResolution (net.minecraft.client.gui.ScaledResolution)1 DynamicTexture (net.minecraft.client.renderer.texture.DynamicTexture)1