Java Code Examples for org.bukkit.ChatColor#DARK_GRAY

The following examples show how to use org.bukkit.ChatColor#DARK_GRAY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScoreboardManager.java    From UhcCore with GNU General Public License v3.0 6 votes vote down vote up
public String getScoreboardLine(int line){
    if (line == 0) return ChatColor.UNDERLINE + "" + ChatColor.RESET;
    if (line == 1) return ChatColor.ITALIC + "" + ChatColor.RESET;
    if (line == 2) return ChatColor.BOLD + "" + ChatColor.RESET;
    if (line == 3) return ChatColor.RESET + "" + ChatColor.RESET;
    if (line == 4) return ChatColor.GREEN + "" + ChatColor.RESET;
    if (line == 5) return ChatColor.DARK_GRAY + "" + ChatColor.RESET;
    if (line == 6) return ChatColor.GOLD + "" + ChatColor.RESET;
    if (line == 7) return ChatColor.RED + "" + ChatColor.RESET;
    if (line == 8) return ChatColor.YELLOW + "" + ChatColor.RESET;
    if (line == 9) return ChatColor.WHITE + "" + ChatColor.RESET;
    if (line == 10) return ChatColor.DARK_GREEN + "" + ChatColor.RESET;
    if (line == 11) return ChatColor.BLUE + "" + ChatColor.RESET;
    if (line == 12) return ChatColor.STRIKETHROUGH + "" + ChatColor.RESET;
    if (line == 13) return ChatColor.MAGIC + "" + ChatColor.RESET;
    if (line == 14) return ChatColor.DARK_RED + "" + ChatColor.RESET;
    return null;
}
 
Example 2
Source File: TeamAddCommand.java    From UHC with MIT License 6 votes vote down vote up
@Override
protected boolean runCommand(CommandSender sender, OptionSet options) {
    final Team team = teamSpec.value(options);
    final Set<OfflinePlayer> players = Sets.newHashSet(playersSpec.values(options));
    players.removeAll(team.getPlayers());

    for (final OfflinePlayer player : players) {
        team.addPlayer(player);
    }

    final Set<OfflinePlayer> finalTeam = team.getPlayers();

    final String members = finalTeam.size() == 0
            ? ChatColor.DARK_GRAY + "No members"
            : Joiner.on(", ").join(Iterables.transform(team.getPlayers(), FunctionalUtil.PLAYER_NAME_FETCHER));

    sender.sendMessage(messages.evalTemplate(
            "added",
            ImmutableMap.of(
                    "count", players.size(),
                    "players", members
            )
    ));
    return false;
}
 
Example 3
Source File: GeneralSection.java    From HeavySpleef with GNU General Public License v3.0 6 votes vote down vote up
public GeneralSection(ConfigurationSection section) {
	String prefix = section.getString("spleef-prefix");
	if (prefix != null) {
		this.spleefPrefix = ChatColor.translateAlternateColorCodes(TRANSLATE_CHAR, prefix);
	} else {
		this.spleefPrefix = ChatColor.DARK_GRAY + "[" + ChatColor.GOLD + ChatColor.BOLD + "Spleef" + ChatColor.DARK_GRAY + "]";
	}
	
	this.whitelistedCommands = section.getStringList("command-whitelist");
	String vipPrefix = section.getString("vip-prefix");
	if (vipPrefix != null) {
		this.vipPrefix = ChatColor.translateAlternateColorCodes(TRANSLATE_CHAR, vipPrefix);
	} else {
		this.vipPrefix = ChatColor.RED.toString();
	}
	
	this.vipJoinFull = section.getBoolean("vip-join-full", true);
	this.pvpTimer = section.getInt("pvp-timer", 0);
	this.broadcastGameStart = section.getBoolean("broadcast-game-start", true);
	this.broadcastGameStartBlacklist = section.getStringList("broadcast-game-start-blacklist");
	this.winMessageToAll = section.getBoolean("win-message-to-all", true);
       this.warmupMode = section.getBoolean("warmup-mode", false);
       this.warmupTime = section.getInt("warmup-time", 10);
       this.adventureMode = section.getBoolean("adventure-mode", true);
}
 
Example 4
Source File: SidebarMatchModule.java    From PGM with GNU Affero General Public License v3.0 5 votes vote down vote up
private String renderScore(Competitor competitor, Party viewingParty) {
  ScoreMatchModule smm = match.needModule(ScoreMatchModule.class);
  String text = ChatColor.WHITE.toString() + (int) smm.getScore(competitor);
  if (smm.hasScoreLimit()) {
    text += ChatColor.DARK_GRAY + "/" + ChatColor.GRAY + smm.getScoreLimit();
  }
  return text;
}
 
Example 5
Source File: ScoreboardSlot.java    From 1.13-Command-API with Apache License 2.0 5 votes vote down vote up
/**
 * Determines the scoreboard slot value based on an internal Minecraft integer
 * @param i the scoreboard slot value
 */
public ScoreboardSlot(int i) {
	//Initialize displaySlot
	switch(i) {
		case 0: displaySlot = DisplaySlot.PLAYER_LIST; break;
		case 1: displaySlot = DisplaySlot.SIDEBAR; break;
		case 2: displaySlot = DisplaySlot.BELOW_NAME; break;
		default: displaySlot = DisplaySlot.SIDEBAR; break;
	}
	
	//Initialize teamColor
	switch(i) {
		case 3: teamColor = ChatColor.BLACK; break;
		case 4: teamColor = ChatColor.DARK_BLUE; break;
		case 5: teamColor = ChatColor.DARK_GREEN; break;
		case 6: teamColor = ChatColor.DARK_AQUA; break;
		case 7: teamColor = ChatColor.DARK_RED; break;
		case 8: teamColor = ChatColor.DARK_PURPLE; break;
		case 9: teamColor = ChatColor.GOLD; break;
		case 10: teamColor = ChatColor.GRAY; break;
		case 11: teamColor = ChatColor.DARK_GRAY; break;
		case 12: teamColor = ChatColor.BLUE; break;
		case 13: teamColor = ChatColor.GREEN; break;
		case 14: teamColor = ChatColor.AQUA; break;
		case 15: teamColor = ChatColor.RED; break;
		case 16: teamColor = ChatColor.LIGHT_PURPLE; break;
		case 17: teamColor = ChatColor.YELLOW; break;
		case 18: teamColor = ChatColor.WHITE; break;
		default: teamColor = null; break;
	}
}
 
Example 6
Source File: Signs.java    From AnnihilationPro with MIT License 5 votes vote down vote up
public boolean addSign(AnniSign sign)
	{
		ChatColor g = ChatColor.DARK_GRAY;
		MapKey key = MapKey.getKey(sign.getLocation());
		if(!signs.containsKey(key))
		{
			String[] lore;
//			if(sign.getType().equals(SignType.Brewing))
//				lore = new String[]{g+"["+ChatColor.DARK_PURPLE+"Shop"+g+"]",ChatColor.BLACK+"Brewing"};
//			else if(sign.getType().equals(SignType.Weapon))
//				lore = new String[]{g+"["+ChatColor.DARK_PURPLE+"Shop"+g+"]",ChatColor.BLACK+"Weapon"};
//			else
//			{
//				AnniTeam team = sign.getType().getTeam();
//				lore = new String[]{ChatColor.DARK_PURPLE+"Right Click",ChatColor.DARK_PURPLE+"To Join:",team.getColoredName()+" Team"};
//			}
			if(sign.getType().equals(SignType.Brewing))
				lore = new String[]{g+"["+Lang.SHOP.toString()+g+"]",Lang.BREWINGSIGN.toString()};
			else if(sign.getType().equals(SignType.Weapon))
				lore = new String[]{g+"["+Lang.SHOP.toString()+g+"]",Lang.WEAPONSIGN.toString()};
			else
			{
				AnniTeam team = sign.getType().getTeam();
				lore = Lang.TEAMSIGN.toStringArray(team.getExternalColoredName());
			}
			placeSignInWorld(sign,lore);
			signs.put(key, sign);
			return true;
		}
		return false;
	}
 
Example 7
Source File: Announcer.java    From DungeonsXL with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Updates the buttons to group changes.
 */
public void updateButtons() {
    int groupCount = 0;

    buttons = new ArrayList<>(dGroups.size());
    do {
        String name = ChatColor.DARK_GRAY + "EMPTY GROUP";
        int playerCount = 0;
        List<String> lore = new ArrayList<>();

        DGroup dGroup = dGroups.get(groupCount);
        if (!plugin.getGroupCache().contains(dGroup)) {
            dGroups.set(groupCount, null);

        } else if (dGroup != null) {
            name = ChatColor.AQUA + dGroup.getName();
            playerCount = dGroup.getMembers().size();
            for (Player player : dGroup.getMembers().getOnlinePlayers()) {
                lore.add((dGroup.getLeader().equals(player) ? ChatColor.GOLD : ChatColor.GRAY) + player.getName());
            }
        }

        boolean full = playerCount >= maxPlayersPerGroup;

        Color color = plugin.getMainConfig().getGroupColorPriority(groupCount);
        ItemStack button = color.getWoolMaterial().toItemStack();
        ItemMeta meta = button.getItemMeta();
        meta.setDisplayName(name + (full ? ChatColor.DARK_RED : ChatColor.GREEN) + " [" + playerCount + "/" + maxPlayersPerGroup + "]");
        meta.setLore(lore);
        button.setItemMeta(meta);
        buttons.add(button);

        groupCount++;
    } while (groupCount != maxGroupsPerGame);
}
 
Example 8
Source File: PlayerLanguageOption.java    From Slimefun4 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Optional<ItemStack> getDisplayItem(Player p, ItemStack guide) {
    if (SlimefunPlugin.getLocalization().isEnabled()) {
        Language language = SlimefunPlugin.getLocalization().getLanguage(p);
        String languageName = language.isDefault() ? (SlimefunPlugin.getLocalization().getMessage(p, "languages.default") + ChatColor.DARK_GRAY + " (" + language.getName(p) + ")") : SlimefunPlugin.getLocalization().getMessage(p, "languages." + language.getId());

        return Optional.of(new CustomItem(language.getItem(), "&7" + SlimefunPlugin.getLocalization().getMessage(p, "guide.languages.selected-language") + " &a" + languageName, "", "&7You now have the option to change", "&7the language in which Slimefun", "&7will send you messages.", "&7Note that this only translates", "&7some messages, not items.", "&7&oThis feature is still being worked on", "", "&7\u21E8 &eClick to change your language"));
    }
    else {
        return Optional.empty();
    }
}
 
Example 9
Source File: HeaderModule.java    From CardinalPGM with MIT License 5 votes vote down vote up
public void updateFooter() {
    footer = new UnlocalizedChatMessage(ChatColor.BOLD + message + ChatColor.RESET +
            ChatColor.DARK_GRAY + " - " + ChatColor.GRAY + "{0}: " +
            (GameHandler.getGameHandler().getMatch().isRunning() ? ChatColor.GREEN : ChatColor.GOLD) +
            Strings.formatTime(MatchTimer.getTimeInSeconds()) + ChatColor.DARK_GRAY + " - " +
            ChatColor.WHITE + ChatColor.BOLD + "Cardinal", ChatConstant.UI_TIME.asMessage());
}
 
Example 10
Source File: MiscUtil.java    From CardinalPGM with MIT License 5 votes vote down vote up
public static ChatColor convertDyeColorToChatColor(DyeColor dye) {
    switch (dye) {
        case WHITE:
            return ChatColor.WHITE;
        case ORANGE:
            return ChatColor.GOLD;
        case MAGENTA:
            return ChatColor.LIGHT_PURPLE;
        case LIGHT_BLUE:
            return ChatColor.BLUE;
        case YELLOW:
            return ChatColor.YELLOW;
        case LIME:
            return ChatColor.GREEN;
        case PINK:
            return ChatColor.RED;
        case GRAY:
            return ChatColor.DARK_GRAY;
        case SILVER:
            return ChatColor.GRAY;
        case CYAN:
            return ChatColor.DARK_AQUA;
        case PURPLE:
            return ChatColor.DARK_PURPLE;
        case BLUE:
            return ChatColor.DARK_BLUE;
        case BROWN:
            return ChatColor.GOLD;
        case GREEN:
            return ChatColor.DARK_GREEN;
        case RED:
            return ChatColor.DARK_RED;
        case BLACK:
            return ChatColor.BLACK;
    }

    return ChatColor.WHITE;
}
 
Example 11
Source File: MiscUtil.java    From CardinalPGM with MIT License 5 votes vote down vote up
public static ChatColor convertBannerColorToChatColor(DyeColor dye) {
    switch (dye) {
        case WHITE:
            return ChatColor.WHITE;
        case ORANGE:
            return ChatColor.GOLD;
        case MAGENTA:
            return ChatColor.LIGHT_PURPLE;
        case LIGHT_BLUE:
            return ChatColor.BLUE;
        case YELLOW:
            return ChatColor.YELLOW;
        case LIME:
            return ChatColor.GREEN;
        case PINK:
            return ChatColor.RED;
        case GRAY:
            return ChatColor.DARK_GRAY;
        case SILVER:
            return ChatColor.GRAY;
        case CYAN:
            return ChatColor.DARK_AQUA;
        case PURPLE:
            return ChatColor.DARK_PURPLE;
        case BLUE:
            return ChatColor.BLUE;
        case BROWN:
            return ChatColor.GOLD;
        case GREEN:
            return ChatColor.DARK_GREEN;
        case RED:
            return ChatColor.DARK_RED;
        case BLACK:
            return ChatColor.BLACK;
    }

    return ChatColor.WHITE;
}
 
Example 12
Source File: DestroyableCommands.java    From ProjectAres with GNU Affero General Public License v3.0 4 votes vote down vote up
private String formatProperty(String name, Object value) {
    return "  " + ChatColor.GRAY + name + ChatColor.DARK_GRAY + ": " + ChatColor.WHITE + value;
}
 
Example 13
Source File: Contributor.java    From Slimefun4 with GNU General Public License v3.0 4 votes vote down vote up
public String getDisplayName() {
    return ChatColor.GRAY + githubUsername + (!githubUsername.equals(minecraftUsername) ? ChatColor.DARK_GRAY + " (MC: " + minecraftUsername + ")" : "");
}
 
Example 14
Source File: TeamTabEntry.java    From CardinalPGM with MIT License 4 votes vote down vote up
@Override
public String getDisplayName(Player viewer) {
    return team.size() + "" + ChatColor.DARK_GRAY + "/" + ChatColor.GRAY + team.getMax() + " " + team.getColor() + ChatColor.BOLD + team.getName();
}
 
Example 15
Source File: HeaderModule.java    From CardinalPGM with MIT License 4 votes vote down vote up
public void updateHeader() {
    header = new LocalizedChatMessage(ChatConstant.MISC_BY,
            new UnlocalizedChatMessage("" + ChatColor.AQUA + ChatColor.BOLD + mapName + ChatColor.DARK_GRAY),
            ChatUtil.toChatMessage(authors.stream()
                    .map(Contributor::getDisplayName).collect(Collectors.toList()), ChatColor.RESET, ChatColor.DARK_GRAY));
}