Reduce the number of config lookups required when calculating contexts

This commit is contained in:
Luck
2018-05-12 01:51:38 +01:00
Unverified
parent a927ca659f
commit 1639879106
8 changed files with 53 additions and 69 deletions
@@ -27,7 +27,6 @@ package me.lucko.luckperms.sponge.contexts;
import me.lucko.luckperms.api.Contexts;
import me.lucko.luckperms.api.context.ImmutableContextSet;
import me.lucko.luckperms.common.config.ConfigKeys;
import me.lucko.luckperms.common.contexts.AbstractContextManager;
import me.lucko.luckperms.sponge.LPSpongePlugin;
@@ -40,14 +39,6 @@ public class SpongeContextManager extends AbstractContextManager<Subject> {
@Override
public Contexts formContexts(Subject subject, ImmutableContextSet contextSet) {
return Contexts.of(
contextSet,
this.plugin.getConfiguration().get(ConfigKeys.INCLUDING_GLOBAL_PERMS),
this.plugin.getConfiguration().get(ConfigKeys.INCLUDING_GLOBAL_WORLD_PERMS),
true,
this.plugin.getConfiguration().get(ConfigKeys.APPLYING_GLOBAL_GROUPS),
this.plugin.getConfiguration().get(ConfigKeys.APPLYING_GLOBAL_WORLD_GROUPS),
false
);
return formContexts(contextSet);
}
}