Search in sources :

Example 36 with StatsDisplayItem

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

Example 37 with StatsDisplayItem

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

the class SpeedUHCStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder speedUhc = player.getStats(GameType.SPEED_UHC);
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(speedUhc.optInt("kills"), speedUhc.optInt("deaths")))));
    stats.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(speedUhc.optInt("wins"), speedUhc.optInt("losses")))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Salt: ", speedUhc.optInt("salt"))));
    final String[] SpeedUHC_modes = { "Solo Normal", "Solo Insane", "Team Normal", "Team Insane" };
    stats.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Kills", "Deaths", "Wins", "Losses", "K/D", "W/L" });
    for (String name : SpeedUHC_modes) {
        String api = name.toLowerCase().replace(" ", "_");
        lines.add(new String[] { name, String.valueOf(speedUhc.optInt("kills_" + api)), String.valueOf(speedUhc.optInt("deaths_" + api)), String.valueOf(speedUhc.optInt("wins_" + api)), String.valueOf(speedUhc.optInt("losses_" + api)), WebsiteUtils.buildRatio(speedUhc.optInt("kills_" + api), speedUhc.optInt("deaths_" + api)), WebsiteUtils.buildRatio(speedUhc.optInt("wins_" + api), speedUhc.optInt("losses_" + api)) });
    }
    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)

Example 38 with StatsDisplayItem

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

the class TNTGamesStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = new ArrayList<>();
    JsonHolder tntGames = player.getStats(GameType.TNTGAMES);
    stats.add(new DisplayLine(bold("Coins: ", tntGames.optInt("coins"))));
    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 39 with StatsDisplayItem

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

the class BuildBattleStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = new ArrayList<>();
    JsonHolder arcade = player.getStats(GameType.ARCADE);
    stats.add(new DisplayLine(bold("Build Battle wins: ", arcade.optInt("wins_buildbattle"))));
    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 40 with StatsDisplayItem

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

the class SmashHeroesStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder smashHeroes = player.getStats(GameType.SUPER_SMASH);
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(smashHeroes.optInt("kills"), smashHeroes.optInt("deaths")))));
    stats.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(smashHeroes.optInt("wins"), smashHeroes.optInt("losses")))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Smash Level: ", smashHeroes.optInt("smashLevel"))));
    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)

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