Search in sources :

Example 21 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class CVCStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    JsonHolder stats = player.getStats(GameType.MCGO);
    ArrayList<StatsDisplayItem> items = new ArrayList<>();
    items.add(new DisplayLine(bold("Coins: ", stats.optInt("coins")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Kills: ", stats.optInt("kills")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Headshots: ", stats.optInt("headshot_kills")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Deaths: ", stats.optInt("deaths")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Wins: ", stats.optInt("game_wins")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Losses: ", stats.optInt("losses")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(stats.optInt("kills"), stats.optInt("deaths"))), 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 22 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class DuelsStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> preview = getPreview(player);
    JsonHolder stats = player.getStats(GameType.DUELS);
    preview.add(new DisplayLine(""));
    String[] modes = new String[] { "uhc_duel", "uhc_doubles", "sw_duel", "sw_doubles", "classic_duel", "op_duel", "combo", "mw_duel", "mw_doubles", "blitz_duels", "potion_duel", "sumo_duel" };
    String[] names = new String[] { "UHC Solo", "UHC Doubles", "SW Solo", "SW Doubles", "Classic Duel", "OP duel", "Combo", "MegaWalls Solo", "MegaWalls Doubles", "Blitz Solo", "Potion Duel", "Sumo" };
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Wins", "Deaths", "Losses", "K/D", "W/L" });
    for (int i = 0; i < tournaments.length; i++) {
        String mode = tournaments[i];
        lines.add(new String[] { tournament_names[i], WebsiteUtils.comma(stats.optInt(mode + "_kills")), WebsiteUtils.comma(stats.optInt(mode + "_wins")), WebsiteUtils.comma(stats.optInt(mode + "_deaths")), WebsiteUtils.comma(stats.optInt(mode + "_losses")), WebsiteUtils.buildRatio(stats.optInt(mode + "_kills"), stats.optInt(mode + "_deaths")), WebsiteUtils.buildRatio(stats.optInt(mode + "_wins"), stats.optInt(mode + "_losses")) });
    }
    preview.add(new DisplayTable(lines));
    preview.add(new DisplayLine(""));
    lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Wins", "Deaths", "Losses", "K/D", "W/L", "Best Winstreak" });
    for (int i = 0; i < modes.length; i++) {
        String mode = modes[i];
        lines.add(new String[] { names[i], WebsiteUtils.comma(stats.optInt(mode + "_kills")), WebsiteUtils.comma(stats.optInt(mode + "_wins")), WebsiteUtils.comma(stats.optInt(mode + "_deaths")), WebsiteUtils.comma(stats.optInt(mode + "_losses")), WebsiteUtils.buildRatio(stats.optInt(mode + "_kills"), stats.optInt(mode + "_deaths")), WebsiteUtils.buildRatio(stats.optInt(mode + "_wins"), stats.optInt(mode + "_losses")), WebsiteUtils.comma(stats.optInt("duels_winstreak_best_" + mode)) });
    }
    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 23 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class MegaWallsStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder megaWalls = player.getStats(GameType.WALLS3);
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Assists: ", megaWalls.optInt("assists"))));
    stats.add(new DisplayLine(bold("Final Kills: ", megaWalls.optInt("finalKills"))));
    stats.add(new DisplayLine(bold("Final Assists: ", megaWalls.optInt("finalAssists"))));
    stats.add(new DisplayLine(bold("Wither Damage: ", megaWalls.optInt("witherDamage"))));
    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)

Example 24 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class PaintballStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = new ArrayList<>();
    JsonHolder paintball = player.getStats(GameType.PAINTBALL);
    stats.add(new DisplayLine(bold("Coins: ", paintball.optInt("kills"))));
    stats.add(new DisplayLine(bold("Kills: ", paintball.optInt("kills"))));
    stats.add(new DisplayLine(bold("Wins: ", paintball.optInt("wins"))));
    stats.add(new DisplayLine(bold("Deaths: ", paintball.optInt("deaths"))));
    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 25 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class QuakecraftStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder quakeCraft = player.getStats(GameType.QUAKECRAFT);
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Headshots", "Wins", "Shots Fired", "Blocks Traveled", "Godlikes", "Killstreaks", "K/D" });
    lines.add(new String[] { "Overall", String.valueOf(quakeCraft.optInt("kills") + quakeCraft.optInt("kills_teams")), String.valueOf(quakeCraft.optInt("headshots") + quakeCraft.optInt("headshots_teams")), String.valueOf(quakeCraft.optInt("wins") + quakeCraft.optInt("wins_teams")), String.valueOf(quakeCraft.optInt("shots_fired") + quakeCraft.optInt("shots_fired_teams")), String.valueOf(quakeCraft.optInt("distance_travelled") + quakeCraft.optInt("distance_travelled_teams")), String.valueOf(quakeCraft.optInt("godlikes") + quakeCraft.optInt("godlikes_teams")), String.valueOf(quakeCraft.optInt("killstreaks") + quakeCraft.optInt("killstreaks_teams")), WebsiteUtils.buildRatio(quakeCraft.optInt("kills") + quakeCraft.optInt("kills_teams"), quakeCraft.optInt("deaths") + quakeCraft.optInt("deaths_teams")) });
    lines.add(new String[] { "Solo", String.valueOf(quakeCraft.optInt("kills")), String.valueOf(quakeCraft.optInt("headshots")), String.valueOf(quakeCraft.optInt("wins")), String.valueOf(quakeCraft.optInt("shots_fired")), String.valueOf(quakeCraft.optInt("distance_travelled")), String.valueOf(quakeCraft.optInt("godlikes")), String.valueOf(quakeCraft.optInt("killstreaks")), WebsiteUtils.buildRatio(quakeCraft.optInt("kills"), quakeCraft.optInt("deaths")) });
    lines.add(new String[] { "Teams", String.valueOf(quakeCraft.optInt("kills_teams")), String.valueOf(quakeCraft.optInt("headshots_teams")), String.valueOf(quakeCraft.optInt("wins_teams")), String.valueOf(quakeCraft.optInt("shots_fired_teams")), String.valueOf(quakeCraft.optInt("distance_travelled_teams")), String.valueOf(quakeCraft.optInt("godlikes_teams")), String.valueOf(quakeCraft.optInt("killstreaks_teams")), WebsiteUtils.buildRatio(quakeCraft.optInt("kills_teams"), quakeCraft.optInt("deaths_teams")) });
    stats.add(new DisplayTable(lines));
    return stats;
}
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)

Aggregations

JsonHolder (cc.hyperium.utils.JsonHolder)81 DisplayLine (cc.hyperium.handlers.handlers.stats.display.DisplayLine)42 StatsDisplayItem (cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem)42 ArrayList (java.util.ArrayList)34 NettyClient (cc.hyperium.netty.NettyClient)13 DisplayTable (cc.hyperium.handlers.handlers.stats.display.DisplayTable)10 JsonArray (com.google.gson.JsonArray)9 JsonElement (com.google.gson.JsonElement)8 HyperiumPurchase (cc.hyperium.purchases.HyperiumPurchase)5 JsonObject (com.google.gson.JsonObject)5 URL (java.net.URL)5 UUID (java.util.UUID)5 HashMap (java.util.HashMap)4 InvokeEvent (cc.hyperium.event.InvokeEvent)3 PurchaseLoadEvent (cc.hyperium.event.network.PurchaseLoadEvent)3 AbstractAnimationHandler (cc.hyperium.handlers.handlers.animation.AbstractAnimationHandler)3 DisplayItem (cc.hyperium.mods.chromahud.api.DisplayItem)3 IOException (java.io.IOException)3 ExecutionException (java.util.concurrent.ExecutionException)3 GuiButton (net.minecraft.client.gui.GuiButton)3