本文整理汇总了Java中org.bukkit.ChatColor.STRIKETHROUGH属性的典型用法代码示例。如果您正苦于以下问题:Java ChatColor.STRIKETHROUGH属性的具体用法?Java ChatColor.STRIKETHROUGH怎么用?Java ChatColor.STRIKETHROUGH使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.ChatColor
的用法示例。
在下文中一共展示了ChatColor.STRIKETHROUGH属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCommand
@Override
protected void onCommand(CommandSender sender, String[] args) {
String bar = ChatColor.DARK_GREEN.toString() + ChatColor.STRIKETHROUGH + "------";
if (args.length == 0 || Utils.isInteger(args[0])) {
List<String> help = getHelp(sender);
int page = Math.max(1, args.length > 0 ? Integer.parseInt(args[0]) : 1);
int totalPages = help.size() / PER_PAGE + Math.min(1, help.size() % PER_PAGE);
sender.sendMessage(bar + ChatColor.GRAY + " Command Help (" + page + "/" + totalPages + ") " + bar);
for (int i = (page - 1) * PER_PAGE; i < Math.min(help.size(), page * PER_PAGE); i++)
sender.sendMessage(help.get(i)); // Show help.
} else {
Command cmd = Commands.getCommand(null, args[0]);
// If the command isn't found or it isn't a command a player needs to see.
if (cmd == null || !cmd.canUse(sender, false)) {
sender.sendMessage(ChatColor.RED + "Cannot find help for '" + args[0] + "'.");
return;
}
sender.sendMessage(bar + ChatColor.GRAY + " Information for " + cmd.getName() + " " + bar);
sender.sendMessage("Description: " + cmd.getHelp());
sender.sendMessage(cmd.getUsage());
sender.sendMessage("Alias: " + String.join(" ", cmd.getAlias()));
if (cmd instanceof PlayerCommand)
sender.sendMessage("Minimum Rank: " + ((PlayerCommand) cmd).getMinRank().getName());
}
}
示例2: getRandomColor
public ChatColor getRandomColor(){
ChatColor c = getRandomChatColor();
if(c == ChatColor.MAGIC || c == ChatColor.STRIKETHROUGH || c == ChatColor.BOLD || c == ChatColor.ITALIC) getRandomColor();
return c;
}
示例3: getRandomColor
public ChatColor getRandomColor(){
ChatColor c = getRandomChatColor();
if(c == ChatColor.MAGIC || c == ChatColor.STRIKETHROUGH || c == ChatColor.BOLD || c == ChatColor.ITALIC) return getRandomColor();
return c;
}