Use group.<name> instead of luckperms.group.<name> to indicate group membership

This commit is contained in:
Luck 2016-06-29 11:57:55 +01:00
parent 776ec45701
commit 3c83c31e9f
12 changed files with 22 additions and 22 deletions

View File

@ -47,7 +47,7 @@ public class BukkitConfig implements LPConfiguration {
@Override @Override
public String getDefaultGroupNode() { public String getDefaultGroupNode() {
return "luckperms.group." + configuration.getString("default-group", "default"); return "group." + configuration.getString("default-group", "default");
} }
@Override @Override

View File

@ -3,7 +3,7 @@
# The name of the server, used for server specific permissions. Set to 'global' to disable. # The name of the server, used for server specific permissions. Set to 'global' to disable.
server: global 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 default-group: default
# If users on this server should have their global permissions/groups applied. # If users on this server should have their global permissions/groups applied.

View File

@ -53,7 +53,7 @@ public class BungeeConfig implements LPConfiguration {
@Override @Override
public String getDefaultGroupNode() { public String getDefaultGroupNode() {
return "luckperms.group." + configuration.getString("default-group", "default"); return "group." + configuration.getString("default-group", "default");
} }
@Override @Override

View File

@ -3,7 +3,7 @@
# The name of the server, used for server specific permissions. Set to 'global' to disable. # The name of the server, used for server specific permissions. Set to 'global' to disable.
server: bungee 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 default-group: default
# If users on this server should have their global permissions/groups applied. # If users on this server should have their global permissions/groups applied.

View File

@ -23,7 +23,7 @@ public class GroupSetInheritCommand extends GroupSubCommand {
if (!success) { if (!success) {
Util.sendPluginMessage(sender, groupName + " does not exist!"); Util.sendPluginMessage(sender, groupName + " does not exist!");
} else { } else {
final String node = "luckperms.group." + groupName; final String node = "group." + groupName;
try { try {
if (args.size() == 2) { if (args.size() == 2) {

View File

@ -25,7 +25,7 @@ public class GroupSetPermissionCommand extends GroupSubCommand {
return; return;
} }
if (node.matches(".*luckperms\\.group\\..*")) { if (node.matches("group\\..*")) {
Util.sendPluginMessage(sender, "Use the inherit command instead of specifying the node."); Util.sendPluginMessage(sender, "Use the inherit command instead of specifying the node.");
return; return;
} }

View File

@ -24,8 +24,8 @@ public class GroupUnSetPermissionCommand extends GroupSubCommand {
return; return;
} }
if (node.matches(".*luckperms\\.group\\..*")) { if (node.matches("group\\..*")) {
Util.sendPluginMessage(sender, "Use the uninherit command instead of specifying the node."); Util.sendPluginMessage(sender, "Use the unsetinherit command instead of specifying the node.");
return; return;
} }

View File

@ -27,7 +27,7 @@ public class GroupUnsetInheritCommand extends GroupSubCommand {
} }
try { 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."); Util.sendPluginMessage(sender, "&b" + group.getName() + "&a no longer inherits permissions from &b" + groupName + "&a on server &b" + server + "&a.");
saveGroup(group, sender, plugin); saveGroup(group, sender, plugin);
} catch (ObjectLacksPermissionException e) { } catch (ObjectLacksPermissionException e) {

View File

@ -25,7 +25,7 @@ public class UserSetPermissionCommand extends UserSubCommand {
return; return;
} }
if (node.matches(".*luckperms\\.group\\..*")) { if (node.matches("group\\..*")) {
Util.sendPluginMessage(sender, "Use the addgroup command instead of specifying the node."); Util.sendPluginMessage(sender, "Use the addgroup command instead of specifying the node.");
return; return;
} }

View File

@ -24,7 +24,7 @@ public class UserUnSetPermissionCommand extends UserSubCommand {
return; return;
} }
if (node.matches(".*luckperms\\.group\\..*")) { if (node.matches("group\\..*")) {
Util.sendPluginMessage(sender, "Use the removegroup command instead of specifying the node."); Util.sendPluginMessage(sender, "Use the removegroup command instead of specifying the node.");
return; return;
} }

View File

@ -66,7 +66,7 @@ public abstract class User extends PermissionObject {
* @return true if the user is a member of the group * @return true if the user is a member of the group
*/ */
public boolean isInGroup(Group group, String server) { 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"; 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"; server = "global";
} }
unsetPermission("luckperms.group." + group.getName(), server); unsetPermission("group." + group.getName(), server);
} }
/** /**
@ -186,7 +186,7 @@ public abstract class User extends PermissionObject {
continue; continue;
} }
if (parts[1].matches("luckperms\\.group\\..*")) { if (parts[1].matches("group\\..*")) {
// SERVER SPECIFIC AND GROUP // SERVER SPECIFIC AND GROUP
serverSpecificGroups.put(node.getKey(), node.getValue()); serverSpecificGroups.put(node.getKey(), node.getValue());
continue; continue;
@ -198,7 +198,7 @@ public abstract class User extends PermissionObject {
// Skip adding global permissions if they are not requested // Skip adding global permissions if they are not requested
if (!includeGlobal) continue; if (!includeGlobal) continue;
if (node.getKey().matches("luckperms\\.group\\..*")) { if (node.getKey().matches("group\\..*")) {
// GROUP // GROUP
groupNodes.put(node.getKey(), node.getValue()); groupNodes.put(node.getKey(), node.getValue());
} }
@ -211,8 +211,8 @@ public abstract class User extends PermissionObject {
groupNodes.remove(node.getKey().split("\\/", 2)[1]); 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(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("\\.", 3)[2]).collect(Collectors.toList())); groups.addAll(groupNodes.entrySet().stream().filter(Map.Entry::getValue).map(e -> e.getKey().split("\\.", 2)[1]).collect(Collectors.toList()));
return groups; return groups;
} }

View File

@ -175,7 +175,7 @@ public abstract class PermissionObject {
continue; continue;
} }
if (parts[1].matches("luckperms\\.group\\..*")) { if (parts[1].matches("group\\..*")) {
// SERVER SPECIFIC AND GROUP // SERVER SPECIFIC AND GROUP
serverSpecificGroups.put(node.getKey(), node.getValue()); serverSpecificGroups.put(node.getKey(), node.getValue());
continue; continue;
@ -189,7 +189,7 @@ public abstract class PermissionObject {
// Skip adding global permissions if they are not requested // Skip adding global permissions if they are not requested
if (!includeGlobal) continue; if (!includeGlobal) continue;
if (node.getKey().matches("luckperms\\.group\\..*")) { if (node.getKey().matches("group\\..*")) {
// GROUP // GROUP
groupNodes.put(node.getKey(), node.getValue()); groupNodes.put(node.getKey(), node.getValue());
continue; continue;
@ -214,7 +214,7 @@ public abstract class PermissionObject {
// Don't add negated groups // Don't add negated groups
if (!groupNode.getValue()) continue; if (!groupNode.getValue()) continue;
String groupName = groupNode.getKey().split("\\.", 3)[2]; String groupName = groupNode.getKey().split("\\.", 2)[1];
if (!excludedGroups.contains(groupName)) { if (!excludedGroups.contains(groupName)) {
Group group = plugin.getGroupManager().getGroup(groupName); Group group = plugin.getGroupManager().getGroup(groupName);
if (group != null) { if (group != null) {
@ -236,7 +236,7 @@ public abstract class PermissionObject {
// Don't add negated groups // Don't add negated groups
if (!groupNode.getValue()) continue; if (!groupNode.getValue()) continue;
String groupName = rawNode.split("\\.", 3)[2]; String groupName = rawNode.split("\\.", 2)[1];
if (!excludedGroups.contains(groupName)) { if (!excludedGroups.contains(groupName)) {
Group group = plugin.getGroupManager().getGroup(groupName); Group group = plugin.getGroupManager().getGroup(groupName);
if (group != null) { if (group != null) {