mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-26 11:08:13 +01:00
Use group.<name> instead of luckperms.group.<name> to indicate group membership
This commit is contained in:
parent
776ec45701
commit
3c83c31e9f
@ -47,7 +47,7 @@ public class BukkitConfig implements LPConfiguration {
|
||||
|
||||
@Override
|
||||
public String getDefaultGroupNode() {
|
||||
return "luckperms.group." + configuration.getString("default-group", "default");
|
||||
return "group." + configuration.getString("default-group", "default");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,7 +3,7 @@
|
||||
# The name of the server, used for server specific permissions. Set to 'global' to disable.
|
||||
server: global
|
||||
|
||||
# The default group assigned to all user on join. e.g. a value of "default" = luckperms.group.default
|
||||
# The default group assigned to all user on join.
|
||||
default-group: default
|
||||
|
||||
# If users on this server should have their global permissions/groups applied.
|
||||
|
@ -53,7 +53,7 @@ public class BungeeConfig implements LPConfiguration {
|
||||
|
||||
@Override
|
||||
public String getDefaultGroupNode() {
|
||||
return "luckperms.group." + configuration.getString("default-group", "default");
|
||||
return "group." + configuration.getString("default-group", "default");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -3,7 +3,7 @@
|
||||
# The name of the server, used for server specific permissions. Set to 'global' to disable.
|
||||
server: bungee
|
||||
|
||||
# The default group assigned to all user on join. e.g. a value of "default" = luckperms.group.default
|
||||
# The default group assigned to all user on join.
|
||||
default-group: default
|
||||
|
||||
# If users on this server should have their global permissions/groups applied.
|
||||
|
@ -23,7 +23,7 @@ public class GroupSetInheritCommand extends GroupSubCommand {
|
||||
if (!success) {
|
||||
Util.sendPluginMessage(sender, groupName + " does not exist!");
|
||||
} else {
|
||||
final String node = "luckperms.group." + groupName;
|
||||
final String node = "group." + groupName;
|
||||
|
||||
try {
|
||||
if (args.size() == 2) {
|
||||
|
@ -25,7 +25,7 @@ public class GroupSetPermissionCommand extends GroupSubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.matches(".*luckperms\\.group\\..*")) {
|
||||
if (node.matches("group\\..*")) {
|
||||
Util.sendPluginMessage(sender, "Use the inherit command instead of specifying the node.");
|
||||
return;
|
||||
}
|
||||
|
@ -24,8 +24,8 @@ public class GroupUnSetPermissionCommand extends GroupSubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.matches(".*luckperms\\.group\\..*")) {
|
||||
Util.sendPluginMessage(sender, "Use the uninherit command instead of specifying the node.");
|
||||
if (node.matches("group\\..*")) {
|
||||
Util.sendPluginMessage(sender, "Use the unsetinherit command instead of specifying the node.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class GroupUnsetInheritCommand extends GroupSubCommand {
|
||||
}
|
||||
|
||||
try {
|
||||
group.unsetPermission("luckperms.group." + groupName, server);
|
||||
group.unsetPermission("group." + groupName, server);
|
||||
Util.sendPluginMessage(sender, "&b" + group.getName() + "&a no longer inherits permissions from &b" + groupName + "&a on server &b" + server + "&a.");
|
||||
saveGroup(group, sender, plugin);
|
||||
} catch (ObjectLacksPermissionException e) {
|
||||
|
@ -25,7 +25,7 @@ public class UserSetPermissionCommand extends UserSubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.matches(".*luckperms\\.group\\..*")) {
|
||||
if (node.matches("group\\..*")) {
|
||||
Util.sendPluginMessage(sender, "Use the addgroup command instead of specifying the node.");
|
||||
return;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class UserUnSetPermissionCommand extends UserSubCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.matches(".*luckperms\\.group\\..*")) {
|
||||
if (node.matches("group\\..*")) {
|
||||
Util.sendPluginMessage(sender, "Use the removegroup command instead of specifying the node.");
|
||||
return;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public abstract class User extends PermissionObject {
|
||||
* @return true if the user is a member of the group
|
||||
*/
|
||||
public boolean isInGroup(Group group, String server) {
|
||||
return hasPermission("luckperms.group." + group.getName(), true, server);
|
||||
return hasPermission("group." + group.getName(), true, server);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,7 +89,7 @@ public abstract class User extends PermissionObject {
|
||||
server = "global";
|
||||
}
|
||||
|
||||
setPermission("luckperms.group." + group.getName(), true, server);
|
||||
setPermission("group." + group.getName(), true, server);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -112,7 +112,7 @@ public abstract class User extends PermissionObject {
|
||||
server = "global";
|
||||
}
|
||||
|
||||
unsetPermission("luckperms.group." + group.getName(), server);
|
||||
unsetPermission("group." + group.getName(), server);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -186,7 +186,7 @@ public abstract class User extends PermissionObject {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (parts[1].matches("luckperms\\.group\\..*")) {
|
||||
if (parts[1].matches("group\\..*")) {
|
||||
// SERVER SPECIFIC AND GROUP
|
||||
serverSpecificGroups.put(node.getKey(), node.getValue());
|
||||
continue;
|
||||
@ -198,7 +198,7 @@ public abstract class User extends PermissionObject {
|
||||
// Skip adding global permissions if they are not requested
|
||||
if (!includeGlobal) continue;
|
||||
|
||||
if (node.getKey().matches("luckperms\\.group\\..*")) {
|
||||
if (node.getKey().matches("group\\..*")) {
|
||||
// GROUP
|
||||
groupNodes.put(node.getKey(), node.getValue());
|
||||
}
|
||||
@ -211,8 +211,8 @@ public abstract class User extends PermissionObject {
|
||||
groupNodes.remove(node.getKey().split("\\/", 2)[1]);
|
||||
});
|
||||
|
||||
groups.addAll(serverSpecificGroups.entrySet().stream().filter(Map.Entry::getValue).map(e -> e.getKey().split("\\.", 3)[2]).collect(Collectors.toList()));
|
||||
groups.addAll(groupNodes.entrySet().stream().filter(Map.Entry::getValue).map(e -> e.getKey().split("\\.", 3)[2]).collect(Collectors.toList()));
|
||||
groups.addAll(serverSpecificGroups.entrySet().stream().filter(Map.Entry::getValue).map(e -> e.getKey().split("\\.", 2)[1]).collect(Collectors.toList()));
|
||||
groups.addAll(groupNodes.entrySet().stream().filter(Map.Entry::getValue).map(e -> e.getKey().split("\\.", 2)[1]).collect(Collectors.toList()));
|
||||
return groups;
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ public abstract class PermissionObject {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (parts[1].matches("luckperms\\.group\\..*")) {
|
||||
if (parts[1].matches("group\\..*")) {
|
||||
// SERVER SPECIFIC AND GROUP
|
||||
serverSpecificGroups.put(node.getKey(), node.getValue());
|
||||
continue;
|
||||
@ -189,7 +189,7 @@ public abstract class PermissionObject {
|
||||
// Skip adding global permissions if they are not requested
|
||||
if (!includeGlobal) continue;
|
||||
|
||||
if (node.getKey().matches("luckperms\\.group\\..*")) {
|
||||
if (node.getKey().matches("group\\..*")) {
|
||||
// GROUP
|
||||
groupNodes.put(node.getKey(), node.getValue());
|
||||
continue;
|
||||
@ -214,7 +214,7 @@ public abstract class PermissionObject {
|
||||
// Don't add negated groups
|
||||
if (!groupNode.getValue()) continue;
|
||||
|
||||
String groupName = groupNode.getKey().split("\\.", 3)[2];
|
||||
String groupName = groupNode.getKey().split("\\.", 2)[1];
|
||||
if (!excludedGroups.contains(groupName)) {
|
||||
Group group = plugin.getGroupManager().getGroup(groupName);
|
||||
if (group != null) {
|
||||
@ -236,7 +236,7 @@ public abstract class PermissionObject {
|
||||
// Don't add negated groups
|
||||
if (!groupNode.getValue()) continue;
|
||||
|
||||
String groupName = rawNode.split("\\.", 3)[2];
|
||||
String groupName = rawNode.split("\\.", 2)[1];
|
||||
if (!excludedGroups.contains(groupName)) {
|
||||
Group group = plugin.getGroupManager().getGroup(groupName);
|
||||
if (group != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user