Search in sources :

Example 66 with JsonHolder

use of cc.hyperium.utils.JsonHolder 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 67 with JsonHolder

use of cc.hyperium.utils.JsonHolder 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 68 with JsonHolder

use of cc.hyperium.utils.JsonHolder 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 69 with JsonHolder

use of cc.hyperium.utils.JsonHolder 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)

Example 70 with JsonHolder

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

the class SmashHeroesStats method getPreview.

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

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