Package org.bukkit

Examples of org.bukkit.ChatColor


    private static String prettify(String message) {
        String trimmed = message.trim();
        String messageColor = Colorizer.parseColors(MESSAGE_COLOUR);
        if (!trimmed.isEmpty()) {
            if (trimmed.charAt(0) == ChatColor.COLOR_CHAR) {
                ChatColor test = ChatColor.getByChar(trimmed.substring(1, 2));
                if (test == null) {
                    message = messageColor + message;
                }
            } else
                message = messageColor + message;
View Full Code Here


                    page = numpages;
                } else if (page < 1) {
                    page = 1;
                }
               
                ChatColor g = ChatColor.GREEN, w = ChatColor.WHITE, r = ChatColor.RED;
               
                int start = 8 * (page - 1);
                sender.sendMessage(ChatColor.RED + "[==== " + ChatColor.GREEN + "Page " + page + " of " + numpages + ChatColor.RED + " ====]");
                for (int i = start; i < start + 8 && i < dump.size(); ++i) {
                    PermissionAttachmentInfo info = dump.get(i);
View Full Code Here

    drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE);
    this.inputField.drawTextBox();
    // Spout Start
    if (Configuration.isShowingChatColorAssist()) {
      for(int c = 0; c < 16; c++) {
        ChatColor value = ChatColor.getByCode(c);
        String name = value.name().toLowerCase();
        boolean lastUnderscore = true;
        String parsedName = "";
        for(int chr = 0; chr < name.length(); chr++) {
          char ch = name.charAt(chr);
          if(lastUnderscore) {
View Full Code Here

        double maxHealth = entity.getMaxHealth();
        double currentHealth = Math.max(entity.getHealth() - damage, 0);
        double healthPercentage = (currentHealth / maxHealth) * 100.0D;

        int fullDisplay;
        ChatColor color = ChatColor.BLACK;
        String symbol;

        switch (profile.getMobHealthbarType()) {
            case HEARTS:
                fullDisplay = Math.min((int) (maxHealth / 2), 10);
View Full Code Here

                        sender.sendMessage(ChatColor.RED + "Valid values for option " + option + " are: true and false");
                    }
                } else {
                    String value = args[4].toLowerCase();
                    if (option.equals("color")) {
                        ChatColor color = TEAMS_OPTION_COLOR.get(value);
                        if (color == null) {
                            sender.sendMessage(ChatColor.RED + "Valid values for option color are: " + stringCollectionToString(TEAMS_OPTION_COLOR.keySet()));
                            return false;
                        }
                        team.setPrefix(color.toString());
                        team.setSuffix(ChatColor.RESET.toString());
                    } else {
                        if (!value.equals("true") && !value.equals("false")) {
                            sender.sendMessage(ChatColor.RED + "Valid values for option " + option + " are: true and false");
                            return false;
View Full Code Here

    }

    public void chat(String sourcePlayer, String message)
    {
        Server serv = Residence.getServ();
        ChatColor color = Residence.getConfigManager().getChatColor();
        ResidenceChatEvent cevent = new ResidenceChatEvent(Residence.getResidenceManager().getByName(name),serv.getPlayer(sourcePlayer),message,color);
        Residence.getServ().getPluginManager().callEvent(cevent);
        if(cevent.isCancelled())
            return;
        for(String member : members)
View Full Code Here

    }

    public void chat(String sourcePlayer, String message)
    {
        Server serv = Residence.getServ();
        ChatColor color = Residence.getConfigManager().getChatColor();
        ResidenceChatEvent cevent = new ResidenceChatEvent(Residence.getResidenceManager().getByName(name),serv.getPlayer(sourcePlayer),message,color);
        Residence.getServ().getPluginManager().callEvent(cevent);
        if(cevent.isCancelled())
            return;
        for(String member : members)
View Full Code Here

                            break thisIC;

                    }
                }
                col = !col;
                ChatColor colour = col ? ChatColor.YELLOW : ChatColor.GOLD;

                if (!ICMechanic.checkPermissionsBoolean(CraftBookPlugin.inst().wrapPlayer(p), ric.getFactory(), ic.toLowerCase(Locale.ENGLISH))) {
                    colour = col ? ChatColor.RED : ChatColor.DARK_RED;
                }
                strings.add(colour + tic.getTitle() + " (" + ric.getId() + ")"
View Full Code Here

  }

  @Override
  public ChatColor select(String arg, CommandSender sender)
  {
    ChatColor ret = null;
   
    arg = getToCompare(arg);
   
    for (ChatColor cc : ChatColor.values())
    {
View Full Code Here

    private static JSONObject convert(String text) {
        // state
        final List<JSONObject> items = new LinkedList<>();
        final Set<ChatColor> formatting = EnumSet.noneOf(ChatColor.class);
        final StringBuilder current = new StringBuilder();
        ChatColor color = null;

        // work way through text, converting colors
        for (int i = 0; i < text.length(); ++i) {
            char ch = text.charAt(i);
            if (ch != ChatColor.COLOR_CHAR) {
                // no special handling
                current.append(ch);
                continue;
            }

            if (i == text.length() - 1) {
                // ignore color character at end
                continue;
            }

            // handle colors
            append(items, current, color, formatting);
            ChatColor code = ChatColor.getByChar(text.charAt(++i));
            if (code == ChatColor.RESET) {
                color = null;
                formatting.clear();
            } else if (code.isFormat()) {
                formatting.add(code);
            } else {
                color = code;
                formatting.clear();
            }
View Full Code Here

TOP

Related Classes of org.bukkit.ChatColor

Copyright © 2018 www.massapicom. 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.