Search in sources :

Example 71 with JsonHolder

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

the class TKRStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = new ArrayList<>();
    JsonHolder gingerBread = player.getStats(GameType.GINGERBREAD);
    stats.add(new DisplayLine(bold("Coins: ", gingerBread.optInt("coins"))));
    stats.add(new DisplayLine(bold("Gold Trophies: ", gingerBread.optInt("gold_trophy"))));
    stats.add(new DisplayLine(bold("Silver Trophies: ", gingerBread.optInt("silver_trophy"))));
    stats.add(new DisplayLine(bold("Bronze Trophies: ", gingerBread.optInt("bronze_trophy"))));
    stats.add(new DisplayLine(bold("Laps Completed: ", gingerBread.optInt("laps_completed"))));
    stats.add(new DisplayLine(bold("Coins Picked Up: ", gingerBread.optInt("coins_picked_up"))));
    stats.add(new DisplayLine(bold("Power Ups Picked Up: ", gingerBread.optInt("box_pickups"))));
    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 72 with JsonHolder

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

the class UHCStats method getPreview.

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

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

the class VampireZStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder vampireZ = player.getStats(GameType.VAMPIREZ);
    stats.add(new DisplayLine(bold("Human Wins: ", vampireZ.optInt("human_wins"))));
    stats.add(new DisplayLine(bold("Human Kills: ", vampireZ.optInt("human_kills"))));
    stats.add(new DisplayLine(bold("Human Deaths: ", vampireZ.optInt("human_deaths"))));
    stats.add(new DisplayLine(bold("Zombie Kills: ", vampireZ.optInt("zombie_kills"))));
    stats.add(new DisplayLine(bold("Vampire Kills: ", vampireZ.optInt("vampire_kills"))));
    stats.add(new DisplayLine(bold("Vampire wins: ", vampireZ.optInt("vampire_wins"))));
    stats.add(new DisplayLine(bold("Vampire Deaths: ", vampireZ.optInt("vampire_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)

Example 74 with JsonHolder

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

the class SkyClashStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> stats = getPreview(player);
    JsonHolder skyClash = player.getStats(GameType.SKYCLASH);
    stats.add(new DisplayLine(bold("Assists: ", skyClash.optInt("assists"))));
    stats.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(skyClash.optInt("kills"), skyClash.optInt("deaths")))));
    stats.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(skyClash.optInt("wins"), skyClash.optInt("losses")))));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(""));
    stats.add(new DisplayLine(bold("Mobs Spawned: ", skyClash.optInt("mobs_spawned"))));
    stats.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    lines.add(new String[] { "Mode", "Fastest Win", "Kills", "Wins", "Losses", "Deaths" });
    String[] SKYCLASH_MODES = { "Solo", "Doubles", "Team War" };
    for (String front : SKYCLASH_MODES) {
        String b = front.toLowerCase().replace(" ", "_");
        lines.add(new String[] { front, String.valueOf(skyClash.optInt("fastest_win_" + b)), String.valueOf(skyClash.optInt("kills_" + b)), String.valueOf(skyClash.optInt("wins_" + b)), String.valueOf(skyClash.optInt("losses_" + b)), String.valueOf(skyClash.optInt("deaths_" + b)) });
    }
    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 75 with JsonHolder

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

the class TPoseKeybind method onRelease.

@Override
public void onRelease() {
    if (!Settings.TPOSE_TOGGLE_MODE)
        tPoseToggled = false;
    if (Settings.TPOSE_TOGGLE || Settings.TPOSE_TOGGLE_MODE)
        return;
    Hyperium.INSTANCE.getHandlers().getTPoseHandler().stopAnimation(UUIDUtil.getClientUUID());
    NettyClient client = NettyClient.getClient();
    if (client != null) {
        client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "tpose_update").put("posing", false)));
    }
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) NettyClient(cc.hyperium.netty.NettyClient)

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