Browse Source

"mcmmo help" command no longer shows players the category for admin type commands if they lack permissions for said commands

nossr50 6 years ago
parent
commit
11461cc220
2 changed files with 5 additions and 0 deletions
  1. 1 0
      Changelog.txt
  2. 4 0
      src/main/java/com/gmail/nossr50/commands/McmmoCommand.java

+ 1 - 0
Changelog.txt

@@ -66,6 +66,7 @@ Version 2.1.0
  = (Skills) Tridents will no longer be considered unarmed
  = (MySQL) You can now inspect offline players
  = (MySQL) When converting from MySQL to flatfile mcMMO will now properly include all users in the conversion process
+ = (Commands) '/mcMMO help' no longer displays the other/special commands category to players lacking permissions
  + (Party) Parties can now have size limits (configurable in config.yml), party size is unlimited by default
  ! (Deaths) Fixed the bug where mob names would be replaced by hearts
  ! (Experience) The XP values of fish are now based on their rarity and have been drastically changed

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

@@ -70,6 +70,10 @@ public class McmmoCommand implements CommandExecutor {
     }
 
     private void displayOtherCommands(CommandSender sender) {
+        //Don't show them this category if they have none of the permissions
+        if(!Permissions.skillreset(sender) && !Permissions.mmoedit(sender) && !Permissions.adminChat(sender) && !Permissions.mcgod(sender))
+            return;
+
         sender.sendMessage(LocaleLoader.getString("Commands.Other"));
 
         if (Permissions.skillreset(sender)) {