本文整理汇总了Java中org.bukkit.plugin.PluginDescriptionFile.getDescription方法的典型用法代码示例。如果您正苦于以下问题:Java PluginDescriptionFile.getDescription方法的具体用法?Java PluginDescriptionFile.getDescription怎么用?Java PluginDescriptionFile.getDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.plugin.PluginDescriptionFile
的用法示例。
在下文中一共展示了PluginDescriptionFile.getDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: InfoCommand
import org.bukkit.plugin.PluginDescriptionFile; //导入方法依赖的package包/类
public InfoCommand(PluginDescriptionFile pdf) {
this.infoMsg = new String[] {
ChatColor.AQUA + "NBTProxy Info:",
ChatColor.AQUA + " Description: " + ChatColor.YELLOW + pdf.getDescription(),
ChatColor.AQUA + " Version: " + ChatColor.YELLOW + pdf.getVersion(),
ChatColor.AQUA + " Authors: " + ChatColor.YELLOW + pdf.getAuthors(),
ChatColor.AQUA + " Website: " + ChatColor.YELLOW + pdf.getWebsite()
};
HoverEvent clickToCopyToolTip = new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(ChatColor.AQUA + "Click to paste the version into your chatbox."));
ComponentBuilder msg = new ComponentBuilder("\nNBTProxy Info:\n").color(ChatColor.AQUA);
appendInfoString(msg, clickToCopyToolTip, "Description", pdf.getDescription());
appendInfoString(msg, clickToCopyToolTip, "Version", pdf.getVersion());
appendInfoString(msg, clickToCopyToolTip, "Authors", pdf.getAuthors().toString());
appendInfoString(msg, clickToCopyToolTip, "Website", pdf.getWebsite());
this.infoMsgPretty = msg.create();
}
示例2: describeToSender
import org.bukkit.plugin.PluginDescriptionFile; //导入方法依赖的package包/类
private void describeToSender(Plugin plugin, CommandSender sender) {
PluginDescriptionFile desc = plugin.getDescription();
sender.sendMessage(ChatColor.GREEN + desc.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + desc.getVersion());
if (desc.getDescription() != null) {
sender.sendMessage(desc.getDescription());
}
if (desc.getWebsite() != null) {
sender.sendMessage("Website: " + ChatColor.GREEN + desc.getWebsite());
}
if (!desc.getAuthors().isEmpty()) {
if (desc.getAuthors().size() == 1) {
sender.sendMessage("Author: " + getAuthors(desc));
} else {
sender.sendMessage("Authors: " + getAuthors(desc));
}
}
}
示例3: onPlayerCommand
import org.bukkit.plugin.PluginDescriptionFile; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = false)
public void onPlayerCommand(PlayerCommandPreprocessEvent e) {
Player player = e.getPlayer();
String message = e.getMessage();
if (message.startsWith("/pl") || message.startsWith("/bukkit:pl")){
if(!player.hasPermission("bukkit.command.plugins") || e.isCancelled()){
player.sendMessage("");
for(Plugin plugin : Bukkit.getPluginManager().getPlugins()){
PluginDescriptionFile pluginDescription = plugin.getDescription();
player.sendMessage(ChatColor.BOLD + pluginDescription.getFullName());
String authorMessage = "by";
for(String author : pluginDescription.getAuthors()){
authorMessage = authorMessage + " " + author + ",";
}
authorMessage = authorMessage.substring(0, authorMessage.length()-1);
player.sendMessage(authorMessage);
if(pluginDescription.getWebsite() != null)
player.sendMessage("Website: " + pluginDescription.getWebsite());
if(pluginDescription.getDescription() != null)
player.sendMessage(pluginDescription.getDescription());
player.sendMessage("");
}
}
}
}