mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-26 00:19:43 +00:00
messages fix, add /manuclearp and /mangclearp
This commit is contained in:
parent
f5ed4dd6cd
commit
b020983471
1 changed files with 83 additions and 20 deletions
|
@ -515,7 +515,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 + "" + args[1] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[1] + "' Group doesnt exist!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
|
@ -605,7 +605,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 + "" + args[1] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[1] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
|
@ -643,7 +643,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 + "" + args[1] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[1] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -675,7 +675,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup != null) {
|
if (auxGroup != null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group already exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group already exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Seems OK
|
// Seems OK
|
||||||
|
@ -849,6 +849,43 @@ public class GroupManager extends JavaPlugin {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case manuclearp:
|
||||||
|
// Validating state of sender
|
||||||
|
if (dataHolder == null || permissionHandler == null) {
|
||||||
|
if (!setDefaultWorldHandler(sender))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Validating arguments
|
||||||
|
if (args.length != 1) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/manuclearp <player>)");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((validateOnlinePlayer) && ((match = validatePlayer(args[0], sender)) == null)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match != null) {
|
||||||
|
auxUser = dataHolder.getUser(match.get(0));
|
||||||
|
} else {
|
||||||
|
auxUser = dataHolder.getUser(args[0]);
|
||||||
|
}
|
||||||
|
// Validating your permissions
|
||||||
|
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.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
for (auxString : auxUser.getPermissionList()) {
|
||||||
|
auxUser.removePermission(auxString);
|
||||||
|
}
|
||||||
|
sender.sendMessage(ChatColor.YELLOW + "You removed all permissions from player '" + auxUser.getName() + "' permissions.");
|
||||||
|
|
||||||
|
targetPlayer = this.getServer().getPlayer(auxUser.getName());
|
||||||
|
if (targetPlayer != null)
|
||||||
|
BukkitPermissions.updatePermissions(targetPlayer);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
case manulistp:
|
case manulistp:
|
||||||
// Validating state of sender
|
// Validating state of sender
|
||||||
if (dataHolder == null || permissionHandler == null) {
|
if (dataHolder == null || permissionHandler == null) {
|
||||||
|
@ -995,7 +1032,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
|
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Validating your permissions
|
// Validating your permissions
|
||||||
|
@ -1069,7 +1106,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
|
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating your permissions
|
// Validating your permissions
|
||||||
|
@ -1081,8 +1118,8 @@ public class GroupManager extends JavaPlugin {
|
||||||
// Validating permissions of user
|
// Validating permissions of user
|
||||||
permissionResult = permissionHandler.checkGroupOnlyPermission(auxGroup, auxString);
|
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.YELLOW + "The group doesn't have direct access to that permission.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (!auxGroup.hasSamePermissionNode(auxString)) {
|
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.");
|
||||||
|
@ -1097,6 +1134,32 @@ public class GroupManager extends JavaPlugin {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case mangclearp:
|
||||||
|
// Validating state of sender
|
||||||
|
if (dataHolder == null || permissionHandler == null) {
|
||||||
|
if (!setDefaultWorldHandler(sender))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Validating arguments
|
||||||
|
if (args.length != 1) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Review your arguments count! (/mangclearp <group>)");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
|
if (auxGroup == null) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
for (auxString : auxGroup.getPermissionList()) {
|
||||||
|
auxGroup.removePermission(auxString);
|
||||||
|
}
|
||||||
|
sender.sendMessage(ChatColor.YELLOW + "You removed all permissions from group '" + auxGroup.getName() + "' permissions.");
|
||||||
|
|
||||||
|
BukkitPermissions.updateAllPlayers();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
case manglistp:
|
case manglistp:
|
||||||
// Validating state of sender
|
// Validating state of sender
|
||||||
if (dataHolder == null || permissionHandler == null) {
|
if (dataHolder == null || permissionHandler == null) {
|
||||||
|
@ -1110,7 +1173,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
|
@ -1166,7 +1229,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
|
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Validating permission
|
// Validating permission
|
||||||
|
@ -1201,12 +1264,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup2 = dataHolder.getGroup(args[1]);
|
auxGroup2 = dataHolder.getGroup(args[1]);
|
||||||
if (auxGroup2 == null) {
|
if (auxGroup2 == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[1] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[1] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
|
@ -1240,12 +1303,12 @@ public class GroupManager extends JavaPlugin {
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
auxGroup2 = dataHolder.getGroup(args[1]);
|
auxGroup2 = dataHolder.getGroup(args[1]);
|
||||||
if (auxGroup2 == null) {
|
if (auxGroup2 == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[1] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[1] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
|
@ -1435,7 +1498,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
|
@ -1473,7 +1536,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
|
@ -1504,7 +1567,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
|
@ -1547,7 +1610,7 @@ public class GroupManager extends JavaPlugin {
|
||||||
}
|
}
|
||||||
auxGroup = dataHolder.getGroup(args[0]);
|
auxGroup = dataHolder.getGroup(args[0]);
|
||||||
if (auxGroup == null) {
|
if (auxGroup == null) {
|
||||||
sender.sendMessage(ChatColor.RED + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
|
@ -1846,7 +1909,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 + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
|
@ -1902,7 +1965,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 + "" + args[0] + " Group doesnt exist!");
|
sender.sendMessage(ChatColor.RED + "'" + args[0] + "' Group doesnt exist!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (auxGroup.isGlobal()) {
|
if (auxGroup.isGlobal()) {
|
||||||
|
|
Loading…
Reference in a new issue