Переглянути джерело

Added missing permissions for mcrank mctop and mcstats

bm01 12 роки тому
батько
коміт
e9425625e2

+ 4 - 0
src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java

@@ -27,6 +27,10 @@ public class McrankCommand implements CommandExecutor {
             return true;
         }
 
+        if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mcrank")) {
+            return true;
+        }
+
         Player player = (Player) sender;
         String playerName;
         switch (args.length) {

+ 5 - 1
src/main/java/com/gmail/nossr50/commands/player/MctopCommand.java

@@ -8,6 +8,7 @@ import org.bukkit.command.Command;
 import org.bukkit.command.CommandExecutor;
 import org.bukkit.command.CommandSender;
 
+import com.gmail.nossr50.commands.CommandHelper;
 import com.gmail.nossr50.config.Config;
 import com.gmail.nossr50.database.Database;
 import com.gmail.nossr50.locale.LocaleLoader;
@@ -19,10 +20,13 @@ import com.gmail.nossr50.util.Misc;
 public class MctopCommand implements CommandExecutor {
     @Override
     public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
+        if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.mctop")) {
+            return true;
+        }
+
         String usage = LocaleLoader.getString("Commands.Usage.2", "mctop", "[" + LocaleLoader.getString("Commands.Usage.Skill") + "]", "[" + LocaleLoader.getString("Commands.Usage.Page") + "]");
 
         if (!Config.getInstance().getUseMySQL()) {
-
             switch (args.length) {
             case 0:
                 flatfileDisplay(1, "ALL", sender);

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

@@ -725,7 +725,9 @@ permissions:
         children:
             mcmmo.commands.inspect: true
             mcmmo.commands.mcability: true
+            mcmmo.commands.mcrank: true
             mcmmo.commands.mcstats: true
+            mcmmo.commands.mctop: true
             mcmmo.commands.party.all: true
             mcmmo.commands.ptp: true
     mcmmo.commands.ability:
@@ -764,6 +766,12 @@ permissions:
         description: Allows access to the mcgod command
     mcmmo.commands.mcgod.others:
         description: Allows access to the mcgod command for other players
+    mcmmo.commands.mcrank:
+        description: Allows access to the mcrank command
+    mcmmo.commands.mcstats:
+        description: Allows access to the mcstats command
+    mcmmo.commands.mctop:
+        description: Allows access to the mctop command
     mcmmo.commands.mmoedit:
         description: Allows access to the mmoedit command
     mcmmo.commands.mmoedit.others: