Java Code Examples for org.bukkit.ChatColor#DARK_PURPLE

The following examples show how to use org.bukkit.ChatColor#DARK_PURPLE . 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: AutoRestarter.java    From AnnihilationPro with MIT License 6 votes vote down vote up
private void beginRestart()
{
	canRun = false;
	countingDown = true;
	data = AnnounceBar.getInstance().getData();
	if(GameVars.getEndOfGameCommand().equals(""))
	{
		Bukkit.broadcastMessage("The auto restart feature has been activated, but no end of game command was specified.");
		Bukkit.broadcastMessage("Please have an admin set an end of game command if he wants this feature to work.");
	}
	else
	{
		Bukkit.getConsoleSender().sendMessage(ChatColor.RED+"Auto-restart actvated! restarting the server in "+this.countdown+" seconds.");
           Announcement ann = new Announcement(ChatColor.DARK_PURPLE + "Auto-restart in: {#}");
           ann.setTime(this.countdown).setCallback(new Runnable()
           {
               @Override
               public void run()
               {
                   countingDown = false;
                   Bukkit.dispatchCommand(Bukkit.getConsoleSender(), GameVars.getEndOfGameCommand());
               }
           });
           AnnounceBar.getInstance().countDown(ann);
	}
}
 
Example 2
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 3
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 4
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 5
Source File: ClassCommands.java    From CardinalPGM with MIT License 5 votes vote down vote up
@Command(aliases = {"class", "cl"}, desc = "Allows you to change your class.")
public static void classCommand(final CommandContext cmd, CommandSender sender) throws CommandException {
    if (!(sender instanceof Player)) {
        throw new CommandException(ChatConstant.ERROR_CONSOLE_NO_USE.getMessage(ChatUtil.getLocale(sender)));
    }
    if (GameHandler.getGameHandler().getMatch().getModules().getModule(ClassModule.class) == null) {
        throw new CommandException(ChatConstant.ERROR_CLASSES_DISABLED.getMessage(ChatUtil.getLocale(sender)));
    }
    if (cmd.argsLength() == 0) {
        if (ClassModule.getClassByPlayer((Player) sender) != null) {
            sender.sendMessage(ChatColor.GREEN + new LocalizedChatMessage(ChatConstant.GENERIC_CLASS_CURRENT).getMessage(ChatUtil.getLocale(sender)) + " " + ChatColor.GOLD + "" + ChatColor.UNDERLINE + ClassModule.getClassByPlayer((Player) sender).getName());
            String classMessage = new LocalizedChatMessage(ChatConstant.GENERIC_CLASS_LIST).getMessage(((Player) sender).getLocale());
            String newClassMessage = "";
            for (int i = 0; i < classMessage.split("'").length; i++) {
                newClassMessage += (i == 1 ? ChatColor.GOLD : ChatColor.DARK_PURPLE) + (i > 0 ? "'" : "") + classMessage.split("'")[i];
            }
            sender.sendMessage(newClassMessage);
        }
    } else {
        String input = cmd.getJoinedStrings(0);
        if (ClassModule.getClassByName(input) == null) {
            throw new CommandException(ChatConstant.ERROR_NO_CLASS.getMessage(ChatUtil.getLocale(sender)));
        }
        ClassModule.playerClass.put(((Player) sender).getUniqueId(), ClassModule.getClassByName(input));
        ClassChangeEvent changeEvent = new ClassChangeEvent((Player) sender, ClassModule.getClassByName(input));
        Bukkit.getServer().getPluginManager().callEvent(changeEvent);
    }
}
 
Example 6
Source File: LoadedMap.java    From CardinalPGM with MIT License 4 votes vote down vote up
public ChatMessage toChatMessage(boolean showId) {
    return new LocalizedChatMessage(ChatConstant.MISC_BY,
            new UnlocalizedChatMessage(toShortMessage(ChatColor.GOLD, showId, false) + ChatColor.DARK_PURPLE),
            ChatUtil.toChatMessage(getAuthors().stream()
                    .map(Contributor::getName).collect(Collectors.toList())));
}