From 37fa0a28f87dbb67aa9b7cc88da52d4bf63b7132 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Mon, 21 Sep 2015 20:40:23 +0800 Subject: [PATCH] add test command... Signed-off-by: 502647092 --- src/main/java/cn/citycraft/GuiACK/GuiACK.java | 6 +++++- src/main/resources/plugin.yml | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/citycraft/GuiACK/GuiACK.java b/src/main/java/cn/citycraft/GuiACK/GuiACK.java index 059f3e0..5f78865 100644 --- a/src/main/java/cn/citycraft/GuiACK/GuiACK.java +++ b/src/main/java/cn/citycraft/GuiACK/GuiACK.java @@ -25,10 +25,14 @@ public class GuiACK extends JavaPlugin { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if (args.length == 1 && args[0].equalsIgnoreCase("reload") && (sender.hasPermission("gack.reload") || sender.isOp())) { + if (args.length != 1) + return false; + if (args[0].equalsIgnoreCase("reload") && (sender.hasPermission("gack.reload") || sender.isOp())) { onLoad(); sender.sendMessage("配置文件已重载!"); } + if (args[0].equalsIgnoreCase("test") && sender instanceof Player && (sender.hasPermission("gack.test") || sender.isOp())) + VerifyGui.open((Player) sender); return true; } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 9c1d12a..effd424 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -7,8 +7,11 @@ website: http://ci.citycraft.cn:8800/jenkins/job/${project.artifactId}/ commands: gack: description: gack - usage: §b使用/gack help 查看帮助! + usage: §b使用/gack [test(测试插件)|reload(重载插件)]! permissions: + gack.test: + description: 测试插件权限! + default: op gack.reload: description: 重新载入插件! default: op \ No newline at end of file