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 + " 不存在或已卸载!");