use of me.lucko.luckperms.common.inheritance.InheritanceGraph in project LuckPerms by lucko.
the class PermissionHolder method accumulateMeta.
public MetaAccumulator accumulateMeta(MetaAccumulator accumulator) {
if (accumulator == null) {
accumulator = MetaAccumulator.makeFromConfig(this.plugin);
}
InheritanceGraph graph = this.plugin.getInheritanceHandler().getGraph();
Iterable<PermissionHolder> traversal = graph.traverse(this.plugin.getConfiguration().get(ConfigKeys.INHERITANCE_TRAVERSAL_ALGORITHM), this);
for (PermissionHolder holder : traversal) {
List<Node> nodes = holder.getOwnNodes();
for (Node node : nodes) {
if (!node.getValuePrimitive())
continue;
if (!node.isMeta() && !node.isPrefix() && !node.isSuffix())
continue;
accumulator.accumulateNode(ImmutableLocalizedNode.of(node, holder.getObjectName()));
}
OptionalInt w = getWeight();
if (w.isPresent()) {
accumulator.accumulateWeight(w.getAsInt());
}
}
return accumulator;
}
Aggregations