Implement accumulation of static contexts from a file
This commit is contained in:
@@ -29,8 +29,6 @@ import me.lucko.luckperms.api.context.MutableContextSet;
|
||||
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class BackendServerCalculator implements ContextCalculator<ProxiedPlayer> {
|
||||
private static final String WORLD_KEY = "world";
|
||||
|
||||
@@ -48,14 +46,4 @@ public class BackendServerCalculator implements ContextCalculator<ProxiedPlayer>
|
||||
|
||||
return accumulator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isContextApplicable(ProxiedPlayer subject, Map.Entry<String, String> context) {
|
||||
if (!context.getKey().equals(WORLD_KEY)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String server = getServer(subject);
|
||||
return server != null && server.equals(context.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ import me.lucko.luckperms.common.commands.sender.Sender;
|
||||
import me.lucko.luckperms.common.config.ConfigKeys;
|
||||
import me.lucko.luckperms.common.config.LuckPermsConfiguration;
|
||||
import me.lucko.luckperms.common.contexts.ContextManager;
|
||||
import me.lucko.luckperms.common.contexts.ServerCalculator;
|
||||
import me.lucko.luckperms.common.contexts.StaticCalculator;
|
||||
import me.lucko.luckperms.common.core.UuidCache;
|
||||
import me.lucko.luckperms.common.core.model.User;
|
||||
import me.lucko.luckperms.common.dependencies.Dependency;
|
||||
@@ -217,7 +217,7 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin {
|
||||
contextManager = new ContextManager<>();
|
||||
BackendServerCalculator serverCalculator = new BackendServerCalculator();
|
||||
contextManager.registerCalculator(serverCalculator);
|
||||
contextManager.registerCalculator(new ServerCalculator<>(configuration));
|
||||
contextManager.registerCalculator(new StaticCalculator<>(configuration));
|
||||
|
||||
// register with the LP API
|
||||
getLog().info("Registering API...");
|
||||
|
||||
Reference in New Issue
Block a user