当前位置: 首页>>代码示例>>Java>>正文


Java ChatColor.BLUE属性代码示例

本文整理汇总了Java中org.bukkit.ChatColor.BLUE属性的典型用法代码示例。如果您正苦于以下问题:Java ChatColor.BLUE属性的具体用法?Java ChatColor.BLUE怎么用?Java ChatColor.BLUE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.ChatColor的用法示例。


在下文中一共展示了ChatColor.BLUE属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getColor

public static Color getColor(ChatColor color) {
    if (color == ChatColor.RED) {
        return Color.RED;
    } else if (color == ChatColor.BLUE) {
        return Color.BLUE;
    } else if (color == ChatColor.LIGHT_PURPLE) {
        return Color.FUCHSIA;
    } else if (color == ChatColor.GREEN) {
        return Color.GREEN;
    } else if (color == ChatColor.YELLOW) {
        return Color.YELLOW;
    } else if (color == ChatColor.GOLD) {
        return Color.ORANGE;
    } else if (color == ChatColor.AQUA) {
        return Color.AQUA;
    } else if (color == ChatColor.DARK_PURPLE) {
        return Color.PURPLE;
    } else {
        return Color.WHITE;
    }
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:21,代码来源:ColorConverter.java

示例2: onCommand

@Override
protected boolean onCommand(CommandSender sender, String label, String[] arguments)
{
    if (!hasPermission(sender, "api.modo.speakup"))
        return true;

    if(arguments.length == 0)
        return true;

    ChatColor color = ChatColor.BLUE;
    String tag = "Modération";

    if (SamaGamesAPI.get().getPermissionsManager().getPlayer(((Player) sender).getUniqueId()).getGroupId() == 8)
    {
        color = ChatColor.DARK_PURPLE;
        tag = "Animation";
    }

    Bukkit.broadcastMessage(color + "" + ChatColor.BOLD + "[" + tag + "] " + sender.getName() + ": " + StringUtils.join(arguments, " "));

    return true;
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:22,代码来源:CommandSpeakup.java

示例3: getChatColor

public static ChatColor getChatColor(Color color) {
    if (color == Color.RED) {
        return ChatColor.RED;
    } else if (color == Color.BLUE) {
        return ChatColor.BLUE;
    } else if (color == Color.PURPLE) {
        return ChatColor.DARK_PURPLE;
    } else if (color == Color.GREEN) {
        return ChatColor.GREEN;
    } else if (color == Color.YELLOW) {
        return ChatColor.YELLOW;
    } else {
        return ChatColor.WHITE;
    }
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:15,代码来源:ColorConverter.java

示例4: convertDyeColorToChatColor

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;
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:38,代码来源:ColorConverter.java

示例5: coloredVisibility

private static String coloredVisibility(ServerDoc.Visibility visibility) {
    switch(visibility) {
        case PRIVATE: return ChatColor.BLUE + "private";
        case UNLISTED: return ChatColor.YELLOW + "unlisted";
        case PUBLIC: return ChatColor.GREEN + "public";
        default: return ChatColor.RED + "unknown";
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:8,代码来源:ServerVisibilityCommands.java

示例6: SpyChannel

public SpyChannel() {
	super(ChatColor.BLUE + "Spy", null, true);
	
	setDefaultRank(new DDGStaffChannelRank(defaultRank));
	motd.clear();
	motd.add(ChatColor.WHITE + "Welkom in het SpyChannel!");
	motd.add(ChatColor.WHITE + "Hier komen alle channel messages en private messages binnen.");
}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:8,代码来源:SpyChannel.java

示例7: onEnable

public void onEnable() {
	Hive.getInstance().setType(GameType.WALLS);
       
	GREEN = new Team(ChatColor.GREEN);
	RED = new Team(ChatColor.RED);
	YELLOW = new Team(ChatColor.YELLOW);
	BLUE = new Team(ChatColor.BLUE);

       GameEvents = new GameEvents();
	Events = new Events();
	PreEvents = new PreEvents();
	
	new Config();

       getCommand("team").setExecutor(new TeamChatCmd());
       getCommand("help").setExecutor(new HelpCmd());
       getCommand("time").setExecutor(new TimeCmd());
       getCommand("teleport").setExecutor(new TeleportCmd());
       getCommand("kit").setExecutor(new KitCmd());
       getCommand("blue").setExecutor(new TeamCmd());
       getCommand("red").setExecutor(new TeamCmd());
       getCommand("yellow").setExecutor(new TeamCmd());
       getCommand("green").setExecutor(new TeamCmd());
	PreTask.TIMER.schedule(new PreTask(), 0, 1000);

       Kit.load();
       
   	new BukkitRunnable() {
       	public void run() {
       		for (Player p : Bukkit.getOnlinePlayers()) {
       			if (Kit.getKit(p).getName().equalsIgnoreCase("scout"))
       				p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 2147483647, 1), false);
       		}
       	}
       }.runTaskTimerAsynchronously(this, 0, 120);
}
 
开发者ID:thekeenant,项目名称:mczone,代码行数:36,代码来源:Walls.java

示例8: stringToChatColor

public static ChatColor stringToChatColor(String str) {
	switch(str.toLowerCase()) {
		case "aqua":
			return ChatColor.AQUA;
		case "black":
			return ChatColor.BLACK;
		case "blue":
			return ChatColor.BLUE;
		case "dark_blue":
			return ChatColor.DARK_BLUE;
		case "dark_gray":
			return ChatColor.DARK_GRAY;
		case "dark_green":
			return ChatColor.DARK_GREEN;
		case "dark_purple":
			return ChatColor.DARK_PURPLE;
		case "dark_red":
			return ChatColor.DARK_RED;
		case "gold":
			return ChatColor.GOLD;
		case "gray":
			return ChatColor.GRAY;
		case "green":
			return ChatColor.GREEN;
		case "light_puple":
			return ChatColor.LIGHT_PURPLE;
		case "white":
			return ChatColor.WHITE;
		case "yellow":
			return ChatColor.YELLOW;
		default:
			return ChatColor.RED;
	}
}
 
开发者ID:benNek,项目名称:AsgardAscension,代码行数:34,代码来源:Convert.java

示例9: onCommand

@Override
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {

	if (cmd.getName().equalsIgnoreCase("crescent")) {

		if (!sender.hasPermission("crescent.commands")) {
			sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
			return true;
		}

		if (args.length == 0) {
			String[] message = { ChatColor.BLUE + "Crescent",
					ChatColor.WHITE + "/crescent learn - Enable learning mode.", ChatColor.WHITE
							+ "/crescent doescheat [player] [yes/no/undefined] - Mark a player as a cheater or as a legitimate user so we can use their information to add to the database. If you want to reset it, use the undefined option." };
			sender.sendMessage(message);
			return true;
		}

		final String subCommand = args[0];

		if (subCommand.equalsIgnoreCase("learn")) {

			final boolean current = Crescent.getInstance().getConfig().getBoolean("learnMode");

			Crescent.getInstance().getConfig().set("learnMode", !current);

			final ChatColor colour = current ? ChatColor.RED : ChatColor.GREEN;

			sender.sendMessage(colour + "You have " + ((current) ? "disabled" : "enabled") + " learning mode.");
			return true;
		} else if (subCommand.equalsIgnoreCase("doescheat")) {

			if (args.length < 3) {
				sender.sendMessage(ChatColor.RED + "You must include the player and whether they cheat or not.");
				return true;
			}

			final String player = args[1];

			final Player target = Bukkit.getPlayer(player);

			if (target == null) {
				sender.sendMessage(ChatColor.RED + "That player is not online.");
				return true;
			}

			final String doesCheat = args[2];
			final KnownCheating cheating;

			switch (doesCheat.toLowerCase()) {
			case "yes":
				cheating = KnownCheating.YES;
				break;
			case "no":
				cheating = KnownCheating.NO;
				break;
			case "undefined":
				cheating = KnownCheating.UNDEFINED;
				break;
			default:
				sender.sendMessage(ChatColor.RED + "That is not a valid option.");
				return true;
			}

			Profile.getProfile(target.getUniqueId()).setKnownCheating(cheating);

			sender.sendMessage(ChatColor.GREEN + "You have let the system know that " + target.getName()
					+ "'s cheating status is: " + cheating.toString() + ".");

			return true;
		}

		return true;
	}

	return true;
}
 
开发者ID:davidm98,项目名称:Crescent,代码行数:77,代码来源:CommandCrescent.java

示例10: execute

@Override
public void execute(Player player, String[] args) {

    if (args.length == 0) {
        player.sendMessage(usage());
        return;
    }

    Player user = Bukkit.getPlayer(args[1]);
    if (user == null) {
        player.sendMessage(ChatColor.RED + "Player not found.");
        return;
    }


    player.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "----------------------------------------------------");
    player.sendMessage(ChatColor.RED + ChatUtility.getCenteredMessage("Viewing report for " + ChatColor.GREEN + user.getName()));
    player.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "----------------------------------------------------");

    // get basic info about the player.
    String OP = user.isOp() ? ChatColor.RED + "true" : ChatColor.GREEN + "false";
    String gamemode = ChatColor.GOLD + "GameMode: " + ChatColor.BLUE + StringUtils.capitalize(user.getGameMode().toString()
            .toLowerCase());
    String world = ChatColor.GOLD + "World: " + ChatColor.BLUE + user.getWorld().getName();

    // send them their total violation level
    int totalLevel = Arc.getViolationHandler().getViolationData(user).getTotalLevel();
    player.sendMessage(ChatUtility.getCenteredMessage(ChatColor.GREEN + "" + user.getName() + "'s total violation level: " + ChatColor.RED + totalLevel));

    // append the cheatprobability.
    CheatProbability probability = totalLevel <= 30 ? CheatProbability.NOT_LIKELY : totalLevel <= 60 ? CheatProbability.LIKELY :
            CheatProbability.DEFINITELY;
    player.sendMessage(ChatUtility.getCenteredMessage(ChatColor.GREEN + "Probability this player is cheating: " + ChatColor.RED +
            probability.getName()));

    // Send some basic stats.
    player.sendMessage(ChatUtility.getCenteredMessage(ChatColor.DARK_GRAY + "[" + ChatColor.GOLD
            + "Operator: " + OP + ChatColor.DARK_GRAY + "] [" + gamemode + ChatColor.DARK_GRAY + "] [" + world + ChatColor.DARK_GRAY +
            "]"));

    // start displaying check info.
    player.sendMessage(ChatColor.GOLD + "" + ChatColor.STRIKETHROUGH + "----------------------------------------------------");

    Map<CheckType, Integer> checks = Arc.getViolationHandler().getViolationData(user).getViolatedChecks();
    List<String> sorted = new ArrayList<>();

    // get all checks we have failed and put them in a list to be sorted.
    for (CheckType check : checks.keySet()) {
        int violationLevel = checks.get(check);
        String centered = ChatUtility.getCenteredMessage(ChatColor.RED + check.getCheckName() + ChatColor.GOLD + " violations: " +
                ChatColor.RED + violationLevel + ChatColor.GOLD + ".");
        sorted.add(centered);
    }

    // sort and send.
    sorted.sort(Comparator.comparingInt(String::length));
    sorted.forEach(player::sendMessage);

}
 
开发者ID:Vrekt,项目名称:Arc-v2,代码行数:59,代码来源:CommandSummary.java

示例11: getDisplayName

@Override
public String getDisplayName(Faction faction) {
    return ChatColor.BLUE + getName() + ' ' + ChatColor.GOLD + getEventType().getDisplayName();
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:4,代码来源:EventFaction.java

示例12: getScoreboardName

public String getScoreboardName() {
    return ChatColor.BLUE  + ChatColor.BOLD.toString() + getName().replace("Candy", "§d§lCandy").replace("Ship", "§b§lShip").replace("Tower", "§e§lTower").replace("End", "§9§lEnd");
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:3,代码来源:EventFaction.java


注:本文中的org.bukkit.ChatColor.BLUE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。