本文整理汇总了Java中org.bukkit.ChatColor.AQUA属性的典型用法代码示例。如果您正苦于以下问题:Java ChatColor.AQUA属性的具体用法?Java ChatColor.AQUA怎么用?Java ChatColor.AQUA使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.ChatColor
的用法示例。
在下文中一共展示了ChatColor.AQUA属性的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: initScoreboard
private SimpleScoreboard initScoreboard(PlayerContext playerContext) {
SimpleScoreboard simpleScoreboard = new SimpleScoreboard(ChatColor.AQUA + "Objectives");
for (MatchTeam matchTeam : TGM.get().getModule(TeamManagerModule.class).getTeams()) {
Team team = simpleScoreboard.getScoreboard().registerNewTeam(matchTeam.getId());
team.setPrefix(matchTeam.getColor().toString());
team.setCanSeeFriendlyInvisibles(false); // Fixes anti cheat entity visible when it shouldn't be
team.setAllowFriendlyFire(false);
team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
for (PlayerContext player : matchTeam.getMembers()) {
team.addEntry(player.getPlayer().getName());
}
}
Bukkit.getPluginManager().callEvent(new ScoreboardInitEvent(playerContext.getPlayer(), simpleScoreboard));
simpleScoreboard.send(playerContext.getPlayer());
scoreboards.put(playerContext.getPlayer(), simpleScoreboard);
simpleScoreboard.update();
return simpleScoreboard;
}
示例3: 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;
}
}
示例4: onCommand
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
if (!(sender instanceof Player))
{
sender.sendMessage("Works on players only.");
return false;
}
Player player = (Player) sender;
String[] helpstring =
{
ChatColor.AQUA + "Survival Recipes:",
"Recipe1 - Do something special!",
"Recipe2 - Do something special!"
};
player.sendMessage(helpstring);
return true;
}
示例5: ShowThirst
@SuppressWarnings("deprecation")
public static List<String> ShowThirst(Player player)
{
Objective thirst = Survival.mainBoard.getObjective("Thirst");
String thirstBar = "";
for(int i = 0; i < thirst.getScore(player).getScore(); i++)
{
thirstBar += "|";
}
for(int i = thirst.getScore(player).getScore(); i < 20; i++)
{
thirstBar += ".";
}
if(thirst.getScore(player).getScore() >= 40)
thirstBar = ChatColor.GREEN + thirstBar;
else if(thirst.getScore(player).getScore() <= 6)
thirstBar = ChatColor.RED + thirstBar;
else
thirstBar = ChatColor.AQUA + thirstBar;
return Arrays.asList(ChatColor.AQUA + Words.get("Thirst"), (thirstBar.length() <= 22 ? thirstBar.substring(0) : thirstBar.substring(0, 22)), thirstBar.substring(0, 2) + (thirstBar.length() > 22 ? thirstBar.substring(22) : "") + ChatColor.RESET + ChatColor.RESET);
}
示例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: getName
public static String getName(Material item) {
String name = item.name().toLowerCase();
String[] pieces = name.split("_");
name = "";
for (int i = 0; i < pieces.length; i++) {
name += pieces[i].substring(0, 1).toUpperCase() + pieces[i].substring(1);
if (i < pieces.length - 1) name += " ";
}
if (differentNames.containsKey(name))
return ChatColor.AQUA + differentNames.get(name);
return ChatColor.AQUA + name;
}
示例8: build
/**
* Create an instance of a message with a given sender
* and message
*
* @param sender Sender of the moderator message
* @param modChannel Channel of the moderator message
* @param message Prefix color of the sender
*
* @return New instance
*/
public static JsonModMessage build(CommandSender sender, ModChannel modChannel, String message)
{
if (sender instanceof Player)
{
String prefix ="";//TODO SamaGamesAPI.get().getPermissionsManager().getPrefix(SamaGamesAPI.get().getPermissionsManager().getApi().getUser(((Player) sender).getUniqueId()));
ChatColor pr = (prefix == null) ? ChatColor.AQUA : ChatColor.getByChar(prefix.charAt(prefix.length() - 1));
return new JsonModMessage(sender.getName(), modChannel, pr, message);
}
else
{
return new JsonModMessage(sender.getName(), modChannel, ChatColor.AQUA, message);
}
}
示例9: getLegacyFormattedMessage
@Override
public String getLegacyFormattedMessage() {
String message = ChatColor.AQUA + getLocation() + ": " + ChatColor.RED + getMessage();
Throwable thrown = getThrown();
if(thrown != null && thrown.getCause() != null && thrown.getCause().getMessage() != null) {
message += ", caused by: " + thrown.getCause().getMessage();
}
return message;
}
示例10: onFactionRename
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onFactionRename(FactionRenameEvent event) {
Faction faction = event.getFaction();
if (faction instanceof PlayerFaction) {
for (Player player : Bukkit.getOnlinePlayers()) {
Relation relation = faction.getRelation(player);
String msg = ChatColor.YELLOW + "The faction " + relation.toChatColour() + event.getOriginalName() + ChatColor.GRAY + " has been " + ChatColor.AQUA + "renamed" + ChatColor.GRAY
+ " to " + relation.toChatColour() + event.getNewName() + ChatColor.GRAY + '.';
player.sendMessage(msg);
}
}
}
示例11: onFactionCreate
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onFactionCreate(FactionCreateEvent event) {
Faction faction = event.getFaction();
if (faction instanceof PlayerFaction) {
CommandSender sender = event.getSender();
for (Player player : Bukkit.getOnlinePlayers()) {
Relation relation = faction.getRelation(player);
String msg = ChatColor.YELLOW + "The faction " + relation.toChatColour() + (player == null ? faction.getName() : faction.getName()) + ChatColor.YELLOW + " has been " + ChatColor.GREEN
+ "created" + ChatColor.YELLOW + " by " + ChatColor.AQUA + (sender instanceof Player ? ((Player) sender).getName() : sender.getName()) + ChatColor.YELLOW + '.';
player.sendMessage(msg);
}
}
}
示例12: onFactionRemove
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onFactionRemove(FactionRemoveEvent event) {
Faction faction = event.getFaction();
if (faction instanceof PlayerFaction) {
CommandSender sender = event.getSender();
for (Player player : Bukkit.getOnlinePlayers()) {
Relation relation = faction.getRelation(player);
String msg = ChatColor.YELLOW + "The faction " + relation.toChatColour() + (player == null ? faction.getName() : faction.getName()) + ChatColor.YELLOW + " has been " + ChatColor.RED
+ "disbanded" + ChatColor.YELLOW + " by " + ChatColor.AQUA + (sender instanceof Player ? ((Player) sender).getName() : sender.getName()) + ChatColor.YELLOW + '.';
player.sendMessage(msg);
}
}
}
示例13: getColor
@Override
public ChatColor getColor() {
return ChatColor.AQUA;
}
示例14: sendMessageToViewer
public void sendMessageToViewer(Player sender, CommandSender viewer, String sanitizedMessage, ChannelMessageEvent event, boolean offensive, int violationsAttached, PlayerViolationManager violationManager, boolean forceNoSend) {
boolean senderPresent = sender != null;
String senderName = senderPresent ? sender.getName(viewer) : "Console";
String senderDisplayName = senderPresent ? sender.getDisplayName(viewer) : ChatColor.GOLD + "*" + ChatColor.AQUA + "Console";
String message = MessageFormat.format(
this.getFormat(),
senderName,
senderDisplayName,
event.getMessage(),
sanitizedMessage
);
boolean allowSend = true;
if (viewer instanceof Player) {
switch (PlayerSettings.getManager((Player) viewer).getValue(Settings.FILTER_SETTING, FilterOptions.class)) {
case NONE:
allowSend = true;
break;
case OFFENSIVE:
allowSend = !offensive;
break;
case ALL:
allowSend = violationsAttached == 0;
break;
}
}
boolean isSender = viewer.equals(event.getSender());
StringBuilder builder = new StringBuilder();
if (isSender) {
if (offensive || violationsAttached != 0) {
if (violationManager.getScore() * this.partial < this.scoreThreshold) {
builder.append(ChatColor.GOLD);
} else {
builder.append(ChatColor.RED);
}
builder.append(ChatColor.BOLD).append(WARNING_SYMBOL).append(ChatColor.RESET);
}
builder.append(this.underlineViolations(violationManager, message, event));
viewer.sendMessage(builder.toString());
} else if (allowSend && !forceNoSend) {
this.sendMessageToViewer(sender, viewer, sanitizedMessage, event);
}
}
示例15: getScoreboardPrefix
@Override
public String getScoreboardPrefix() {
return ChatColor.AQUA + ChatColor.BOLD.toString();
}