mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 09:37:50 +01:00
Merge pull request #353 from necrodoom/patch-61
various messages fixes - This better work!!!!!!
This commit is contained in:
commit
bda3c32370
@ -413,7 +413,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
if (isOpOverride || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager." + cmd.getName())) {
|
if (isOpOverride || worldsHolder.getWorldPermissions(senderPlayer).has(senderPlayer, "groupmanager." + cmd.getName())) {
|
||||||
playerCanDo = true;
|
playerCanDo = true;
|
||||||
}
|
}
|
||||||
} else if ((sender instanceof ConsoleCommandSender) || (sender instanceof RemoteConsoleCommandSender)) {
|
} else if ((sender instanceof ConsoleCommandSender) || (sender instanceof RemoteConsoleCommandSender) || (sender instanceof BlockCommandSender)) {
|
||||||
|
|
||||||
if (!lastError.isEmpty() && !commandLabel.equalsIgnoreCase("manload")) {
|
if (!lastError.isEmpty() && !commandLabel.equalsIgnoreCase("manload")) {
|
||||||
sender.sendMessage(ChatColor.RED + "All commands are locked due to an error. " + ChatColor.BOLD + "" + ChatColor.UNDERLINE + "Check the log" + ChatColor.RESET + "" + ChatColor.RED + " and then try a '/manload'.");
|
sender.sendMessage(ChatColor.RED + "All commands are locked due to an error. " + ChatColor.BOLD + "" + ChatColor.UNDERLINE + "Check the log" + ChatColor.RESET + "" + ChatColor.RED + " and then try a '/manload'.");
|
||||||
@ -487,8 +487,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
|
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if ((args.length != 2) && (args.length != 3)) {
|
if ((args.length != 2) && (args.length != 3)) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group> | optional [world])");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manuadd <player> <group> | optional [world])");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select the relevant world (if specified)
|
// Select the relevant world (if specified)
|
||||||
@ -514,7 +514,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[1]);
|
auxGroup = dataHolder.getGroup(args[1]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group not found!");
|
sender.sendMessage(ChatColor.RED + "" + args[1] + " Group doesnt exist!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
@ -525,15 +525,15 @@ public class GroupManager extends JavaPlugin {
|
|||||||
// Validating permissions
|
// Validating permissions
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||||
sender.sendMessage(ChatColor.RED + "Can't modify a player with the same permissions as you, or higher.");
|
sender.sendMessage(ChatColor.RED + "Can't modify a player with the same permissions as you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) {
|
if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "The destination group can't be the same as yours, or higher.");
|
sender.sendMessage(ChatColor.RED + "The destination group can't be the same as yours, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) {
|
if (!isConsole && !isOpOverride && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player involving a group that you don't inherit.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player involving a group that you don't inherit.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Seems OK
|
// Seems OK
|
||||||
@ -551,8 +551,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudel <player>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -566,7 +566,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
// Validating permission
|
// Validating permission
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
dataHolder.removeUser(auxUser.getName());
|
dataHolder.removeUser(auxUser.getName());
|
||||||
@ -590,8 +590,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manuaddsub <player> <group>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -604,13 +604,13 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[1]);
|
auxGroup = dataHolder.getGroup(args[1]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group not found!");
|
sender.sendMessage(ChatColor.RED + "" + args[1] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
if (auxUser.addSubGroup(auxGroup))
|
if (auxUser.addSubGroup(auxGroup))
|
||||||
@ -629,7 +629,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudelsub <user> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudelsub <user> <group>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -642,14 +642,14 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[1]);
|
auxGroup = dataHolder.getGroup(args[1]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group not found!");
|
sender.sendMessage(ChatColor.RED + "" + args[1] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validating permission
|
// Validating permission
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxUser.removeSubGroup(auxGroup);
|
auxUser.removeSubGroup(auxGroup);
|
||||||
@ -669,13 +669,13 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangadd <group>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup != null) {
|
if (auxGroup != null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group already exists!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxGroup = dataHolder.createGroup(args[0]);
|
auxGroup = dataHolder.createGroup(args[0]);
|
||||||
@ -691,13 +691,13 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangdel <group>)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group not exists!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
dataHolder.removeGroup(auxGroup.getName());
|
dataHolder.removeGroup(auxGroup.getName());
|
||||||
@ -715,14 +715,16 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manuaddp <player> <permission>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auxString = args[1];
|
auxString = args[1];
|
||||||
if (auxString.startsWith("'") && auxString.endsWith("'"))
|
if (auxString.startsWith("'") && auxString.endsWith("'"))
|
||||||
{
|
{
|
||||||
auxString = auxString.substring(1, auxString.length() - 1);
|
auxString = auxString.substring(1, auxString.length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -735,12 +737,12 @@ public class GroupManager extends JavaPlugin {
|
|||||||
// Validating your permissions
|
// Validating your permissions
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||||
sender.sendMessage(ChatColor.RED + "Can't modify player with same group than you, or higher.");
|
sender.sendMessage(ChatColor.RED + "Can't modify player with same group than you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]);
|
permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]);
|
||||||
if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
|
if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't add a permission you don't have.");
|
sender.sendMessage(ChatColor.RED + "You can't add a permission you don't have.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permissions of user
|
// Validating permissions of user
|
||||||
permissionResult = permissionHandler.checkUserOnlyPermission(auxUser, args[1]);
|
permissionResult = permissionHandler.checkUserOnlyPermission(auxUser, args[1]);
|
||||||
@ -754,17 +756,17 @@ public class GroupManager extends JavaPlugin {
|
|||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The user already has an exception for this node.");
|
sender.sendMessage(ChatColor.RED + "The user already has an exception for this node.");
|
||||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||||
return false;
|
return true;
|
||||||
} else if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
} else if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The user already has a matching node ");
|
sender.sendMessage(ChatColor.RED + "The user already has a matching node ");
|
||||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.FOUND)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.FOUND)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The user already has direct access to that permission.");
|
sender.sendMessage(ChatColor.RED + "The user already has direct access to that permission.");
|
||||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
@ -785,9 +787,16 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudelp <player> <permission>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auxString = args[1];
|
||||||
|
if (auxString.startsWith("'") && auxString.endsWith("'"))
|
||||||
|
{
|
||||||
|
auxString = auxString.substring(1, auxString.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -800,27 +809,27 @@ public class GroupManager extends JavaPlugin {
|
|||||||
// Validating your permissions
|
// Validating your permissions
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
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.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player with same group as you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]);
|
permissionResult = permissionHandler.checkFullUserPermission(senderUser, auxString);
|
||||||
if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
|
if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't remove a permission you don't have.");
|
sender.sendMessage(ChatColor.RED + "You can't remove a permission you don't have.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permissions of user
|
// Validating permissions of user
|
||||||
permissionResult = permissionHandler.checkUserOnlyPermission(auxUser, args[1]);
|
permissionResult = permissionHandler.checkUserOnlyPermission(auxUser, auxString);
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The user doesn't have direct access to that permission.");
|
sender.sendMessage(ChatColor.RED + "The user doesn't have direct access to that permission.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!auxUser.hasSamePermissionNode(args[1])) {
|
if (!auxUser.hasSamePermissionNode(auxString)) {
|
||||||
sender.sendMessage(ChatColor.RED + "This permission node doesn't match any node.");
|
sender.sendMessage(ChatColor.RED + "This permission node doesn't match any node.");
|
||||||
sender.sendMessage(ChatColor.RED + "But might match node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.RED + "But might match node: " + permissionResult.accessLevel);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxUser.removePermission(args[1]);
|
auxUser.removePermission(auxString);
|
||||||
sender.sendMessage(ChatColor.YELLOW + "You removed '" + args[1] + "' from player '" + auxUser.getName() + "' permissions.");
|
sender.sendMessage(ChatColor.YELLOW + "You removed '" + auxString + "' from player '" + auxUser.getName() + "' permissions.");
|
||||||
|
|
||||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||||
if (targetPlayer != null)
|
if (targetPlayer != null)
|
||||||
@ -836,8 +845,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if ((args.length == 0) || (args.length > 2)) {
|
if ((args.length == 0) || (args.length > 2)) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> (+))");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manulistp <player> (+))");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
@ -901,8 +910,14 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <permission>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manucheckp <player> <permission>)");
|
||||||
return false;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
auxString = args[1];
|
||||||
|
if (auxString.startsWith("'") && auxString.endsWith("'"))
|
||||||
|
{
|
||||||
|
auxString = auxString.substring(1, auxString.length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
@ -916,24 +931,24 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||||
// Validating permission
|
// Validating permission
|
||||||
permissionResult = permissionHandler.checkFullGMPermission(auxUser, args[1], false);
|
permissionResult = permissionHandler.checkFullGMPermission(auxUser, auxString, false);
|
||||||
|
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
||||||
// No permissions found in GM so fall through and check Bukkit.
|
// No permissions found in GM so fall through and check Bukkit.
|
||||||
sender.sendMessage(ChatColor.RED + "The player doesn't have access to that permission");
|
sender.sendMessage(ChatColor.YELLOW + "The player doesn't have access to that permission");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// This permission was found in groupmanager.
|
// This permission was found in groupmanager.
|
||||||
if (permissionResult.owner instanceof User) {
|
if (permissionResult.owner instanceof User) {
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The user has directly a negation node for that permission.");
|
sender.sendMessage(ChatColor.YELLOW + "The user has directly a negation node for that permission.");
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission.");
|
sender.sendMessage(ChatColor.YELLOW + "The user has directly this permission.");
|
||||||
}
|
}
|
||||||
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.YELLOW + "Permission Node: " + permissionResult.accessLevel);
|
||||||
} else if (permissionResult.owner instanceof Group) {
|
} else if (permissionResult.owner instanceof Group) {
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The user inherits a negation permission from group: " + permissionResult.owner.getName());
|
sender.sendMessage(ChatColor.YELLOW + "The user inherits a negation permission from group: " + permissionResult.owner.getName());
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
|
sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
|
||||||
}
|
}
|
||||||
@ -956,24 +971,26 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <permission>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangaaddp <group> <permission>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
auxString = args[1];
|
auxString = args[1];
|
||||||
if (auxString.startsWith("'") && auxString.endsWith("'"))
|
if (auxString.startsWith("'") && auxString.endsWith("'"))
|
||||||
{
|
{
|
||||||
auxString = auxString.substring(1, auxString.length() - 1);
|
auxString = auxString.substring(1, auxString.length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "The specified group does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Validating your permissions
|
// Validating your permissions
|
||||||
permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]);
|
permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]);
|
||||||
if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
|
if (!isConsole && !isOpOverride && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't add a permission you don't have.");
|
sender.sendMessage(ChatColor.RED + "You can't add a permission you don't have.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permissions of user
|
// Validating permissions of user
|
||||||
permissionResult = permissionHandler.checkGroupOnlyPermission(auxGroup, args[1]);
|
permissionResult = permissionHandler.checkGroupOnlyPermission(auxGroup, args[1]);
|
||||||
@ -981,23 +998,23 @@ public class GroupManager extends JavaPlugin {
|
|||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The group already has direct access to that permission.");
|
sender.sendMessage(ChatColor.RED + "The group already has direct access to that permission.");
|
||||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (auxString.startsWith("-")) {
|
} else if (auxString.startsWith("-")) {
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.EXCEPTION)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The group already has an exception for this node.");
|
sender.sendMessage(ChatColor.RED + "The group already has an exception for this node.");
|
||||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||||
return false;
|
return true;
|
||||||
} else if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
} else if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The group already has a matching node.");
|
sender.sendMessage(ChatColor.RED + "The group already has a matching node.");
|
||||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.FOUND)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.FOUND)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The group already has direct access to that permission.");
|
sender.sendMessage(ChatColor.RED + "The group already has direct access to that permission.");
|
||||||
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.RED + "Node: " + permissionResult.accessLevel);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
@ -1016,34 +1033,41 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <permission>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangdelp <group> <permission>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auxString = args[1];
|
||||||
|
if (auxString.startsWith("'") && auxString.endsWith("'"))
|
||||||
|
{
|
||||||
|
auxString = auxString.substring(1, auxString.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "The specified group does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating your permissions
|
// Validating your permissions
|
||||||
permissionResult = permissionHandler.checkFullUserPermission(senderUser, args[1]);
|
permissionResult = permissionHandler.checkFullUserPermission(senderUser, auxString);
|
||||||
if (!isConsole && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
|
if (!isConsole && (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND) || permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION))) {
|
||||||
sender.sendMessage(ChatColor.RED + "Can't remove a permission you don't have.");
|
sender.sendMessage(ChatColor.RED + "Can't remove a permission you don't have.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permissions of user
|
// Validating permissions of user
|
||||||
permissionResult = permissionHandler.checkGroupOnlyPermission(auxGroup, args[1]);
|
permissionResult = permissionHandler.checkGroupOnlyPermission(auxGroup, auxString);
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The group doesn't have direct access to that permission.");
|
sender.sendMessage(ChatColor.RED + "The group doesn't have direct access to that permission.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!auxGroup.hasSamePermissionNode(args[1])) {
|
if (!auxGroup.hasSamePermissionNode(auxString)) {
|
||||||
sender.sendMessage(ChatColor.RED + "This permission node doesn't match any node.");
|
sender.sendMessage(ChatColor.RED + "This permission node doesn't match any node.");
|
||||||
sender.sendMessage(ChatColor.RED + "But might match node: " + permissionResult.accessLevel);
|
sender.sendMessage(ChatColor.RED + "But might match node: " + permissionResult.accessLevel);
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxGroup.removePermission(args[1]);
|
auxGroup.removePermission(auxString);
|
||||||
sender.sendMessage(ChatColor.YELLOW + "You removed '" + args[1] + "' from group '" + auxGroup.getName() + "' permissions.");
|
sender.sendMessage(ChatColor.YELLOW + "You removed '" + auxString + "' from group '" + auxGroup.getName() + "' permissions.");
|
||||||
|
|
||||||
BukkitPermissions.updateAllPlayers();
|
BukkitPermissions.updateAllPlayers();
|
||||||
|
|
||||||
@ -1057,13 +1081,13 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manglistp <group>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "The specified group does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
|
|
||||||
@ -1106,25 +1130,32 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <permission>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangcheckp <group> <permission>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auxString = args[1];
|
||||||
|
if (auxString.startsWith("'") && auxString.endsWith("'"))
|
||||||
|
{
|
||||||
|
auxString = auxString.substring(1, auxString.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "The specified group does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
permissionResult = permissionHandler.checkGroupPermissionWithInheritance(auxGroup, args[1]);
|
permissionResult = permissionHandler.checkGroupPermissionWithInheritance(auxGroup, auxString);
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NOTFOUND)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The group doesn't have access to that permission");
|
sender.sendMessage(ChatColor.YELLOW + "The group doesn't have access to that permission");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
// auxString = permissionHandler.checkUserOnlyPermission(auxUser, args[1]);
|
// auxString = permissionHandler.checkUserOnlyPermission(auxUser, args[1]);
|
||||||
if (permissionResult.owner instanceof Group) {
|
if (permissionResult.owner instanceof Group) {
|
||||||
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
if (permissionResult.resultType.equals(PermissionCheckResult.Type.NEGATION)) {
|
||||||
sender.sendMessage(ChatColor.RED + "The group inherits the negation permission from group: " + permissionResult.owner.getName());
|
sender.sendMessage(ChatColor.YELLOW + "The group inherits the negation permission from group: " + permissionResult.owner.getName());
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
|
sender.sendMessage(ChatColor.YELLOW + "The user inherits the permission from group: " + permissionResult.owner.getName());
|
||||||
}
|
}
|
||||||
@ -1141,28 +1172,28 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group1> <group2>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangaddi <group1> <group2>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group 1 does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup2 = dataHolder.getGroup(args[1]);
|
auxGroup2 = dataHolder.getGroup(args[1]);
|
||||||
if (auxGroup2 == null) {
|
if (auxGroup2 == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group 2 does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[1] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance.");
|
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validating permission
|
// Validating permission
|
||||||
if (permissionHandler.hasGroupInInheritance(auxGroup, auxGroup2.getName())) {
|
if (permissionHandler.hasGroupInInheritance(auxGroup, auxGroup2.getName())) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " already inherits " + auxGroup2.getName() + " (might not be directly)");
|
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " already inherits " + auxGroup2.getName() + " (might not be directly)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxGroup.addInherits(auxGroup2);
|
auxGroup.addInherits(auxGroup2);
|
||||||
@ -1180,32 +1211,32 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group1> <group2>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangdeli <group1> <group2>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group 1 does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup2 = dataHolder.getGroup(args[1]);
|
auxGroup2 = dataHolder.getGroup(args[1]);
|
||||||
if (auxGroup2 == null) {
|
if (auxGroup2 == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group 2 does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[1] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance.");
|
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support inheritance.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validating permission
|
// Validating permission
|
||||||
if (!permissionHandler.hasGroupInInheritance(auxGroup, auxGroup2.getName())) {
|
if (!permissionHandler.hasGroupInInheritance(auxGroup, auxGroup2.getName())) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + ".");
|
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + ".");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!auxGroup.getInherits().contains(auxGroup2.getName())) {
|
if (!auxGroup.getInherits().contains(auxGroup2.getName())) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + " directly.");
|
sender.sendMessage(ChatColor.RED + "Group " + auxGroup.getName() + " does not inherits " + auxGroup2.getName() + " directly.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxGroup.removeInherits(auxGroup2.getName());
|
auxGroup.removeInherits(auxGroup2.getName());
|
||||||
@ -1223,8 +1254,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length < 3) {
|
if (args.length < 3) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable> <value>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manuaddv <user> <variable> <value>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1261,8 +1292,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manudelv <user> <variable>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1276,7 +1307,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
// Validating permission
|
// Validating permission
|
||||||
if (!auxUser.getVariables().hasVar(args[1])) {
|
if (!auxUser.getVariables().hasVar(args[1])) {
|
||||||
sender.sendMessage(ChatColor.RED + "The user doesn't have directly that variable!");
|
sender.sendMessage(ChatColor.RED + "The user doesn't have directly that variable!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxUser.getVariables().removeVar(args[1]);
|
auxUser.getVariables().removeVar(args[1]);
|
||||||
@ -1292,8 +1323,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manulistv <user>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1327,8 +1358,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <user> <variable>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manucheckv <user> <variable>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1351,8 +1382,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (auxGroup2 == null) {
|
if (auxGroup2 == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "The user doesn't have access to that variable!");
|
sender.sendMessage(ChatColor.YELLOW + "The user doesn't have access to that variable!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
@ -1375,17 +1406,17 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length < 3) {
|
if (args.length < 3) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <variable> <value>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangaddv <group> <variable> <value>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "The specified group does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
// Seems OK
|
// Seems OK
|
||||||
@ -1413,21 +1444,22 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <variable>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangdelv <group> <variable>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "The specified group does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + auxGroup.getName() + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
if (!auxGroup.getVariables().hasVar(args[1])) {
|
if (!auxGroup.getVariables().hasVar(args[1])) {
|
||||||
sender.sendMessage(ChatColor.RED + "The group doesn't have directly that variable!");
|
sender.sendMessage(ChatColor.RED + "The group doesn't have directly that variable!");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxGroup.getVariables().removeVar(args[1]);
|
auxGroup.getVariables().removeVar(args[1]);
|
||||||
@ -1443,17 +1475,17 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manglistv <group>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "The specified group does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
// Seems OK
|
// Seems OK
|
||||||
@ -1486,17 +1518,17 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <group> <variable>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangcheckv <group> <variable>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "The specified group does not exist!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
sender.sendMessage(ChatColor.RED + "GlobalGroups do NOT support Info Nodes.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1]);
|
auxGroup2 = permissionHandler.nextGroupWithVariable(auxGroup, args[1]);
|
||||||
@ -1519,8 +1551,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manwhois <player>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1559,8 +1591,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/tempadd <player>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1573,7 +1605,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
// Validating permission
|
// Validating permission
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||||
sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher.");
|
sender.sendMessage(ChatColor.RED + "Can't modify player with same permissions than you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
if (overloadedUsers.get(dataHolder.getName().toLowerCase()) == null) {
|
if (overloadedUsers.get(dataHolder.getName().toLowerCase()) == null) {
|
||||||
@ -1581,7 +1613,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
dataHolder.overloadUser(auxUser.getName());
|
dataHolder.overloadUser(auxUser.getName());
|
||||||
overloadedUsers.get(dataHolder.getName().toLowerCase()).add(dataHolder.getUser(auxUser.getName()));
|
overloadedUsers.get(dataHolder.getName().toLowerCase()).add(dataHolder.getUser(auxUser.getName()));
|
||||||
sender.sendMessage(ChatColor.YELLOW + "Player overloaded!");
|
sender.sendMessage(ChatColor.YELLOW + "Player set to overload mode!");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -1593,8 +1625,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 1) {
|
if (args.length != 1) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/tempdel <player>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1607,7 +1639,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
// Validating permission
|
// Validating permission
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
if (overloadedUsers.get(dataHolder.getName().toLowerCase()) == null) {
|
if (overloadedUsers.get(dataHolder.getName().toLowerCase()) == null) {
|
||||||
@ -1617,7 +1649,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
if (overloadedUsers.get(dataHolder.getName().toLowerCase()).contains(auxUser)) {
|
if (overloadedUsers.get(dataHolder.getName().toLowerCase()).contains(auxUser)) {
|
||||||
overloadedUsers.get(dataHolder.getName().toLowerCase()).remove(auxUser);
|
overloadedUsers.get(dataHolder.getName().toLowerCase()).remove(auxUser);
|
||||||
}
|
}
|
||||||
sender.sendMessage(ChatColor.YELLOW + "You removed that player's overload. He's back to normal!");
|
sender.sendMessage(ChatColor.YELLOW + "Player overload mode is now disabled.");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -1777,8 +1809,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manpromote <player> <group>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1790,33 +1822,33 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[1]);
|
auxGroup = dataHolder.getGroup(args[1]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group not found!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
|
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) {
|
if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "The destination group can't be the same as yours, or higher.");
|
sender.sendMessage(ChatColor.RED + "The destination group can't be the same as yours, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) {
|
if (!isConsole && !isOpOverride && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player involving a group that you don't inherit.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player involving a group that you don't inherit.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
if (!isConsole && !isOpOverride && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player using groups with different heritage line.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player using groups with different heritage line.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (!permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
if (!isConsole && !isOpOverride && (!permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "The new group must be a higher rank.");
|
sender.sendMessage(ChatColor.RED + "The new group must be a higher rank.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxUser.setGroup(auxGroup);
|
auxUser.setGroup(auxGroup);
|
||||||
@ -1833,8 +1865,8 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
// Validating arguments
|
// Validating arguments
|
||||||
if (args.length != 2) {
|
if (args.length != 2) {
|
||||||
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/<command> <player> <group>)");
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mandemote <player> <group>)");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
return false;
|
return false;
|
||||||
@ -1846,33 +1878,33 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[1]);
|
auxGroup = dataHolder.getGroup(args[1]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "Group not found!");
|
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
|
sender.sendMessage(ChatColor.RED + "Players may not be members of GlobalGroups directly.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
if (!isConsole && !isOpOverride && (senderGroup != null ? permissionHandler.inGroup(auxUser.getName(), senderGroup.getName()) : false)) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player with same permissions as you, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) {
|
if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, senderGroup.getName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "The destination group can't be the same as yours, or higher.");
|
sender.sendMessage(ChatColor.RED + "The destination group can't be the same as yours, or higher.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) {
|
if (!isConsole && !isOpOverride && (!permissionHandler.inGroup(senderUser.getName(), auxUser.getGroupName()) || !permissionHandler.inGroup(senderUser.getName(), auxGroup.getName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player involving a group that you don't inherit.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player involving a group that you don't inherit.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
if (!isConsole && !isOpOverride && (!permissionHandler.hasGroupInInheritance(auxUser.getGroup(), auxGroup.getName()) && !permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "You can't modify a player using groups with different inheritage line.");
|
sender.sendMessage(ChatColor.RED + "You can't modify a player using groups with different inheritage line.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
if (!isConsole && !isOpOverride && (permissionHandler.hasGroupInInheritance(auxGroup, auxUser.getGroupName()))) {
|
||||||
sender.sendMessage(ChatColor.RED + "The new group must be a lower rank.");
|
sender.sendMessage(ChatColor.RED + "The new group must be a lower rank.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
auxUser.setGroup(auxGroup);
|
auxUser.setGroup(auxGroup);
|
||||||
@ -1998,7 +2030,7 @@ public class GroupManager extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sender.sendMessage(ChatColor.RED + "You are not allowed to use that command.");
|
sender.sendMessage(ChatColor.RED + "You are not allowed to use that command.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user