mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-08 20:09:59 +01:00
Include loaded extensions in the info command (#1849)
This commit is contained in:
parent
86a15b9a66
commit
9cf21e2927
@ -39,7 +39,9 @@ import me.lucko.luckperms.common.util.DurationFormatter;
|
||||
import me.lucko.luckperms.common.util.Predicates;
|
||||
|
||||
import net.luckperms.api.context.ImmutableContextSet;
|
||||
import net.luckperms.api.extension.Extension;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -64,6 +66,14 @@ public class InfoCommand extends SingleCommand {
|
||||
Message.INFO_STORAGE_META.send(sender, e.getKey(), formatValue(e.getValue()));
|
||||
}
|
||||
|
||||
Collection<Extension> loadedExtensions = plugin.getExtensionManager().getLoadedExtensions();
|
||||
if (!loadedExtensions.isEmpty()) {
|
||||
Message.INFO_EXTENSIONS.send(sender);
|
||||
for (Extension extension : loadedExtensions) {
|
||||
Message.INFO_EXTENSION_ENTRY.send(sender, extension.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
ImmutableContextSet staticContext = plugin.getContextManager().getStaticContext();
|
||||
Message.INFO_MIDDLE.send(sender,
|
||||
plugin.getMessagingService().map(InternalMessagingService::getName).orElse("None"),
|
||||
|
@ -217,6 +217,9 @@ public enum Message {
|
||||
|
||||
INFO_STORAGE_META("&f- &3{}: {}", true),
|
||||
|
||||
INFO_EXTENSIONS("{PREFIX}&f- &bExtensions:", true),
|
||||
INFO_EXTENSION_ENTRY("&f- &3{}", true),
|
||||
|
||||
INFO_MIDDLE(
|
||||
"{PREFIX}&f- &bMessaging: &f{}" + "\n" +
|
||||
"{PREFIX}&f- &bInstance:" + "\n" +
|
||||
|
Loading…
Reference in New Issue
Block a user