作者:益林代表_610 | 来源:互联网 | 2023-10-10 18:46
本文整理了Java中org.bukkit.command.Command.getUsage()
方法的一些代码示例,展示了Command.getUsage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Command.getUsage()
方法的具体详情如下:
包路径:org.bukkit.command.Command
类名称:Command
方法名:getUsage
Command.getUsage介绍
[英]Gets an example usage of this command
[中]获取此命令的示例用法
代码示例
代码示例来源:origin: Bukkit/Bukkit
sb.append("Usage: ");
sb.append(ChatColor.WHITE);
sb.append(command.getUsage().replace("", name.substring(1)));
代码示例来源:origin: EngineHub/CommandHelper
@Override
public String getUsage() {
return cmd.getUsage();
}
代码示例来源:origin: EngineHub/CommandBook
@Override
public String format(org.bukkit.command.Command entry) {
return entry.getUsage() + " - "
+ entry.getDescription();
}
}.display(sender, serverCommands, args.getFlagInteger('p', 1));
代码示例来源:origin: NoCheatPlus/NoCheatPlus
public CommandsCommand(JavaPlugin plugin) {
super(plugin, "commands", Permissions.COMMAND_COMMANDS, new String[]{"cmds"});
for (int i = 0; i moreCommands[i] = moreCommands[i].replace("", "ncp");
}
String all = TAG + "All commands info:\n";
Command cmd = plugin.getCommand("nocheatplus");
if (cmd != null){
all += cmd.getUsage().replace("", "ncp");
}
all += StringUtil.join(Arrays.asList(moreCommands), "\n");
allCommands = all;
}
代码示例来源:origin: TotalFreedom/TotalFreedomMod
private static String buildDescription(Command command)
{
StringBuilder sb = new StringBuilder();
sb.append(
"{$CMD_NAME} - Usage: {$CMD_USAGE}"
.replace("{$CMD_NAME}", escapeHtml4(command.getName().trim()))
.replace("{$CMD_USAGE}", escapeHtml4(command.getUsage().trim())));
if (!command.getAliases().isEmpty())
{
sb.append(
" - Aliases: {$CMD_ALIASES}"
.replace("{$CMD_ALIASES}", escapeHtml4(StringUtils.join(command.getAliases(), ", "))));
}
sb.append(
"
{$CMD_DESC}\r\n"
.replace("{$CMD_DESC}", escapeHtml4(command.getDescription().trim())));
return sb.toString();
}
代码示例来源:origin: SpigotMC/Spigot-API
sb.append("Usage: ");
sb.append(ChatColor.WHITE);
sb.append(command.getUsage().replace("", name.substring(1)));
代码示例来源:origin: EngineHub/CommandBook
public void printCommandHelp(CommandSender sender, org.bukkit.command.Command cmd) {
sender.sendMessage(ChatColor.YELLOW + "Command: " + cmd.getName());
final String aliases = cmd.getAliases().toString().replaceAll("\\[(.*)\\]", "$1");
if (aliases.length() > 0) {
sender.sendMessage(ChatColor.YELLOW + "Aliases: " + aliases);
}
sender.sendMessage(ChatColor.YELLOW + "Description: " + cmd.getDescription());
sender.sendMessage(ChatColor.YELLOW + "Usage: " + cmd.getUsage());
if (cmd instanceof PluginCommand) {
sender.sendMessage(ChatColor.YELLOW + "Plugin: " +
((PluginCommand)cmd).getPlugin().getDescription().getName());
} else if (cmd instanceof DynamicPluginCommand) {
sender.sendMessage(ChatColor.YELLOW + "Owner: " +
((DynamicPluginCommand) cmd).getOwner().getClass().getSimpleName());
} else if (cmd instanceof VanillaCommand) {
sender.sendMessage(ChatColor.YELLOW + "Vanilla command");
}
}