mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +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()) {
|
if (n.isPrefix()) {
|
||||||
Map.Entry<Integer, String> value = n.getPrefix();
|
Map.Entry<Integer, String> value = n.getPrefix();
|
||||||
if (!prefixes.containsKey(value.getKey())) {
|
prefixes.putIfAbsent(value.getKey(), value.getValue());
|
||||||
prefixes.put(value.getKey(), value.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
prefixStack.accumulateToAll(n);
|
prefixStack.accumulateToAll(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n.isSuffix()) {
|
if (n.isSuffix()) {
|
||||||
Map.Entry<Integer, String> value = n.getSuffix();
|
Map.Entry<Integer, String> value = n.getSuffix();
|
||||||
if (!suffixes.containsKey(value.getKey())) {
|
suffixes.putIfAbsent(value.getKey(), value.getValue());
|
||||||
suffixes.put(value.getKey(), value.getValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
suffixStack.accumulateToAll(n);
|
suffixStack.accumulateToAll(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,8 @@ public class GroupInheritanceComparator implements Comparator<Group> {
|
|||||||
|
|
||||||
// one of them is a primary group, and therefore has priority
|
// one of them is a primary group, and therefore has priority
|
||||||
if (o1Primary != o2Primary) {
|
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