use of me.lucko.luckperms.common.cacheddata.type.MonitoredMetaCache in project LuckPerms by lucko.
the class LuckPermsVaultChat method getUserMeta.
@Override
public String getUserMeta(String world, UUID uuid, String key) {
Objects.requireNonNull(uuid, "uuid");
Objects.requireNonNull(key, "key");
PermissionHolder user = this.vaultPermission.lookupUser(uuid);
QueryOptions queryOptions = this.vaultPermission.getQueryOptions(uuid, world);
MonitoredMetaCache metaData = user.getCachedData().getMetaData(queryOptions);
return metaData.getMetaValue(key, CheckOrigin.THIRD_PARTY_API).result();
}
use of me.lucko.luckperms.common.cacheddata.type.MonitoredMetaCache in project LuckPerms by lucko.
the class LuckPermsVaultChat method getGroupMeta.
@Override
public String getGroupMeta(String world, String name, String key) {
Objects.requireNonNull(name, "name");
Objects.requireNonNull(key, "key");
MonitoredMetaCache metaData = getGroupMetaCache(name, world);
if (metaData == null) {
return null;
}
return metaData.getMetaValue(key, CheckOrigin.THIRD_PARTY_API).result();
}
use of me.lucko.luckperms.common.cacheddata.type.MonitoredMetaCache in project LuckPerms by lucko.
the class AbstractCachedDataManager method calculateMeta.
private MonitoredMetaCache calculateMeta(QueryOptions queryOptions) {
Objects.requireNonNull(queryOptions, "queryOptions");
CacheMetadata metadata = getMetadataForQueryOptions(queryOptions);
MetaAccumulator accumulator = newAccumulator(queryOptions);
resolveMeta(accumulator, queryOptions);
return new MonitoredMetaCache(this.plugin, queryOptions, metadata, accumulator);
}
use of me.lucko.luckperms.common.cacheddata.type.MonitoredMetaCache in project LuckPerms by lucko.
the class LuckPermsVaultPermission method userGetPrimaryGroup.
@Override
public String userGetPrimaryGroup(String world, UUID uuid) {
Objects.requireNonNull(uuid, "uuid");
PermissionHolder user = lookupUser(uuid);
if (user instanceof Group) {
// npc
return this.plugin.getConfiguration().get(ConfigKeys.VAULT_NPC_GROUP);
}
QueryOptions queryOptions = getQueryOptions(uuid, world);
MonitoredMetaCache metaData = user.getCachedData().getMetaData(queryOptions);
String value = metaData.getPrimaryGroup(CheckOrigin.THIRD_PARTY_API);
if (value == null) {
return null;
}
Group group = getGroup(value);
return group != null ? groupName(group) : value;
}
use of me.lucko.luckperms.common.cacheddata.type.MonitoredMetaCache in project LuckPerms by lucko.
the class LuckPermsVaultChat method getGroupChatSuffix.
@Override
public String getGroupChatSuffix(String world, String name) {
Objects.requireNonNull(name, "name");
MonitoredMetaCache metaData = getGroupMetaCache(name, world);
if (metaData == null) {
return null;
}
return Strings.nullToEmpty(metaData.getSuffix(CheckOrigin.THIRD_PARTY_API).result());
}
Aggregations