From c84655ddc6962497cafbbfa2687e95d0ba6e04b5 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Mon, 28 Dec 2015 00:34:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0yum=20info=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=8F=92=E4=BB=B6=E6=9D=83=E9=99=90=E5=92=8C?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E5=91=BD=E4=BB=A4...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- pom.xml | 4 ++-- .../cn/citycraft/Yum/commands/CommandInfo.java | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 693a013..3095361 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 cn.citycraft Yum - 1.9.3 + 1.9.5 Yum Minecraft 服务器插件管理系统 @@ -55,7 +55,7 @@ http://ci.citycraft.cn:8080 - &c清理无用模块 整合file功能... + &e添加yum info指令查看插件权限和注册命令... Debug UTF-8 diff --git a/src/main/java/cn/citycraft/Yum/commands/CommandInfo.java b/src/main/java/cn/citycraft/Yum/commands/CommandInfo.java index 1061e36..1dc224b 100644 --- a/src/main/java/cn/citycraft/Yum/commands/CommandInfo.java +++ b/src/main/java/cn/citycraft/Yum/commands/CommandInfo.java @@ -5,11 +5,13 @@ package cn.citycraft.Yum.commands; import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.apache.commons.lang.StringUtils; import org.bukkit.command.Command; import org.bukkit.command.CommandException; import org.bukkit.command.CommandSender; +import org.bukkit.permissions.Permission; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginDescriptionFile; @@ -47,10 +49,22 @@ public class CommandInfo extends BaseCommand { sender.sendMessage("§6插件版本: §3" + desc.getVersion()); sender.sendMessage("§6插件作者: §3" + StringUtils.join(desc.getAuthors(), " ")); sender.sendMessage("§6插件描述: §3" + (desc.getDescription() == null ? "无" : desc.getDescription())); - sender.sendMessage("§6插件依赖: §3" + (desc.getDepend().size() == 0 ? "无" : "")); + sender.sendMessage("§6插件依赖: §3" + (desc.getDepend().isEmpty() ? "无" : "")); StringUtil.sendStringArray(sender, desc.getDepend(), "§6 - §a"); - sender.sendMessage("§6插件软依赖: §3" + (desc.getSoftDepend().size() == 0 ? "无" : "")); + sender.sendMessage("§6插件软依赖: §3" + (desc.getSoftDepend().isEmpty() ? "无" : "")); StringUtil.sendStringArray(sender, desc.getSoftDepend(), "§6 - §a"); + final Map> clist = desc.getCommands(); + if (clist != null) { + sender.sendMessage("§6插件注册命令: §3" + (clist.isEmpty() ? "无" : "")); + StringUtil.sendStringArray(sender, clist.keySet(), "§6 - §a"); + } + final List plist = desc.getPermissions(); + if (plist != null) { + sender.sendMessage("§6插件注册权限: " + (plist.isEmpty() ? "无" : "")); + for (final Permission perm : plist) { + sender.sendMessage("§6 - §a" + perm.getName() + "§6 - §e" + (perm.getDescription().isEmpty() ? "无描述" : perm.getDescription())); + } + } sender.sendMessage("§6插件物理路径: §3" + YumAPI.getPlugman().getPluginFile(plugin).getAbsolutePath()); } else { sender.sendMessage("§4错误: §c插件 " + pluginname + " 不存在或已卸载!");