当前位置: 首页>>代码示例>>Java>>正文


Java PluginDescriptionFile.getDescription方法代码示例

本文整理汇总了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();
}
 
开发者ID:MrBlobman,项目名称:NBTProxy,代码行数:17,代码来源:InfoCommand.java

示例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));
        }
    }
}
 
开发者ID:CyberdyneCC,项目名称:Thermos-Bukkit,代码行数:21,代码来源:VersionCommand.java

示例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("");
            }
        }
    }
}
 
开发者ID:Lergin,项目名称:AntiPluginListBlock,代码行数:38,代码来源:AntiPluginListBlock.java


注:本文中的org.bukkit.plugin.PluginDescriptionFile.getDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。