mirror of
https://github.com/MilkBowl/Vault.git
synced 2025-01-29 19:41:25 +01:00
fix PEX primary group, they sort by rank in reverse (first is lowest
rank).
This commit is contained in:
parent
48b762dc70
commit
7faa28f069
@ -199,8 +199,10 @@ public class Permission_PermissionsEx extends Permission {
|
||||
PermissionUser user = PermissionsEx.getPermissionManager().getUser(playerName);
|
||||
if (user == null) {
|
||||
return null;
|
||||
} else if (user.getGroupsNames(world).length > 0) {
|
||||
return user.getGroupsNames(world)[0];
|
||||
}
|
||||
String[] groupNames = user.getGroupsNames();
|
||||
if (groupNames.length > 0) {
|
||||
return groupNames[groupNames.length - 1];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -271,8 +273,9 @@ public class Permission_PermissionsEx extends Permission {
|
||||
@Override
|
||||
public String[] getGroups() {
|
||||
PermissionGroup[] groups = PermissionsEx.getPermissionManager().getGroups();
|
||||
if (groups == null || groups.length == 0)
|
||||
if (groups == null || groups.length == 0) {
|
||||
return null;
|
||||
}
|
||||
String[] groupNames = new String[groups.length];
|
||||
for (int i = 0; i < groups.length; i++) {
|
||||
groupNames[i] = groups[i].getName();
|
||||
|
Loading…
Reference in New Issue
Block a user