use of me.lucko.luckperms.common.cacheddata.type.MetaCache in project LuckPerms by lucko.
the class LuckPermsVaultChat method getUserChatPrefix.
@Override
public String getUserChatPrefix(String world, UUID uuid) {
Objects.requireNonNull(uuid, "uuid");
PermissionHolder user = this.vaultPermission.lookupUser(uuid);
QueryOptions queryOptions = this.vaultPermission.getQueryOptions(uuid, world);
MetaCache metaData = user.getCachedData().getMetaData(queryOptions);
return Strings.nullToEmpty(metaData.getPrefix(CheckOrigin.THIRD_PARTY_API).result());
}
use of me.lucko.luckperms.common.cacheddata.type.MetaCache in project LuckPerms by lucko.
the class PermissionHolderSubject method getOption.
@Override
public Optional<String> getOption(ImmutableContextSet contexts, String s) {
MetaCache data = this.parent.getCachedData().getMetaData(this.plugin.getContextManager().formQueryOptions(contexts));
if (s.equalsIgnoreCase(Prefix.NODE_KEY)) {
String prefix = data.getPrefix(CheckOrigin.PLATFORM_API).result();
if (prefix != null) {
return Optional.of(prefix);
}
}
if (s.equalsIgnoreCase(Suffix.NODE_KEY)) {
String suffix = data.getSuffix(CheckOrigin.PLATFORM_API).result();
if (suffix != null) {
return Optional.of(suffix);
}
}
String val = data.getMetaValue(s, CheckOrigin.PLATFORM_API).result();
if (val != null) {
return Optional.of(val);
}
Optional<String> v = getParentCollection().getDefaults().getOption(contexts, s);
if (v.isPresent()) {
return v;
}
return this.plugin.getService().getRootDefaults().getOption(contexts, s);
}
use of me.lucko.luckperms.common.cacheddata.type.MetaCache in project LuckPerms by lucko.
the class LuckPermsVaultChat method getUserChatSuffix.
@Override
public String getUserChatSuffix(String world, UUID uuid) {
Objects.requireNonNull(uuid, "uuid");
PermissionHolder user = this.vaultPermission.lookupUser(uuid);
QueryOptions queryOptions = this.vaultPermission.getQueryOptions(uuid, world);
MetaCache metaData = user.getCachedData().getMetaData(queryOptions);
return Strings.nullToEmpty(metaData.getSuffix(CheckOrigin.THIRD_PARTY_API).result());
}
Aggregations