Sort subjects properly
This commit is contained in:
parent
26afb69a14
commit
e6a90a18c4
@ -216,7 +216,7 @@ public class LuckPermsService implements PermissionService {
|
|||||||
|
|
||||||
public List<Subject> sortSubjects(List<Subject> s) {
|
public List<Subject> sortSubjects(List<Subject> s) {
|
||||||
List<Subject> ret = new ArrayList<>(s);
|
List<Subject> ret = new ArrayList<>(s);
|
||||||
ret.sort((o1, o2) -> {
|
ret.sort(Collections.reverseOrder((o1, o2) -> {
|
||||||
if (o1.equals(o2)) {
|
if (o1.equals(o2)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -248,8 +248,8 @@ public class LuckPermsService implements PermissionService {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Integer.compare(g1.getWeight().orElse(0), g2.getWeight().orElse(0)) == -1 ? 1 : -1;
|
return Integer.compare(g1.getWeight().orElse(0), g2.getWeight().orElse(0)) == 1 ? 1 : -1;
|
||||||
});
|
}));
|
||||||
return ImmutableList.copyOf(ret);
|
return ImmutableList.copyOf(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user