瀏覽代碼

Adding a permission for the /mcmmo command.

Glitchfinder 12 年之前
父節點
當前提交
939586ce1a
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 5 0
      src/main/java/com/gmail/nossr50/commands/player/McmmoCommand.java
  2. 3 0
      src/main/resources/plugin.yml

+ 5 - 0
src/main/java/com/gmail/nossr50/commands/player/McmmoCommand.java

@@ -11,10 +11,15 @@ import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.config.Config;
 import com.gmail.nossr50.locale.LocaleLoader;
 import com.gmail.nossr50.util.Anniversary;
+import com.gmail.nossr50.util.Permissions;
 
 public class McmmoCommand implements CommandExecutor {
     @Override
     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
+        if (!Permissions.hasPermission(sender, "mcmmo.commands.mcmmo")) {
+            return true;
+        }
+
         String description = LocaleLoader.getString("mcMMO.Description");
         String[] mcSplit = description.split(",");
         sender.sendMessage(mcSplit);

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

@@ -723,6 +723,7 @@ permissions:
         children:
             mcmmo.commands.inspect: true
             mcmmo.commands.mcability: true
+            mcmmo.commands.mcmmo: true
             mcmmo.commands.mcrank: true
             mcmmo.commands.mcstats: true
             mcmmo.commands.mctop: true
@@ -764,6 +765,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.mcmmo:
+        description: Allows access to the mcmmo command
     mcmmo.commands.mcrank:
         description: Allows access to the mcrank command
     mcmmo.commands.mcstats: