Examples of FancyHeader


Examples of com.onarandombox.MultiverseCore.utils.FancyHeader

    private List<List<FancyText>> buildEntireCommand(MultiverseWorld world, Player p) {
        List<FancyText> message = new ArrayList<FancyText>();
        List<List<FancyText>> worldInfo = new ArrayList<List<FancyText>>();
        // Page 1
        FancyColorScheme colors = new FancyColorScheme(ChatColor.AQUA, ChatColor.AQUA, ChatColor.GOLD, ChatColor.WHITE);
        message.add(new FancyHeader("General Info", colors));
        message.add(new FancyMessage("World Name: ", world.getName(), colors));
        message.add(new FancyMessage("World Alias: ", world.getColoredWorldString(), colors));
        message.add(new FancyMessage("Game Mode: ", world.getGameMode().toString(), colors));
        message.add(new FancyMessage("Difficulty: ", world.getDifficulty().toString(), colors));

        //message.add(new FancyMessage("Game Mode: ", StringUtils.capitalize(world.getGameMode().toString()), colors));
        Location spawn = world.getSpawnLocation();
        message.add(new FancyMessage("Spawn Location: ", plugin.getLocationManipulation().strCoords(spawn), colors));
        message.add(new FancyMessage("World Scale: ", String.valueOf(world.getScaling()), colors));
        message.add(new FancyMessage("World Seed: ", String.valueOf(world.getSeed()), colors));
        if (world.getPrice() > 0) {
            final String formattedAmount;
            if (world.getCurrency() <= 0 && plugin.getVaultHandler().getEconomy() != null) {
                formattedAmount = plugin.getVaultHandler().getEconomy().format(world.getPrice());
            } else {
                formattedAmount = this.plugin.getBank().getFormattedAmount(p, world.getPrice(), world.getCurrency());
            }
            message.add(new FancyMessage("Price to enter this world: ", formattedAmount, colors));
        } else {
            message.add(new FancyMessage("Price to enter this world: ", ChatColor.GREEN + "FREE!", colors));
        }

        if (world.getRespawnToWorld() != null) {
            MultiverseWorld respawn = this.worldManager.getMVWorld(world.getRespawnToWorld());
            if (respawn != null) {
                message.add(new FancyMessage("Players will respawn in: ", respawn.getColoredWorldString(), colors));
            } else {
                message.add(new FancyMessage("Players will respawn in: ", ChatColor.RED + "!!INVALID!!", colors));
            }

        }

        worldInfo.add(message);
        // Page 2
        message = new ArrayList<FancyText>();
        message.add(new FancyHeader("More World Settings", colors));
        message.add(new FancyMessage("World Type: ", world.getWorldType().toString(), colors));
        message.add(new FancyMessage("Structures: ", world.getCBWorld().canGenerateStructures() + "", colors));
        message.add(new FancyMessage("Weather: ", world.isWeatherEnabled() + "", colors));
        message.add(new FancyMessage("Players will get hungry: ", world.getHunger() + "", colors));
        message.add(new FancyMessage("Keep spawn in memory: ", world.isKeepingSpawnInMemory() + "", colors));
        message.add(new FancyHeader("PVP Settings", colors));
        message.add(new FancyMessage("Multiverse Setting: ", world.isPVPEnabled() + "", colors));
        message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getPVP() + "", colors));
        worldInfo.add(message);
        // Page 3
        message = new ArrayList<FancyText>();
        message.add(new FancyHeader("Monster Settings", colors));
        message.add(new FancyMessage("Multiverse Setting: ", world.canMonstersSpawn() + "", colors));
        message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getAllowMonsters() + "", colors));
        if (world.getMonsterList().size() > 0) {
            if (world.canMonstersSpawn()) {
                message.add(new FancyMessage("Monsters that" + ChatColor.RED + " CAN NOT "
                        + ChatColor.GREEN + "spawn: ", toCommaSeperated(world.getMonsterList()), colors));
            } else {
                message.add(new FancyMessage("Monsters that" + ChatColor.GREEN + " CAN SPAWN: ", toCommaSeperated(world.getMonsterList()), colors));
            }
        } else {
            message.add(new FancyMessage("Monsters that CAN spawn: ", world.canMonstersSpawn() ? "ALL" : "NONE", colors));
        }
        worldInfo.add(message);

        // Page 4
        message = new ArrayList<FancyText>();
        message.add(new FancyHeader("Animal Settings", colors));
        message.add(new FancyMessage("Multiverse Setting: ", world.canAnimalsSpawn() + "", colors));
        message.add(new FancyMessage("Bukkit Setting: ", world.getCBWorld().getAllowAnimals() + "", colors));
        if (world.getMonsterList().size() > 0) {
            if (world.canMonstersSpawn()) {
                message.add(new FancyMessage("Animals that" + ChatColor.RED + " CAN NOT "
View Full Code Here

Examples of com.onarandombox.MultiverseCore.utils.FancyHeader

                    FancyMessage text = (FancyMessage) fancyT;
                    text.setAltColor(altColor);
                    altColor = !altColor;
                    sender.sendMessage(text.getFancyText());
                } else if (fancyT instanceof FancyHeader) {
                    FancyHeader text = (FancyHeader) fancyT;
                    if (!appendedPageNum) {
                        text.appendText(ChatColor.DARK_PURPLE + " [ Page " + (page + 1) + " of " + doc.size() + " ]");
                        appendedPageNum = true;
                    }
                    sender.sendMessage(text.getFancyText());
                    altColor = false;
                }
            }

        } else {
            for (List<FancyText> list : doc) {
                for (FancyText fancyT : list) {
                    if (fancyT instanceof FancyMessage) {
                        FancyMessage text = (FancyMessage) fancyT;
                        text.setAltColor(altColor);
                        altColor = !altColor;
                        sender.sendMessage(text.getFancyText());
                    } else {
                        FancyText text = fancyT;
                        if (appendedPageNum) {
                            sender.sendMessage(" ");
                        } else {
                            appendedPageNum = true;
                        }
                        sender.sendMessage(text.getFancyText());
                        altColor = false;
                    }
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.