use of me.lucko.luckperms.sponge.service.model.LPSubjectReference in project LuckPerms by lucko.
the class CalculatedSubjectData method resolveParents.
public Set<LPSubjectReference> resolveParents(ContextSet filter) {
// get relevant entries
SortedMap<ImmutableContextSet, Set<LPSubjectReference>> sorted = new TreeMap<>(ContextSetComparator.reverse());
for (Map.Entry<ImmutableContextSet, Set<LPSubjectReference>> entry : this.parents.entrySet()) {
if (!entry.getKey().isSatisfiedBy(filter)) {
continue;
}
sorted.put(entry.getKey(), entry.getValue());
}
// flatten
Set<LPSubjectReference> result = new LinkedHashSet<>();
for (Set<LPSubjectReference> set : sorted.values()) {
for (LPSubjectReference e : set) {
if (!result.contains(e)) {
result.add(e);
}
}
}
return result;
}
Aggregations