浏览代码

Adding a permission for the /mchud command.

Glitchfinder 12 年之前
父节点
当前提交
ae5ab13533
共有 2 个文件被更改,包括 8 次插入0 次删除
  1. 5 0
      src/main/java/com/gmail/nossr50/spout/commands/MchudCommand.java
  2. 3 0
      src/main/resources/plugin.yml

+ 5 - 0
src/main/java/com/gmail/nossr50/spout/commands/MchudCommand.java

@@ -12,6 +12,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
 import com.gmail.nossr50.spout.SpoutConfig;
 import com.gmail.nossr50.spout.huds.HudType;
 import com.gmail.nossr50.spout.huds.SpoutHud;
+import com.gmail.nossr50.util.Permissions;
 import com.gmail.nossr50.util.Users;
 
 public class MchudCommand implements CommandExecutor {
@@ -24,6 +25,10 @@ public class MchudCommand implements CommandExecutor {
             return true;
         }
 
+        if (!Permissions.hasPermission(sender, "mcmmo.commands.mchud")) {
+            return true;
+        }
+
         if (!mcMMO.spoutEnabled || !SpoutConfig.getInstance().getXPBarEnabled()) {
             sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
             return true;

+ 3 - 0
src/main/resources/plugin.yml

@@ -728,6 +728,7 @@ permissions:
             mcmmo.commands.herbalism: true
             mcmmo.commands.inspect: true
             mcmmo.commands.mcability: true
+            mcmmo.commands.mchud: true
             mcmmo.commands.mcmmo: true
             mcmmo.commands.mcrank: true
             mcmmo.commands.mcstats: true
@@ -792,6 +793,8 @@ permissions:
         description: Allows access to the mcgod command
     mcmmo.commands.mcgod.others:
         description: Allows access to the mcgod command for other players
+    mcmmo.commands.mchud:
+        description: Allows access to the mchud command
     mcmmo.commands.mcmmo:
         description: Allows access to the mcmmo command
     mcmmo.commands.mcpurge: