Search in sources :

Example 1 with PaginationList

use of org.spongepowered.api.service.pagination.PaginationList in project modules-extra by CubeEngine.

the class ManagementCommands method showHelp.

@Command(name = "help", desc = "Prints out all the custom chat commands.")
public void showHelp(CommandSource context) {
    List<Text> list = config.commands.entrySet().stream().map(e -> Text.of("!", e.getKey(), " -> ", e.getValue())).collect(Collectors.toList());
    PaginationList pages = PaginationList.builder().contents(list).build();
    pages.sendTo(context);
}
Also used : I18n(org.cubeengine.libcube.service.i18n.I18n) CommandSource(org.spongepowered.api.command.CommandSource) INFINITE(org.cubeengine.butler.parameter.Parameter.INFINITE) ContainerCommand(org.cubeengine.libcube.service.command.ContainerCommand) POSITIVE(org.cubeengine.libcube.service.i18n.formatter.MessageType.POSITIVE) Collectors(java.util.stream.Collectors) Greed(org.cubeengine.butler.parametric.Greed) Complete(org.cubeengine.butler.parametric.Complete) PaginationList(org.spongepowered.api.service.pagination.PaginationList) Command(org.cubeengine.butler.parametric.Command) List(java.util.List) CommandManager(org.cubeengine.libcube.service.command.CommandManager) Text(org.spongepowered.api.text.Text) NEGATIVE(org.cubeengine.libcube.service.i18n.formatter.MessageType.NEGATIVE) ENGLISH(java.util.Locale.ENGLISH) Flag(org.cubeengine.butler.parametric.Flag) PaginationList(org.spongepowered.api.service.pagination.PaginationList) Text(org.spongepowered.api.text.Text) ContainerCommand(org.cubeengine.libcube.service.command.ContainerCommand) Command(org.cubeengine.butler.parametric.Command)

Aggregations

List (java.util.List)1 ENGLISH (java.util.Locale.ENGLISH)1 Collectors (java.util.stream.Collectors)1 INFINITE (org.cubeengine.butler.parameter.Parameter.INFINITE)1 Command (org.cubeengine.butler.parametric.Command)1 Complete (org.cubeengine.butler.parametric.Complete)1 Flag (org.cubeengine.butler.parametric.Flag)1 Greed (org.cubeengine.butler.parametric.Greed)1 CommandManager (org.cubeengine.libcube.service.command.CommandManager)1 ContainerCommand (org.cubeengine.libcube.service.command.ContainerCommand)1 I18n (org.cubeengine.libcube.service.i18n.I18n)1 NEGATIVE (org.cubeengine.libcube.service.i18n.formatter.MessageType.NEGATIVE)1 POSITIVE (org.cubeengine.libcube.service.i18n.formatter.MessageType.POSITIVE)1 CommandSource (org.spongepowered.api.command.CommandSource)1 PaginationList (org.spongepowered.api.service.pagination.PaginationList)1 Text (org.spongepowered.api.text.Text)1