diff options
author | Necrodoom <doomed.war@gmail.com> | 2013-06-14 10:25:41 +0300 |
---|---|---|
committer | Necrodoom <doomed.war@gmail.com> | 2013-06-14 10:25:41 +0300 |
commit | 6ea835e96feba8eeca929b72510b2be6be02302a (patch) | |
tree | 8bac97b3459a4db08faac3c8aa2988873d4ee5ed /EssentialsGroupManager/src | |
parent | 5fdac7588ed9b6a27b203392829dad2fc0229267 (diff) | |
download | Essentials-6ea835e96feba8eeca929b72510b2be6be02302a.tar Essentials-6ea835e96feba8eeca929b72510b2be6be02302a.tar.gz Essentials-6ea835e96feba8eeca929b72510b2be6be02302a.tar.lz Essentials-6ea835e96feba8eeca929b72510b2be6be02302a.tar.xz Essentials-6ea835e96feba8eeca929b72510b2be6be02302a.zip |
change ' strip checks
Diffstat (limited to 'EssentialsGroupManager/src')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java index d354b05e7..4746ac548 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java @@ -738,11 +738,7 @@ public class GroupManager extends JavaPlugin { for (int i = 1; i < args.length; i++) { - auxString = args[i]; - if (auxString.startsWith("'") && auxString.endsWith("'")) - { - auxString = auxString.substring(1, auxString.length() - 1); - } + auxString = args[i].replace("'", ""); permissionResult = permissionHandler.checkFullUserPermission(senderUser, auxString); if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) { @@ -791,11 +787,7 @@ public class GroupManager extends JavaPlugin { for (int i = 1; i < args.length; i++) { - auxString = args[i]; - if (auxString.startsWith("'") && auxString.endsWith("'")) - { - auxString = auxString.substring(1, auxString.length() - 1); - } + auxString = args[i].replace("'", ""); if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) { sender.sendMessage(ChatColor.RED + "You can't modify a player with same group as you, or higher."); @@ -950,11 +942,7 @@ public class GroupManager extends JavaPlugin { return true; } - auxString = args[1]; - if (auxString.startsWith("'") && auxString.endsWith("'")) - { - auxString = auxString.substring(1, auxString.length() - 1); - } + auxString = args[1].replace("'", ""); if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) { return false; @@ -1019,11 +1007,7 @@ public class GroupManager extends JavaPlugin { for (int i = 1; i < args.length; i++) { - auxString = args[i]; - if (auxString.startsWith("'") && auxString.endsWith("'")) - { - auxString = auxString.substring(1, auxString.length() - 1); - } + auxString = args[i].replace("'", ""); // Validating your permissions permissionResult = permissionHandler.checkFullUserPermission(senderUser, auxString); @@ -1065,11 +1049,7 @@ public class GroupManager extends JavaPlugin { } for (int i = 1; i < args.length; i++) { - auxString = args[i]; - if (auxString.startsWith("'") && auxString.endsWith("'")) - { - auxString = auxString.substring(1, auxString.length() - 1); - } + auxString = args[i].replace("'", ""); // Validating your permissions permissionResult = permissionHandler.checkFullUserPermission(senderUser, auxString); @@ -1333,10 +1313,7 @@ public class GroupManager extends JavaPlugin { auxString += " "; } } - if (auxString.startsWith("'") && auxString.endsWith("'")) - { - auxString = auxString.substring(1, auxString.length() - 1); - } + auxString = auxString.replace("'", ""); auxUser.getVariables().addVar(args[1], Variables.parseVariableValue(auxString)); sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + ":'" + ChatColor.GREEN + auxString + ChatColor.YELLOW + "' added to the user " + auxUser.getName()); @@ -1485,10 +1462,8 @@ public class GroupManager extends JavaPlugin { auxString += " "; } } - if (auxString.startsWith("'") && auxString.endsWith("'")) - { - auxString = auxString.substring(1, auxString.length() - 1); - } + + auxString = auxString.replace("'", ""); auxGroup.getVariables().addVar(args[1], Variables.parseVariableValue(auxString)); sender.sendMessage(ChatColor.YELLOW + "Variable " + ChatColor.GOLD + args[1] + ChatColor.YELLOW + ":'" + ChatColor.GREEN + auxString + ChatColor.YELLOW + "' added to the group " + auxGroup.getName()); |