Class CommandPaging

java.lang.Object
com.kamikazejam.kamicommon.command.util.CommandPaging

public class CommandPaging extends Object
  • Field Details

  • Constructor Details

    • CommandPaging

      public CommandPaging()
  • Method Details

    • titleizedPageTitle

      @NotNull public static @NotNull KMessageSingle titleizedPageTitle(@NotNull @NotNull KamiCommand command, @NotNull @NotNull String title, int pageNum, int pageCount)
      Creates a full titleized page message for a command.
      Parameters:
      command - The command to which this page belongs, used for generating the page flip commands.
      title - The unformatted title, which will be titleized.
      pageNum - The current page number, 1-based (e.g. 1 for the first page).
      pageCount - The total number of pages.
    • getPage

      @NotNull public static @NotNull List<KMessage> getPage(@NotNull @NotNull KamiCommand command, @NotNull @NotNull List<KMessageSingle> lines, int pageNum, @NotNull @NotNull String title)
      Creates a 'page' (list of message lines) linked to the provided command.
      Uses the command context's sender to determine the page height.
      Parameters:
      command - The command to which this page belongs, used for generating the page flip commands.
      lines - The lines of 'content' to paginate. This should be ALL the lines you want to show, not just the ones for this page.
      pageNum - The page number, 1-based (e.g. 1 for the first page).
      title - The unformatted title, which will be titleized.
      Returns:
      The ordered list of KMessage objects, for sending to any Player or CommandSender.
    • getPage

      @NotNull public static @NotNull List<KMessage> getPage(@NotNull @NotNull KamiCommand command, @NotNull @NotNull List<KMessageSingle> lines, int pageNum, @NotNull @NotNull String title, int pageheight)
      Creates a 'page' (list of message lines) linked to the provided command.
      Parameters:
      command - The command to which this page belongs, used for generating the page flip commands.
      lines - The lines of 'content' to paginate. This should be ALL the lines you want to show, not just the ones for this page.
      pageNum - The page number, 1-based (e.g. 1 for the first page).
      title - The unformatted title, which will be titleized.
      pageheight - The height of an individual page, in lines.
      Returns:
      The ordered list of KMessage objects, for sending to any Player or CommandSender.