Search in sources :

Example 21 with DisplayLine

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

the class BedWarsStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    ArrayList<StatsDisplayItem> items = new ArrayList<>();
    JsonHolder bedwars = player.getStats(GameType.BEDWARS);
    items.add(new DisplayLine(bold("Coins: ", bedwars.optInt("coins")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Kills: ", bedwars.optInt("kills_bedwars")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Deaths: ", bedwars.optInt("deaths_bedwars")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Wins: ", bedwars.optInt("wins_bedwars")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Losses: ", bedwars.optInt("losses_bedwars")), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(bedwars.optInt("kills_bedwars"), bedwars.optInt("deaths_bedwars"))), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(bedwars.optInt("wins_bedwars"), bedwars.optInt("losses_bedwars"))), Color.WHITE.getRGB()));
    items.add(new DisplayLine(""));
    items.add(new DisplayLine(bold("Bedwars level: ", WebsiteUtils.getBedwarsLevel(bedwars.optInt("Experience") + bedwars.optInt("Experience_new")))));
    items.add(new DisplayLine(bold("Beds Broken: ", bedwars.optInt("beds_broken_bedwars"))));
    items.add(new DisplayLine(""));
    items.add(new DisplayLine(bold("Final Kills: ", bedwars.optInt("final_kills_bedwars"))));
    items.add(new DisplayLine(bold("Final Deaths: ", bedwars.optInt("final_deaths_bedwars"))));
    items.add(new DisplayLine(bold("Final K/D: ", WebsiteUtils.buildRatio(bedwars.optInt("final_kills_bedwars"), bedwars.optInt("final_deaths_bedwars")))));
    items.add(new DisplayLine(bold("Final Kill / Normal deaths: ", WebsiteUtils.buildRatio(bedwars.optInt("final_kills_bedwars"), bedwars.optInt("deaths_bedwars")))));
    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 DisplayLine

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

the class BedWarsStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> preview = getPreview(player);
    preview.add(new DisplayLine(""));
    List<String[]> lines = new ArrayList<>();
    JsonHolder bedwars = player.getStats(GameType.BEDWARS);
    String[] bedwarsnames = { "Solo", "Doubles", "3v3v3v3", "4v4v4v4" };
    String[] bedwarsBackend = { "eight_one", "eight_two", "four_three", "four_four" };
    lines.add(new String[] { "Mode", "Kills", "Deaths", "Wins", "Losses", "Final Kills", "Final Deaths", "Beds Broken", "K/D", "Final K/D", "W/L" });
    for (int i = 0; i < bedwarsnames.length; i++) {
        lines.add(new String[] { bedwarsnames[i], WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_kills_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_deaths_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_wins_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_losses_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_final_kills_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_final_deaths_bedwars")), WebsiteUtils.comma(bedwars.optInt(bedwarsBackend[i] + "_beds_broken_bedwars")), WebsiteUtils.buildRatio(bedwars.optInt(bedwarsBackend[i] + "_kills_bedwars"), bedwars.optInt(bedwarsBackend[i] + "_deaths_bedwars")), WebsiteUtils.buildRatio(bedwars.optInt(bedwarsBackend[i] + "_final_kills_bedwars"), bedwars.optInt(bedwarsBackend[i] + "_final_deaths_bedwars")), WebsiteUtils.buildRatio(bedwars.optInt(bedwarsBackend[i] + "_wins_bedwars"), bedwars.optInt(bedwarsBackend[i] + "_losses_bedwars")) });
    }
    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 DisplayLine

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

the class GeneralStats method getDeepStats.

@Override
public List<StatsDisplayItem> getDeepStats(HypixelApiPlayer player) {
    List<StatsDisplayItem> items = getPreview(player);
    JsonHolder giftm = player.getGiftMeta();
    items.add(new DisplayLine(""));
    items.add(new DisplayLine(bold("Gift given: ", giftm.optInt("realBundlesGiven"))));
    items.add(new DisplayLine(bold("Gift received: ", giftm.optInt("realBundlesReceived"))));
    items.add(new DisplayLine(""));
    if (player.has("mostRecentGameType")) {
        items.add(new DisplayLine(bold("Most recent played: ", player.mostRecentGame().getName())));
        items.add(new DisplayLine(""));
    }
    items.add(new DisplayLine(bold("Rewards Claimed: ", player.getInt("totalRewards"))));
    items.add(new DisplayLine(bold("Daily Rewards Claimed: ", player.getInt("totalDailyRewards"))));
    items.add(new DisplayLine(bold("Best Rewards Streak: ", player.getInt("rewardHighScore"))));
    items.add(new DisplayLine(bold("Current reward streak: ", player.getInt("rewardScore"))));
    items.add(new DisplayLine(""));
    items.add(new DisplayLine(bold("Times voted: ", player.getInt("voting#total"))));
    items.add(new DisplayLine(""));
    JsonHolder petss2 = player.getRoot().optJSONObject("petStats");
    List<String[]> strings = new ArrayList<>();
    strings.add(new String[] { "Name", "Level" });
    for (String in : petss2.getKeys()) {
        JsonHolder tmp = petss2.optJSONObject(in);
        Pet pet = new Pet(tmp);
        String name;
        if (tmp.has("name"))
            name = tmp.optString("name");
        else
            name = in.replace("_", " ").toLowerCase();
        strings.add(new String[] { name, Integer.toString(pet.level) });
    }
    items.add(new DisplayLine("Pets", Color.WHITE.getRGB(), 2));
    items.add(new DisplayTable(strings));
    return items;
}
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) Pet(club.sk1er.website.Pet)

Example 24 with DisplayLine

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

the class GeneralStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    ArrayList<StatsDisplayItem> items = new ArrayList<>();
    items.add(new DisplayLine(bold("Level: ", player.getNetworkLevel()), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Karma: ", player.getKarma()), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Friends: ", player.getFriendCount()), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Achievement Points: ", player.getAchievementPoints()), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Quest Completed: ", player.getTotalQuests()), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Current Coins: ", player.getTotalCoins()), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Total Kills: ", player.getTotalKills()), Color.WHITE.getRGB()));
    items.add(new DisplayLine(bold("Total Wins: ", player.getTotalWins()), Color.WHITE.getRGB()));
    return items;
}
Also used : DisplayLine(cc.hyperium.handlers.handlers.stats.display.DisplayLine) StatsDisplayItem(cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem) ArrayList(java.util.ArrayList)

Example 25 with DisplayLine

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

the class MurderMysteryStats method getPreview.

@Override
public List<StatsDisplayItem> getPreview(HypixelApiPlayer player) {
    List<StatsDisplayItem> preview = new ArrayList<>();
    JsonHolder stats = player.getStats(GameType.MURDER_MYSTERY);
    preview.add(new DisplayLine(""));
    preview.add(new DisplayLine("General"));
    preview.add(new DisplayLine(bold("Coins: ", stats.optInt("coins"))));
    preview.add(new DisplayLine(""));
    preview.add(new DisplayLine("Overall Stats"));
    preview.add(new DisplayLine(bold("Kills: ", stats.optInt("kills"))));
    preview.add(new DisplayLine(bold("Wins: ", stats.optInt("wins"))));
    preview.add(new DisplayLine(bold("Deaths: ", stats.optInt("deaths"))));
    preview.add(new DisplayLine(bold("Bow Kills: ", stats.optInt("bow_kills"))));
    preview.add(new DisplayLine(bold("K/D: ", WebsiteUtils.buildRatio(stats.optInt("kills"), stats.optInt("deaths")))));
    preview.add(new DisplayLine(bold("W/L: ", WebsiteUtils.buildRatio(stats.optInt("wins"), stats.optInt("deaths")))));
    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) ArrayList(java.util.ArrayList)

Aggregations

DisplayLine (cc.hyperium.handlers.handlers.stats.display.DisplayLine)44 StatsDisplayItem (cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem)43 JsonHolder (cc.hyperium.utils.JsonHolder)42 ArrayList (java.util.ArrayList)32 DisplayTable (cc.hyperium.handlers.handlers.stats.display.DisplayTable)10 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 Pet (club.sk1er.website.Pet)1 JsonArray (com.google.gson.JsonArray)1 JsonElement (com.google.gson.JsonElement)1 GameType (net.hypixel.api.GameType)1