Interface Book

All Superinterfaces:
BookLike, Buildable<Book.Builder>

public sealed interface Book extends Buildable<Book.Builder>, BookLike
Represents the in-game interface of a book.

Components exceeding the text limit for a page will be truncated client-side and not moved automatically to the next page.

Since:
4.0.0
See Also:
  • Method Details

    • book

      static Book book(Component title, Component author, Collection<Component> pages)
      Creates a book.
      Parameters:
      title - the title
      author - the author
      pages - the collection of pages
      Returns:
      a book
      Since:
      4.0.0
    • book

      static Book book(Component title, Component author, Component... pages)
      Creates a book.
      Parameters:
      title - the title
      author - the author
      pages - an array of pages
      Returns:
      a book
      Since:
      4.0.0
    • book

      static Book book(Collection<Component> pages)
      Creates a book with title and author set to Component.empty().
      Parameters:
      pages - the collection of pages
      Returns:
      a book
      Since:
      5.1.0
    • book

      static Book book(Component... pages)
      Creates a book with title and author set to Component.empty().
      Parameters:
      pages - an array of pages
      Returns:
      a book
      Since:
      5.1.0
    • builder

      static Book.Builder builder()
      Create a new builder that will create a Book.
      Returns:
      a builder
      Since:
      4.0.0
    • title

      Component title()
      Gets the title.
      Returns:
      the title
      Since:
      4.0.0
    • title

      @Contract(value="_ -> new", pure=true) Book title(Component title)
      Changes the book's title.
      Parameters:
      title - the title
      Returns:
      a new book with modifications
      Since:
      4.0.0
    • author

      Component author()
      Gets the author.
      Returns:
      the author
      Since:
      4.0.0
    • author

      @Contract(value="_ -> new", pure=true) Book author(Component author)
      Changes the book's author.
      Parameters:
      author - the author
      Returns:
      a new book with modifications
      Since:
      4.0.0
    • pages

      @Unmodifiable List<Component> pages()
      Gets the list of pages.

      The returned collection will be unmodifiable.

      Returns:
      the list of pages
      Since:
      4.0.0
    • pages

      @Contract(value="_ -> new", pure=true) default Book pages(Component... pages)
      Returns an updated book with the provided pages.
      Parameters:
      pages - the pages to set
      Returns:
      a new book with modifications
      Since:
      4.0.0
    • pages

      @Contract(value="_ -> new", pure=true) Book pages(List<Component> pages)
      Returns an updated book with the provided pages.
      Parameters:
      pages - the pages to set
      Returns:
      a new book with modifications
      Since:
      4.0.0