Package org.bukkit

Examples of org.bukkit.ChatColor


      return "PARSE-ERROR";
    }
  }
 
  public String printConfig(Team team) {
    ChatColor teamColor = ChatColor.AQUA;
   
    ChatColor normalColor = ChatColor.WHITE;
   
    String teamConfigStr = "";
    InventoryBag invs = team.getInventories();
    teamConfigStr += getLoadoutsString(invs);
   
View Full Code Here


      + ifEmptyInheritedForTeam(teamConfigStr);
  }

  private String getLoadoutsString(InventoryBag invs) {
    StringBuilder loadoutsString = new StringBuilder();
    ChatColor loadoutColor = ChatColor.GREEN;
    ChatColor normalColor = ChatColor.WHITE;
   
    if (invs.hasLoadouts()) {
      StringBuilder loadouts = new StringBuilder();
      for (Loadout ldt : invs.getNewLoadouts()) {
        if (ldt.requiresPermission()) {
View Full Code Here

   
    return loadoutsString.toString();
  }

  public String printConfig(Warzone zone) {
    ChatColor teamColor = ChatColor.AQUA;
    ChatColor zoneColor = ChatColor.DARK_AQUA;
    ChatColor authorColor = ChatColor.GREEN;
    ChatColor normalColor = ChatColor.WHITE;
   
    String warzoneConfigStr = "";
    for (WarzoneConfig warzoneConfig : WarzoneConfig.values()) {
      Object value = zone.getWarzoneConfig().getValue(warzoneConfig);
      if (value != null) {
View Full Code Here

    }
    return maybeEmpty;
  }

  public String printConfig() {
    ChatColor teamColor = ChatColor.AQUA;
    ChatColor zoneColor = ChatColor.DARK_AQUA;
    ChatColor globalColor = ChatColor.DARK_GREEN;
    ChatColor normalColor = ChatColor.WHITE;
   
    String warConfigStr = "";
    for (WarConfig warConfig : WarConfig.values()) {
      warConfigStr += " " + warConfig.toStringWithValue(this.getWarConfig().getValue(warConfig)).replace(":", ":" + globalColor) + normalColor;
    }
View Full Code Here

      }
    }
    for (String name : fc.getKeys(false)) {
      ConfigurationSection cs = fc.getConfigurationSection(name);
      Material mat = Material.matchMaterial(cs.getString("Material"));
      ChatColor color = ChatColor.valueOf(cs.getString("Color")
          .toUpperCase());
      List<String> lore = cs.getStringList("Lore");
      ItemStack tool = new ItemStack(mat);
      List<String> list = new ArrayList<String>();
      for (String s : lore) {
View Full Code Here

  private ChatColor[] setupColor(FileConfiguration fc) {
    List<String> colorStringList = fc.getStringList("Colors");
    ChatColor[] colorList = new ChatColor[colorStringList.size()];
    for (int i = 0; i < colorStringList.size(); i++) {
      String string = colorStringList.get(i);
      ChatColor cc = null;
      try {
        cc = ChatColor.valueOf(string.toUpperCase());
      } catch (Exception e) {
        continue;
      }
View Full Code Here

    dataFolder = instance.getDataFolder();
  }

  public void loadChatColorFile(final HashMap<ChatColor, List<String>> hm,
      final File f) {
    ChatColor m = ChatColor.valueOf(f.getName().replace(".txt", "")
        .toUpperCase());
    List<String> l = new ArrayList<String>();
    try {
      BufferedReader list = new BufferedReader(new FileReader(f));
      String p;
View Full Code Here

                  continue;
                if (!ChatColor.stripColor(t).equals("(Socket)"))
                  continue;
                if ((meta.getDisplayName().contains("Socket") || fuel
                    .getType().equals(Material.SKULL_ITEM))) {
                  ChatColor socketColor = findColor(t);
                  ChatColor fuelColor = findColor(meta
                      .getDisplayName());
                  if ((fuelColor == socketColor)
                      || (socketColor == null)
                      || (socketColor == ChatColor.RESET)
                      || (socketColor == ChatColor.DARK_PURPLE)
View Full Code Here

    if (is == null)
      return;
    Material fuel = is.getType();
    if (!is.hasItemMeta() || !is.getItemMeta().hasDisplayName())
      return;
    ChatColor fuelColor = findColor(is.getItemMeta().getDisplayName());

    ItemStack tool = event.getResult();
    ItemStack oldtool = event.getSource();
    ItemMeta metaold;
    if (oldtool.hasItemMeta())
      metaold = oldtool.getItemMeta();
    else
      metaold = Bukkit.getItemFactory().getItemMeta(oldtool.getType());

    if (!metaold.hasLore()) {
      event.setCancelled(true);
      event.setResult(oldtool);
      return;
    }

    boolean namTest = false;
    for (String n : metaold.getLore())
      if (ChatColor.stripColor(n).equalsIgnoreCase("(Socket)")) {
        namTest = true;
      }
    if (!namTest) {
      event.setResult(event.getSource());
      return;
    }

    tool.addUnsafeEnchantments(oldtool.getEnchantments());

    ItemMeta meta = tool.getItemMeta();
    if (fuel.equals(Material.SKULL_ITEM)) {
      ChatColor color = ChatColor.WHITE;
      if (metaold.hasDisplayName())
        color = findColor(metaold.getDisplayName());
      SkullMeta skull = (SkullMeta) is.getItemMeta();
      String skullName = skull.getOwner();
      if ((skullName == null) || (skullName.trim().length() < 1)) {
View Full Code Here

public class WarTagListener implements Listener {
  @EventHandler(priority = EventPriority.HIGHEST)
  public void onNameTag(PlayerReceiveNameTagEvent event) {
    Team team = Team.getTeamByPlayerName(event.getNamedPlayer().getName());
    if (team != null) {
      ChatColor teamColor = team.getKind().getColor();
      event.setTag(teamColor + event.getNamedPlayer().getName());
    }
  }
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.