mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-28 05:35:26 +01:00
Primary groups should come first, not last, when ordering groups for inheritance (#500)
This commit is contained in:
parent
597f2f7b1b
commit
28961b1cfa
@ -84,19 +84,13 @@ public class MetaAccumulator {
|
||||
|
||||
if (n.isPrefix()) {
|
||||
Map.Entry<Integer, String> value = n.getPrefix();
|
||||
if (!prefixes.containsKey(value.getKey())) {
|
||||
prefixes.put(value.getKey(), value.getValue());
|
||||
}
|
||||
|
||||
prefixes.putIfAbsent(value.getKey(), value.getValue());
|
||||
prefixStack.accumulateToAll(n);
|
||||
}
|
||||
|
||||
if (n.isSuffix()) {
|
||||
Map.Entry<Integer, String> value = n.getSuffix();
|
||||
if (!suffixes.containsKey(value.getKey())) {
|
||||
suffixes.put(value.getKey(), value.getValue());
|
||||
}
|
||||
|
||||
suffixes.putIfAbsent(value.getKey(), value.getValue());
|
||||
suffixStack.accumulateToAll(n);
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,8 @@ public class GroupInheritanceComparator implements Comparator<Group> {
|
||||
|
||||
// one of them is a primary group, and therefore has priority
|
||||
if (o1Primary != o2Primary) {
|
||||
return o1Primary ? 1 : -1;
|
||||
// we want the primary group to come first
|
||||
return o1Primary ? -1 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user