use of me.lucko.luckperms.common.model.Group in project LuckPerms by lucko.
the class VaultChatHook method getGroupMeta.
@Override
public String getGroupMeta(String world, String name, String key) {
Objects.requireNonNull(name, "name");
Objects.requireNonNull(key, "key");
Group group = getGroup(name);
if (group == null) {
return null;
}
Contexts contexts = this.permissionHook.contextForLookup(null, world);
MetaCache metaData = group.getCachedData().getMetaData(contexts);
String ret = metaData.getMeta().get(key);
if (log()) {
logMsg("#getGroupMeta: %s - %s - %s - %s", group.getName(), contexts.getContexts().toMultimap(), key, ret);
}
return ret;
}
use of me.lucko.luckperms.common.model.Group in project LuckPerms by lucko.
the class VaultChatHook method setGroupChatSuffix.
@Override
public void setGroupChatSuffix(String world, String name, String suffix) {
Objects.requireNonNull(name, "name");
Group group = getGroup(name);
if (group == null) {
return;
}
setChatMeta(group, ChatMetaType.SUFFIX, suffix, world);
}
use of me.lucko.luckperms.common.model.Group in project LuckPerms by lucko.
the class VaultChatHook method getGroupChatPrefix.
@Override
public String getGroupChatPrefix(String world, String name) {
Objects.requireNonNull(name, "name");
Group group = getGroup(name);
if (group == null) {
return null;
}
Contexts contexts = this.permissionHook.contextForLookup(null, world);
MetaCache metaData = group.getCachedData().getMetaData(contexts);
String ret = metaData.getPrefix();
if (log()) {
logMsg("#getGroupPrefix: %s - %s - %s", group.getName(), contexts.getContexts().toMultimap(), ret);
}
return Strings.nullToEmpty(ret);
}
use of me.lucko.luckperms.common.model.Group in project LuckPerms by lucko.
the class VaultPermissionHook method groupAddPermission.
@Override
public boolean groupAddPermission(String world, String name, String permission) {
Objects.requireNonNull(name, "name");
Objects.requireNonNull(permission, "permission");
Group group = getGroup(name);
if (group == null) {
return false;
}
holderAddPermission(group, permission, world);
return true;
}
use of me.lucko.luckperms.common.model.Group in project LuckPerms by lucko.
the class VaultPermissionHook method holderSave.
void holderSave(PermissionHolder holder) {
if (holder.getType().isUser()) {
User u = (User) holder;
this.plugin.getStorage().saveUser(u).thenRunAsync(() -> u.getRefreshBuffer().request(), this.plugin.getBootstrap().getScheduler().async());
}
if (holder.getType().isGroup()) {
Group g = (Group) holder;
this.plugin.getStorage().saveGroup(g).thenRunAsync(() -> this.plugin.getUpdateTaskBuffer().request(), this.plugin.getBootstrap().getScheduler().async());
}
}
Aggregations