use of me.lucko.luckperms.common.node.ImmutableLocalizedNode in project LuckPerms by lucko.
the class PermissionHolder method accumulateInheritancesTo.
private void accumulateInheritancesTo(List<LocalizedNode> accumulator, Contexts context) {
InheritanceGraph graph = this.plugin.getInheritanceHandler().getGraph(context);
Iterable<PermissionHolder> traversal = graph.traverse(this.plugin.getConfiguration().get(ConfigKeys.INHERITANCE_TRAVERSAL_ALGORITHM), this);
for (PermissionHolder holder : traversal) {
List<Node> nodes = holder.getOwnNodes(context.getContexts());
for (Node node : nodes) {
ImmutableLocalizedNode localizedNode = ImmutableLocalizedNode.of(node, holder.getObjectName());
accumulator.add(localizedNode);
}
}
}
use of me.lucko.luckperms.common.node.ImmutableLocalizedNode in project LuckPerms by lucko.
the class PermissionHolder method accumulateInheritancesTo.
private void accumulateInheritancesTo(List<LocalizedNode> accumulator) {
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) {
ImmutableLocalizedNode localizedNode = ImmutableLocalizedNode.of(node, holder.getObjectName());
accumulator.add(localizedNode);
}
}
}
use of me.lucko.luckperms.common.node.ImmutableLocalizedNode in project LuckPerms by lucko.
the class PermissionHolder method getAllEntries.
private List<LocalizedNode> getAllEntries(Contexts context) {
List<LocalizedNode> entries = new LinkedList<>();
if (context.hasSetting(LookupSetting.RESOLVE_INHERITANCE)) {
accumulateInheritancesTo(entries, context);
} else {
for (Node n : getOwnNodes(context.getContexts())) {
ImmutableLocalizedNode localizedNode = ImmutableLocalizedNode.of(n, getObjectName());
entries.add(localizedNode);
}
}
if (!context.hasSetting(LookupSetting.INCLUDE_NODES_SET_WITHOUT_SERVER)) {
entries.removeIf(n -> !n.isGroupNode() && !n.isServerSpecific());
}
if (!context.hasSetting(LookupSetting.INCLUDE_NODES_SET_WITHOUT_WORLD)) {
entries.removeIf(n -> !n.isGroupNode() && !n.isWorldSpecific());
}
return entries;
}
Aggregations