Rename InheritanceHandler --> InheritanceGraphFactory

This commit is contained in:
Luck 2020-05-07 00:38:48 +01:00
parent fe32aa2d33
commit 1af55e3720
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
7 changed files with 15 additions and 17 deletions

View File

@ -55,8 +55,8 @@ public class ReflectionClassLoader implements PluginClassLoader {
if (isJava9OrNewer()) {
bootstrap.getPluginLogger().info("It is safe to ignore any warning printed following this message " +
"starting with 'WARNING: An illegal reflective access operation has occurred, Illegal reflective " +
"access by " + getClass().getName() + "'.");
bootstrap.getPluginLogger().info("This is intended, and will not have any impact on the operation of LuckPerms.");
"access by " + getClass().getName() + "'. This is intended, and will not have any impact on the " +
"operation of LuckPerms.");
}
try {

View File

@ -33,13 +33,13 @@ import net.luckperms.api.query.QueryOptions;
/**
* Provides {@link InheritanceGraph}s.
*/
public class InheritanceHandler {
public class InheritanceGraphFactory {
private final LuckPermsPlugin plugin;
private final InheritanceGraph nonContextualGraph;
private final InheritanceGraph defaultContextualGraph;
public InheritanceHandler(LuckPermsPlugin plugin) {
public InheritanceGraphFactory(LuckPermsPlugin plugin) {
this.plugin = plugin;
this.nonContextualGraph = new InheritanceGraph(plugin, QueryOptionsImpl.DEFAULT_NON_CONTEXTUAL);
this.defaultContextualGraph = new InheritanceGraph(plugin, QueryOptionsImpl.DEFAULT_CONTEXTUAL);
@ -55,6 +55,4 @@ public class InheritanceHandler {
}
}
}

View File

@ -293,7 +293,7 @@ public abstract class PermissionHolder {
private void accumulateInheritedNodesTo(Collection<Node> accumulator, QueryOptions queryOptions) {
if (queryOptions.flag(Flag.RESOLVE_INHERITANCE)) {
InheritanceGraph graph = this.plugin.getInheritanceHandler().getGraph(queryOptions);
InheritanceGraph graph = this.plugin.getInheritanceGraphFactory().getGraph(queryOptions);
Iterable<PermissionHolder> traversal = graph.traverse(this);
for (PermissionHolder holder : traversal) {
List<? extends Node> nodes = holder.getOwnNodes(queryOptions);
@ -352,7 +352,7 @@ public abstract class PermissionHolder {
}
public MetaAccumulator accumulateMeta(MetaAccumulator accumulator, QueryOptions queryOptions) {
InheritanceGraph graph = this.plugin.getInheritanceHandler().getGraph(queryOptions);
InheritanceGraph graph = this.plugin.getInheritanceGraphFactory().getGraph(queryOptions);
Iterable<PermissionHolder> traversal = graph.traverse(this);
for (PermissionHolder holder : traversal) {
List<? extends Node> nodes = holder.getOwnNodes(queryOptions);

View File

@ -103,7 +103,7 @@ public interface PrimaryGroupHolder {
@Override
public String calculateValue(QueryOptions queryOptions) {
InheritanceGraph graph = this.user.getPlugin().getInheritanceHandler().getGraph(queryOptions);
InheritanceGraph graph = this.user.getPlugin().getInheritanceGraphFactory().getGraph(queryOptions);
// fully traverse the graph, obtain a list of permission holders the user inherits from in weight order.
Iterable<PermissionHolder> traversal = graph.traverse(this.user.getPlugin().getConfiguration().get(ConfigKeys.INHERITANCE_TRAVERSAL_ALGORITHM), true, this.user);

View File

@ -39,7 +39,7 @@ import me.lucko.luckperms.common.dependencies.DependencyManager;
import me.lucko.luckperms.common.event.AbstractEventBus;
import me.lucko.luckperms.common.event.EventDispatcher;
import me.lucko.luckperms.common.extension.SimpleExtensionManager;
import me.lucko.luckperms.common.inheritance.InheritanceHandler;
import me.lucko.luckperms.common.inheritance.InheritanceGraphFactory;
import me.lucko.luckperms.common.locale.LocaleManager;
import me.lucko.luckperms.common.locale.message.Message;
import me.lucko.luckperms.common.messaging.InternalMessagingService;
@ -82,7 +82,7 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
private Storage storage;
private InternalMessagingService messagingService = null;
private SyncTask.Buffer syncTaskBuffer;
private InheritanceHandler inheritanceHandler;
private InheritanceGraphFactory inheritanceGraphFactory;
private CalculatorFactory calculatorFactory;
private LuckPermsApiProvider apiProvider;
private EventDispatcher eventDispatcher;
@ -153,7 +153,7 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
// load internal managers
getLogger().info("Loading internal permission managers...");
this.inheritanceHandler = new InheritanceHandler(this);
this.inheritanceGraphFactory = new InheritanceGraphFactory(this);
// setup user/group/track manager
setupManagers();
@ -339,8 +339,8 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
}
@Override
public InheritanceHandler getInheritanceHandler() {
return this.inheritanceHandler;
public InheritanceGraphFactory getInheritanceGraphFactory() {
return this.inheritanceGraphFactory;
}
@Override

View File

@ -35,7 +35,7 @@ import me.lucko.luckperms.common.context.ContextManager;
import me.lucko.luckperms.common.dependencies.DependencyManager;
import me.lucko.luckperms.common.event.EventDispatcher;
import me.lucko.luckperms.common.extension.SimpleExtensionManager;
import me.lucko.luckperms.common.inheritance.InheritanceHandler;
import me.lucko.luckperms.common.inheritance.InheritanceGraphFactory;
import me.lucko.luckperms.common.locale.LocaleManager;
import me.lucko.luckperms.common.messaging.InternalMessagingService;
import me.lucko.luckperms.common.model.Group;
@ -195,7 +195,7 @@ public interface LuckPermsPlugin {
*
* @return the inheritance handler
*/
InheritanceHandler getInheritanceHandler();
InheritanceGraphFactory getInheritanceGraphFactory();
/**
* Gets the class responsible for constructing PermissionCalculators on this platform.

View File

@ -129,7 +129,7 @@ public abstract class PermissionHolderSubject<T extends PermissionHolder> implem
@Override
public ImmutableList<LPSubjectReference> getParents(ImmutableContextSet contexts) {
InheritanceGraph graph = this.plugin.getInheritanceHandler().getGraph(this.plugin.getContextManager().formQueryOptions(contexts));
InheritanceGraph graph = this.plugin.getInheritanceGraphFactory().getGraph(this.plugin.getContextManager().formQueryOptions(contexts));
Iterable<PermissionHolder> traversal = graph.traverse(TraversalAlgorithm.DEPTH_FIRST_PRE_ORDER, this.parent);
ImmutableList.Builder<LPSubjectReference> subjects = ImmutableList.builder();