Fix group info command

This commit is contained in:
Luck 2020-05-19 09:55:00 +01:00
parent bfebe6a5d0
commit 637cb0d836
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -43,7 +43,6 @@ import me.lucko.luckperms.common.util.DurationFormatter;
import me.lucko.luckperms.common.util.Predicates;
import me.lucko.luckperms.common.verbose.event.MetaCheckEvent;
import net.luckperms.api.context.ContextSet;
import net.luckperms.api.node.Node;
import net.luckperms.api.node.types.InheritanceNode;
import net.luckperms.api.query.QueryOptions;
@ -97,18 +96,10 @@ public class GroupInfo extends ChildCommand<Group> {
QueryOptions queryOptions = plugin.getContextManager().getStaticQueryOptions();
String context = "&bNone";
String prefix = "&bNone";
String suffix = "&bNone";
String meta = "&bNone";
ContextSet contextSet = queryOptions.context();
if (!contextSet.isEmpty()) {
context = contextSet.toSet().stream()
.map(e -> MessageUtils.contextToString(plugin.getLocaleManager(), e.getKey(), e.getValue()))
.collect(Collectors.joining(" "));
}
MetaCache data = group.getCachedData().getMetaData(queryOptions);
String prefixValue = data.getPrefix(MetaCheckEvent.Origin.INTERNAL);
if (prefixValue != null) {
@ -127,7 +118,7 @@ public class GroupInfo extends ChildCommand<Group> {
.collect(Collectors.joining(" "));
}
Message.GROUP_INFO_CONTEXTUAL_DATA.send(sender, context, prefix, suffix, meta);
Message.GROUP_INFO_CONTEXTUAL_DATA.send(sender, prefix, suffix, meta);
return CommandResult.SUCCESS;
}
}