Java Code Examples for org.bukkit.ChatColor#BLACK

The following examples show how to use org.bukkit.ChatColor#BLACK . 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: 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 2
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 3
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 4
Source File: AI.java    From Civs with GNU General Public License v3.0 4 votes vote down vote up
public String getDisplayName() {
    return ChatColor.GREEN + "[" + town.getName() + "] " +
            ChatColor.BLACK + ChatColor.MAGIC + townName + ChatColor.RESET;
}
 
Example 5
Source File: GameObjectiveScoreboardHandler.java    From CardinalPGM with MIT License 4 votes vote down vote up
public String getCompactPrefix(TeamModule team) {
    String prefix;
    if (objective instanceof WoolObjective) {
        WoolObjective wool = (WoolObjective) objective;
        if (wool.isComplete()) {
            prefix = MiscUtil.convertDyeColorToChatColor(wool.getColor()) + " \u2B1B ";
        } else if (wool.isTouched() && (this.team == team || team.isObserver())) {
            prefix = MiscUtil.convertDyeColorToChatColor(wool.getColor()) + " \u2592 ";
        } else {
            prefix = MiscUtil.convertDyeColorToChatColor(wool.getColor()) + " \u2B1C ";
        }
    } else if (objective instanceof CoreObjective) {
        CoreObjective core = (CoreObjective) objective;
        if (core.isComplete()) {
            prefix = ChatColor.GREEN + " \u2714 ";
        } else if (core.isTouched() && this.team != team) {
            prefix = ChatColor.YELLOW + " \u2733 ";
        } else {
            prefix = ChatColor.RED + " \u2715 ";
        }
    } else if (objective instanceof DestroyableObjective) {
        DestroyableObjective destroyable = (DestroyableObjective) objective;
        if (destroyable.isComplete()) {
            prefix = ChatColor.GREEN + " \u2714 ";
        } else if (destroyable.isTouched()) {
            if (team.isObserver()) {
                prefix = ChatColor.YELLOW + " " + destroyable.getPercent() + "% ";
            } else if (destroyable.showPercent()) {
                if (this.team == team) {
                    prefix = ChatColor.YELLOW + " " + destroyable.getPercent() + "% ";
                } else {
                    prefix = ChatColor.RED + " " + destroyable.getPercent() + "% ";
                }
            } else {
                if (this.team == team) {
                    prefix = ChatColor.YELLOW + " \u2733 ";
                } else {
                    prefix = ChatColor.RED + " \u2715 ";
                }
            }
        } else {
            prefix = ChatColor.RED + " \u2715 ";
        }
    } else if (objective instanceof FlagObjective) {
        FlagObjective flagObjective = (FlagObjective) objective;
        if (flagObjective.isRespawning() && flagObjective.getRespawnTime() > 0) {
            prefix = ChatColor.GRAY + " " + flagObjective.getRespawnTime() + " ";
        } else if (flagObjective.isDropped() && flagObjective.getRecoverTime() > 0) {
            prefix = ChatColor.AQUA + " " + flagObjective.getRecoverTime() + " ";
        } else if (flagObjective.isCarried()) {
            ChatColor teamColor = (System.currentTimeMillis() / 250) % 2 == 0 ? (flagObjective.isShared() ? Teams.getTeamColorByPlayer(flagObjective.getPicker()) : flagObjective.getChatColor()) : ChatColor.BLACK;
            prefix = teamColor + " \u2794 ";
        } else {
            ChatColor color = flagObjective.isRespawning() ? ChatColor.GRAY : (flagObjective.isShared() ? ChatColor.WHITE : flagObjective.getChatColor());
            prefix = color + (flagObjective.isOnPost() ? " \u2691 " : " \u2690 ");
        }
    } else {
        prefix = "";
    }
    return prefix;
}