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


Java ChatColor.WHITE属性代码示例

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


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

示例1: refreshTab

private void refreshTab(Player player) {
    MatchStatus matchStatus = TGM.get().getMatchManager().getMatch().getMatchStatus();

    ChatColor timeColor = ChatColor.GREEN;
    if (matchStatus == MatchStatus.PRE) {
        timeColor = ChatColor.GOLD;
    } else if (matchStatus == MatchStatus.POST) {
        timeColor = ChatColor.RED;
    }

    String header = ChatColor.WHITE + ChatColor.BOLD.toString() + TGM.get().getMatchManager().getMatch().getMapContainer().getMapInfo().getGametype().toString() +
                    ChatColor.DARK_GRAY + " - " + timeColor + Strings.formatTime(TGM.get().getMatchManager().getMatch().getModule(TimeModule.class).getTimeElapsed()) +
                    ChatColor.DARK_GRAY + " - " + ChatColor.WHITE + ChatColor.BOLD.toString() + "WARZONE";

    String footer = "";
    for (MatchTeam matchTeam : teamManagerModule.getTeams()) {
        if (matchTeam.isSpectator()) continue;
        footer += matchTeam.getColor() + matchTeam.getAlias() + ": " + ChatColor.WHITE + matchTeam.getMembers().size() + ChatColor.DARK_GRAY + "/" + ChatColor.GRAY + matchTeam.getMax();
        footer += ChatColor.DARK_GRAY + " - ";
    }
    footer += ChatColor.AQUA + "Spectators: " + ChatColor.WHITE + TGM.get().getModule(TeamManagerModule.class).getSpectators().getMembers().size();


    TitleAPI.sendTabTitle(player, header, footer);
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:25,代码来源:TabListModule.java

示例2: KingdomChannelRank

public KingdomChannelRank(KingdomRank rank) {
	this.rank = rank;
	if (rank != null) {
		if(rank == KingdomRank.SPELER) {
			name = "";
		} else {
		name = rank.getPrefix();
		}
		if (rank == KingdomRank.KONING) {
			cooldown = 0;
			messageColour = ChatColor.WHITE;
			canMute = true;
			canSetMode = true;
		} else if (rank == KingdomRank.WACHTER){ 
			cooldown = 0;
			messageColour = ChatColor.WHITE;
			canMute = true;
		} else {
			cooldown = 3;
		}
	} else {
		cooldown = 5;
	}
}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:24,代码来源:KingdomChannelRank.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: CommandAliasHelpTopic

public CommandAliasHelpTopic(String alias, String aliasFor, HelpMap helpMap) {
    this.aliasFor = aliasFor.startsWith("/") ? aliasFor : "/" + aliasFor;
    this.helpMap = helpMap;
    this.name = alias.startsWith("/") ? alias : "/" + alias;
    Validate.isTrue(!this.name.equals(this.aliasFor), "Command " + this.name + " cannot be alias for itself");
    this.shortText = ChatColor.YELLOW + "Alias for " + ChatColor.WHITE + this.aliasFor;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:7,代码来源:CommandAliasHelpTopic.java

示例6: getArmorString

public static String getArmorString(PlayerDataRPG pd) {
    if (pd.horseArmor == null) {
        return ChatColor.GRAY + "No Armor";
    }
    switch (pd.horseArmor) {
        case IRON_BARDING:
            return ChatColor.WHITE + "Iron Armor";
        case GOLD_BARDING:
            return ChatColor.GOLD + "Gold Armor";
        case DIAMOND_BARDING:
            return ChatColor.AQUA + "Diamond Armor";
        default:
            return ChatColor.GRAY + "No Armor";
    }
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:15,代码来源:HorseVillager.java

示例7: 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

示例8: recalcPrefix

@Override
public void recalcPrefix(IRank unkownRank) {
if (unkownRank != null) {
	if(unkownRank instanceof KingdomRank) {
		KingdomRank rank = (KingdomRank) unkownRank;
		this.rank = rank;

			if(rank == KingdomRank.SPELER) {
				name = "";
			} else {
			name = rank.getPrefix();
			}
			if (rank == KingdomRank.KONING) {
				cooldown = 0;
				messageColour = ChatColor.WHITE;
				canMute = true;
				canSetMode = true;
			} else if (rank == KingdomRank.WACHTER){ 
				cooldown = 0;
				messageColour = ChatColor.WHITE;
				canMute = true;
			} else {
				cooldown = 3;
			}
		} else {
			cooldown = 5;
		}
	}

}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:30,代码来源:KingdomChannelRank.java

示例9: onCommand

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if (!(sender instanceof Player)) {
        sender.sendMessage(ChatColor.RED + "Only players can have faction invites.");
        return true;
    }

    List<String> receivedInvites = new ArrayList<>();
    for (Faction faction : plugin.getFactionManager().getFactions()) {
        if (faction instanceof PlayerFaction) {
            PlayerFaction targetPlayerFaction = (PlayerFaction) faction;
            if (targetPlayerFaction.getInvitedPlayerNames().contains(sender.getName())) {
                receivedInvites.add(targetPlayerFaction.getDisplayName(sender));
            }
        }
    }

    PlayerFaction playerFaction = plugin.getFactionManager().getPlayerFaction((Player) sender);
    String delimiter = ChatColor.WHITE + ", " + ChatColor.GRAY;

    if (playerFaction != null) {
        Set<String> sentInvites = playerFaction.getInvitedPlayerNames();
        sender.sendMessage(ChatColor.AQUA + "Sent by " + playerFaction.getDisplayName(sender) + ChatColor.AQUA + " (" + sentInvites.size() + ')' + ChatColor.DARK_AQUA + ": " + ChatColor.GRAY
                + (sentInvites.isEmpty() ? "Your faction has not invited anyone." : StringUtils.join(sentInvites, delimiter) + '.'));
    }

    sender.sendMessage(ChatColor.AQUA + "Requested (" + receivedInvites.size() + ')' + ChatColor.DARK_AQUA + ": " + ChatColor.GRAY
            + (receivedInvites.isEmpty() ? "No factions have invited you." : StringUtils.join(receivedInvites, ChatColor.WHITE + delimiter) + '.'));

    return true;
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:31,代码来源:FactionInvitesArgument.java

示例10: recalcPrefix

@Override
	public void recalcPrefix(IRank unkownRank) {
		if (unkownRank != null) {
		if(unkownRank instanceof FactionRank) {
	        FactionRank rank = (FactionRank) unkownRank;
	        
			this.rank = rank;
			if(rank == FactionRank.SPELER) {
				name = "";
			} else {
			name = rank.getPrefix();
			}
			if (rank == FactionRank.LEADER) {
				cooldown = 0;
				messageColour = ChatColor.WHITE;
				this.showName = true;
				canSetMode = true;
			} else if (rank == FactionRank.OFFICER){ 
				cooldown = 2;
				this.showName = true;
				messageColour = ChatColor.WHITE;
				
			} else {
				this.showName = false;
				cooldown = 5;
			}
		} else {
			this.showName = false;
			cooldown = 5;
		}
	}
}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:32,代码来源:FactionChannelRank.java

示例11: 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

示例12: executeBan

public boolean executeBan(String name, String uuid, String[] args, String banner, Player banned) {
    String time = args[1].toLowerCase();
    ZonedDateTime endTime = ZonedDateTime.now();
    String lengthDisplay = "";
    if (args[1].startsWith("perm")) {
        endTime = endTime.plusYears(1000);
        lengthDisplay = ChatColor.YELLOW + "permanently" + ChatColor.RED + " banned";
    } else {
        int amount = Integer.parseInt(time.replaceAll("[^0-9]", ""));
        if (time.endsWith("m")) {
            endTime = endTime.plusMinutes(amount);
            lengthDisplay = "banned for " + ChatColor.YELLOW + amount + " minute" + (amount != 1 ? "s" : "");
        } else if (time.endsWith("h")) {
            endTime = endTime.plusHours(amount);
            lengthDisplay = "banned for " + ChatColor.YELLOW + amount + " hour" + (amount != 1 ? "s" : "");
        } else if (time.endsWith("d")) {
            endTime = endTime.plusDays(amount);
            lengthDisplay = "banned for " + ChatColor.YELLOW + amount + " day" + (amount != 1 ? "s" : "");
        } else if (time.endsWith("w")) {
            endTime = endTime.plusWeeks(amount);
            lengthDisplay = "banned for " + ChatColor.YELLOW + amount + " week" + (amount != 1 ? "s" : "");
        } else {
            return false;
        }
    }
    lengthDisplay += ChatColor.RESET;
    StringBuilder sb = new StringBuilder();
    for (int k = 2; k < args.length; k++) {
        sb.append(args[k]);
        sb.append(' ');
    }
    final ZonedDateTime fEndTime = endTime;
    String reason = sb.toString().trim();
    RScheduler.scheduleAsync(plugin, () -> {
        AutoCloseable[] ac_dub2 = SQLManager.prepare("INSERT INTO punishments (name, uuid, ip, type, endTime, reason, giver, startTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?) ");
        PreparedStatement insert_ban = (PreparedStatement) ac_dub2[0];
        try {
            insert_ban.setString(1, name);
            insert_ban.setString(2, uuid);
            insert_ban.setString(3, PunishmentManager.ips_byUUID.containsKey(uuid) ? PunishmentManager.ips_byUUID.get(uuid) : "");
            insert_ban.setString(4, PunishmentType.BAN.toString());
            insert_ban.setString(5, fEndTime.toString());
            insert_ban.setString(6, reason);
            insert_ban.setString(7, banner);
            insert_ban.setString(8, ZonedDateTime.now().toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
        SQLManager.execute(ac_dub2);
        SQLManager.close(ac_dub2);
        System.out.println("Executed ban for " + name + ".");
    });
    String announce = ChatColor.YELLOW + name + ChatColor.RED + " was " + lengthDisplay + ChatColor.RED + " by " + ChatColor.YELLOW + banner + ChatColor.RED + " for: " + ChatColor.WHITE + ChatColor.BOLD + reason + ChatColor.RED + ".";
    RMessages.announce(ChatColor.GRAY + "> " + announce);
    if (banned != null && banned.isOnline())
        banned.kickPlayer("You were " + lengthDisplay + " by " + banner + " for: " + reason + ".");
    return true;
}
 
开发者ID:edasaki,项目名称:ZentrelaCore,代码行数:58,代码来源:BanCommand.java

示例13: getSpectatorFormat

private String getSpectatorFormat(Player player, String message) {
	return ChatColor.GRAY + "[Spectator]" + player.getName() + ": " + ChatColor.WHITE + message;
}
 
开发者ID:HuliPvP,项目名称:Chambers,代码行数:3,代码来源:ChatListener.java

示例14: formatInfoMessage

public static String formatInfoMessage(String message) {
    return ChatColor.WHITE + "" + ChatColor.BOLD + "RLStaffChat " + ChatColor.DARK_GRAY + "" + ChatColor.BOLD + ">> " + ChatColor.GRAY + message;
}
 
开发者ID:inventor02,项目名称:RLStaffChat,代码行数:3,代码来源:MessageFormatUtil.java

示例15: executeMute

public boolean executeMute(String name, String uuid, String[] args, String muter, Player muted) {
    String time = args[1].toLowerCase();
    ZonedDateTime endTime = ZonedDateTime.now();
    String lengthDisplay = "";
    if (args[1].startsWith("perm")) {
        endTime = endTime.plusYears(1000);
        lengthDisplay = ChatColor.YELLOW + "permanently" + ChatColor.RED + " muted";
    } else {
        int amount = Integer.parseInt(time.replaceAll("[^0-9]", ""));
        if (time.endsWith("m")) {
            endTime = endTime.plusMinutes(amount);
            lengthDisplay = "muted for " + ChatColor.YELLOW + amount + " minute" + (amount != 1 ? "s" : "");
        } else if (time.endsWith("h")) {
            endTime = endTime.plusHours(amount);
            lengthDisplay = "muted for " + ChatColor.YELLOW + amount + " hour" + (amount != 1 ? "s" : "");
        } else if (time.endsWith("d")) {
            endTime = endTime.plusDays(amount);
            lengthDisplay = "muted for " + ChatColor.YELLOW + amount + " day" + (amount != 1 ? "s" : "");
        } else if (time.endsWith("w")) {
            endTime = endTime.plusWeeks(amount);
            lengthDisplay = "muted for " + ChatColor.YELLOW + amount + " week" + (amount != 1 ? "s" : "");
        } else {
            return false;
        }
    }
    lengthDisplay += ChatColor.RESET;
    StringBuilder sb = new StringBuilder();
    for (int k = 2; k < args.length; k++) {
        sb.append(args[k]);
        sb.append(' ');
    }
    final ZonedDateTime fEndTime = endTime;
    String reason = sb.toString().trim();
    RScheduler.scheduleAsync(plugin, () -> {
        AutoCloseable[] ac_dub2 = SQLManager.prepare("INSERT INTO punishments (name, uuid, ip, type, endTime, reason, giver, startTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?) ");
        PreparedStatement insert_mute = (PreparedStatement) ac_dub2[0];
        try {
            insert_mute.setString(1, name);
            insert_mute.setString(2, uuid);
            insert_mute.setString(3, PunishmentManager.ips_byUUID.containsKey(uuid) ? PunishmentManager.ips_byUUID.get(uuid) : "");
            insert_mute.setString(4, PunishmentType.MUTE.toString());
            insert_mute.setString(5, fEndTime.toString());
            insert_mute.setString(6, reason);
            insert_mute.setString(7, muter);
            insert_mute.setString(8, ZonedDateTime.now().toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
        SQLManager.execute(ac_dub2);
        SQLManager.close(ac_dub2);
        System.out.println("Executed mute for " + name + ".");
        PunishmentManager.checkMute(uuid);
    });
    String announce = ChatColor.YELLOW + name + ChatColor.RED + " was " + lengthDisplay + ChatColor.RED + " by " + ChatColor.YELLOW + muter + ChatColor.RED + " for: " + ChatColor.WHITE + ChatColor.BOLD + reason + ChatColor.RED + ".";
    RMessages.announce(ChatColor.GRAY + "> " + announce);
    return true;
}
 
开发者ID:edasaki,项目名称:ZentrelaCore,代码行数:57,代码来源:MuteCommand.java


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