Search in sources :

Example 1 with RegexProcessor

use of me.lucko.luckperms.common.processors.RegexProcessor in project LuckPerms by lucko.

the class SpongeCalculatorFactory method build.

@Override
public PermissionCalculator build(Contexts contexts, PermissionCalculatorMetadata metadata) {
    ImmutableList.Builder<PermissionProcessor> processors = ImmutableList.builder();
    processors.add(new MapProcessor());
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLY_SPONGE_IMPLICIT_WILDCARDS)) {
        processors.add(new SpongeWildcardProcessor());
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_REGEX)) {
        processors.add(new RegexProcessor());
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_WILDCARDS)) {
        processors.add(new WildcardProcessor());
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLY_SPONGE_DEFAULT_SUBJECTS)) {
        if (metadata.getHolderType().isUser()) {
            processors.add(new UserDefaultsProcessor(this.plugin.getService(), contexts.getContexts().makeImmutable()));
        } else if (metadata.getHolderType().isGroup()) {
            processors.add(new GroupDefaultsProcessor(this.plugin.getService(), contexts.getContexts().makeImmutable()));
        }
    }
    return registerCalculator(new PermissionCalculator(this.plugin, metadata, processors.build()));
}
Also used : UserDefaultsProcessor(me.lucko.luckperms.sponge.processors.UserDefaultsProcessor) RegexProcessor(me.lucko.luckperms.common.processors.RegexProcessor) ImmutableList(com.google.common.collect.ImmutableList) GroupDefaultsProcessor(me.lucko.luckperms.sponge.processors.GroupDefaultsProcessor) SpongeWildcardProcessor(me.lucko.luckperms.sponge.processors.SpongeWildcardProcessor) PermissionCalculator(me.lucko.luckperms.common.calculators.PermissionCalculator) PermissionProcessor(me.lucko.luckperms.common.processors.PermissionProcessor) SpongeWildcardProcessor(me.lucko.luckperms.sponge.processors.SpongeWildcardProcessor) WildcardProcessor(me.lucko.luckperms.common.processors.WildcardProcessor) MapProcessor(me.lucko.luckperms.common.processors.MapProcessor)

Example 2 with RegexProcessor

use of me.lucko.luckperms.common.processors.RegexProcessor in project LuckPerms by lucko.

the class NukkitCalculatorFactory method build.

@Override
public PermissionCalculator build(Contexts contexts, PermissionCalculatorMetadata metadata) {
    ImmutableList.Builder<PermissionProcessor> processors = ImmutableList.builder();
    processors.add(new MapProcessor());
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLY_NUKKIT_CHILD_PERMISSIONS)) {
        processors.add(new ChildProcessor(this.plugin));
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_REGEX)) {
        processors.add(new RegexProcessor());
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_WILDCARDS)) {
        processors.add(new WildcardProcessor());
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLY_NUKKIT_DEFAULT_PERMISSIONS) && metadata.getHolderType() == HolderType.USER) {
        processors.add(new DefaultsProcessor(this.plugin, contexts.hasSetting(LookupSetting.IS_OP)));
    }
    return registerCalculator(new PermissionCalculator(this.plugin, metadata, processors.build()));
}
Also used : RegexProcessor(me.lucko.luckperms.common.processors.RegexProcessor) DefaultsProcessor(me.lucko.luckperms.nukkit.processors.DefaultsProcessor) ImmutableList(com.google.common.collect.ImmutableList) ChildProcessor(me.lucko.luckperms.nukkit.processors.ChildProcessor) PermissionCalculator(me.lucko.luckperms.common.calculators.PermissionCalculator) PermissionProcessor(me.lucko.luckperms.common.processors.PermissionProcessor) WildcardProcessor(me.lucko.luckperms.common.processors.WildcardProcessor) MapProcessor(me.lucko.luckperms.common.processors.MapProcessor)

Example 3 with RegexProcessor

use of me.lucko.luckperms.common.processors.RegexProcessor in project LuckPerms by lucko.

the class BukkitCalculatorFactory method build.

@Override
public PermissionCalculator build(Contexts contexts, PermissionCalculatorMetadata metadata) {
    ImmutableList.Builder<PermissionProcessor> processors = ImmutableList.builder();
    processors.add(new MapProcessor());
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLY_BUKKIT_CHILD_PERMISSIONS)) {
        processors.add(new ChildProcessor(this.plugin));
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_REGEX)) {
        processors.add(new RegexProcessor());
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_WILDCARDS)) {
        processors.add(new WildcardProcessor());
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLY_BUKKIT_DEFAULT_PERMISSIONS) && metadata.getHolderType() == HolderType.USER) {
        processors.add(new DefaultsProcessor(this.plugin, contexts.hasSetting(LookupSetting.IS_OP)));
    }
    return registerCalculator(new PermissionCalculator(this.plugin, metadata, processors.build()));
}
Also used : RegexProcessor(me.lucko.luckperms.common.processors.RegexProcessor) DefaultsProcessor(me.lucko.luckperms.bukkit.processors.DefaultsProcessor) ImmutableList(com.google.common.collect.ImmutableList) ChildProcessor(me.lucko.luckperms.bukkit.processors.ChildProcessor) PermissionCalculator(me.lucko.luckperms.common.calculators.PermissionCalculator) PermissionProcessor(me.lucko.luckperms.common.processors.PermissionProcessor) WildcardProcessor(me.lucko.luckperms.common.processors.WildcardProcessor) MapProcessor(me.lucko.luckperms.common.processors.MapProcessor)

Example 4 with RegexProcessor

use of me.lucko.luckperms.common.processors.RegexProcessor in project LuckPerms by lucko.

the class BungeeCalculatorFactory method build.

@Override
public PermissionCalculator build(Contexts contexts, PermissionCalculatorMetadata metadata) {
    ImmutableList.Builder<PermissionProcessor> processors = ImmutableList.builder();
    processors.add(new MapProcessor());
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_REGEX)) {
        processors.add(new RegexProcessor());
    }
    if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_WILDCARDS)) {
        processors.add(new WildcardProcessor());
    }
    return registerCalculator(new PermissionCalculator(this.plugin, metadata, processors.build()));
}
Also used : RegexProcessor(me.lucko.luckperms.common.processors.RegexProcessor) ImmutableList(com.google.common.collect.ImmutableList) PermissionCalculator(me.lucko.luckperms.common.calculators.PermissionCalculator) PermissionProcessor(me.lucko.luckperms.common.processors.PermissionProcessor) WildcardProcessor(me.lucko.luckperms.common.processors.WildcardProcessor) MapProcessor(me.lucko.luckperms.common.processors.MapProcessor)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)4 PermissionCalculator (me.lucko.luckperms.common.calculators.PermissionCalculator)4 MapProcessor (me.lucko.luckperms.common.processors.MapProcessor)4 PermissionProcessor (me.lucko.luckperms.common.processors.PermissionProcessor)4 RegexProcessor (me.lucko.luckperms.common.processors.RegexProcessor)4 WildcardProcessor (me.lucko.luckperms.common.processors.WildcardProcessor)4 ChildProcessor (me.lucko.luckperms.bukkit.processors.ChildProcessor)1 DefaultsProcessor (me.lucko.luckperms.bukkit.processors.DefaultsProcessor)1 ChildProcessor (me.lucko.luckperms.nukkit.processors.ChildProcessor)1 DefaultsProcessor (me.lucko.luckperms.nukkit.processors.DefaultsProcessor)1 GroupDefaultsProcessor (me.lucko.luckperms.sponge.processors.GroupDefaultsProcessor)1 SpongeWildcardProcessor (me.lucko.luckperms.sponge.processors.SpongeWildcardProcessor)1 UserDefaultsProcessor (me.lucko.luckperms.sponge.processors.UserDefaultsProcessor)1