本文整理汇总了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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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";
}
}
示例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;
}
}
示例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;
}
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例13: getSpectatorFormat
private String getSpectatorFormat(Player player, String message) {
return ChatColor.GRAY + "[Spectator]" + player.getName() + ": " + ChatColor.WHITE + message;
}
示例14: formatInfoMessage
public static String formatInfoMessage(String message) {
return ChatColor.WHITE + "" + ChatColor.BOLD + "RLStaffChat " + ChatColor.DARK_GRAY + "" + ChatColor.BOLD + ">> " + ChatColor.GRAY + message;
}
示例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;
}