瀏覽代碼

More permissions murder.

shatteredbeam 12 年之前
父節點
當前提交
12a2107601

+ 2 - 3
src/main/java/com/gmail/nossr50/commands/admin/XprateCommand.java

@@ -9,7 +9,6 @@ import com.gmail.nossr50.mcMMO;
 import com.gmail.nossr50.config.Config;
 import com.gmail.nossr50.locale.LocaleLoader;
 import com.gmail.nossr50.util.Misc;
-import com.gmail.nossr50.util.Permissions;
 
 public class XprateCommand implements CommandExecutor {
     private static double originalRate = Config.getInstance().getExperienceGainsGlobalMultiplier();
@@ -22,7 +21,7 @@ public class XprateCommand implements CommandExecutor {
                 return false;
             }
 
-            if (!Permissions.hasPermission(sender, "mcmmo.commands.xprate.reset")) {
+            if (!sender.hasPermission("mcmmo.commands.xprate.reset")) {
                 sender.sendMessage(command.getPermissionMessage());
                 return true;
             }
@@ -43,7 +42,7 @@ public class XprateCommand implements CommandExecutor {
                 return false;
             }
 
-            if (!Permissions.hasPermission(sender, "mcmmo.commands.xprate.set")) {
+            if (!sender.hasPermission("mcmmo.commands.xprate.set")) {
                 sender.sendMessage(command.getPermissionMessage());
                 return true;
             }

+ 3 - 4
src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java

@@ -11,7 +11,6 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
 import com.gmail.nossr50.locale.LocaleLoader;
 import com.gmail.nossr50.skills.utilities.SkillType;
 import com.gmail.nossr50.util.Misc;
-import com.gmail.nossr50.util.Permissions;
 import com.gmail.nossr50.util.Users;
 
 public class InspectCommand implements CommandExecutor {
@@ -21,7 +20,7 @@ public class InspectCommand implements CommandExecutor {
 
         switch (args.length) {
         case 1:
-            if (!Permissions.hasPermission(sender, "mcmmo.commands.inspect")) {
+            if (!sender.hasPermission("mcmmo.commands.inspect")) {
                 sender.sendMessage(command.getPermissionMessage());
                 return true;
             }
@@ -37,7 +36,7 @@ public class InspectCommand implements CommandExecutor {
                     return true;
                 }
 
-                if (sender instanceof Player && !Permissions.inspectOffline((Player) sender)) {
+                if (sender instanceof Player && !sender.hasPermission("mcmmo.commands.inspect.offline")) {
                     sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
                     return true;
                 }
@@ -68,7 +67,7 @@ public class InspectCommand implements CommandExecutor {
                 if (sender instanceof Player) {
                     Player inspector = (Player) sender;
 
-                    if (!Misc.isNear(inspector.getLocation(), target.getLocation(), 5.0) && !Permissions.inspectFar(inspector)) {
+                    if (!Misc.isNear(inspector.getLocation(), target.getLocation(), 5.0) && !inspector.hasPermission("mcmmo.commands.inspect.far")) {
                         sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
                         return true;
                     }

+ 2 - 3
src/main/java/com/gmail/nossr50/commands/player/McabilityCommand.java

@@ -8,7 +8,6 @@ import org.bukkit.entity.Player;
 import com.gmail.nossr50.datatypes.McMMOPlayer;
 import com.gmail.nossr50.datatypes.PlayerProfile;
 import com.gmail.nossr50.locale.LocaleLoader;
-import com.gmail.nossr50.util.Permissions;
 import com.gmail.nossr50.util.Users;
 
 public class McabilityCommand implements CommandExecutor {
@@ -18,7 +17,7 @@ public class McabilityCommand implements CommandExecutor {
 
         switch (args.length) {
         case 0:
-            if (!Permissions.hasPermission(sender, "mcmmo.commands.mcability")) {
+            if (!sender.hasPermission("mcmmo.commands.mcability")) {
                 sender.sendMessage(command.getPermissionMessage());
                 return true;
             }
@@ -36,7 +35,7 @@ public class McabilityCommand implements CommandExecutor {
             return true;
 
         case 1:
-            if (!Permissions.hasPermission(sender, "mcmmo.commands.mcability.others")) {
+            if (!sender.hasPermission("mcmmo.commands.mcability.others")) {
                 sender.sendMessage(command.getPermissionMessage());
                 return true;
             }