Search in sources :

Example 16 with JsonHolder

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

the class SkyClashStats method getPreview.

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

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

the class UHCStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder UHC = player.getStats(GameType.UHC);
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Teams", "")));
    stats.add(new DisplayLine(bold("Kills: ", UHC.optInt("kills"))));
    stats.add(new DisplayLine(bold("Deaths: ", UHC.optInt("deaths"))));
    stats.add(new DisplayLine(bold("Wins: ", UHC.optInt("wins"))));
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(UHC.optInt("kills"), UHC.optInt("deaths")))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Solo", "")));
    stats.add(new DisplayLine(bold("Kills: ", UHC.optInt("kills_solo"))));
    stats.add(new DisplayLine(bold("Deaths: ", UHC.optInt("deaths_solo"))));
    stats.add(new DisplayLine(bold("Wins: ", UHC.optInt("wins_solo"))));
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(UHC.optInt("kills_solo"), UHC.optInt("deaths_solo")))));
    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 18 with JsonHolder

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

the class WallsStats method getDeepStats.

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

Example 19 with JsonHolder

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

the class WallsStats method getPreview.

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

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

the class CVCStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> preview = getPreview(player);
    JsonHolder stats = player.getStats(GameType.MCGO);
    preview.add(new DisplayLine(""));
    preview.add(new DisplayLine(bold("Bombs Planted: ", stats.optInt("bombs_planted")), Color.WHITE.getRGB()));
    preview.add(new DisplayLine(bold("Bombs Defused: ", stats.optInt("bombs_defused")), Color.WHITE.getRGB()));
    preview.add(new DisplayLine(bold("Round Wins: ", stats.optInt("round_wins")), Color.WHITE.getRGB()));
    preview.add(new DisplayLine(bold("Shots Fired: ", stats.optInt("shots_fired")), Color.WHITE.getRGB()));
    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)

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