Package net.kyori.adventure.inventory
Interface Book
- All Superinterfaces:
Buildable<Book,
,Book.Builder> net.kyori.examination.Examinable
@NonExtendable
public interface Book
extends Buildable<Book,Book.Builder>, net.kyori.examination.Examinable
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:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Component
author()
Gets the author.@NotNull Book
Changes the book's author.static @NotNull Book
book
(@NotNull Component title, @NotNull Component author, @NotNull Collection<Component> pages) Creates a book.static @NotNull Book
Creates a book.static @NotNull Book.Builder
builder()
Create a new builder that will create aBook
.pages()
Gets the list of pages.@NotNull Book
Returns an updated book with the provided pages.default @NotNull Book
Returns an updated book with the provided pages.@NotNull Component
title()
Gets the title.@NotNull Book
Changes the book's title.default @NotNull Book.Builder
Create a new builder initialized with the attributes of this book.Methods inherited from interface net.kyori.examination.Examinable
examinableName, examinableProperties, examine
-
Method Details
-
book
@NotNull static @NotNull Book book(@NotNull @NotNull Component title, @NotNull @NotNull Component author, @NotNull @NotNull Collection<Component> pages) Creates a book.- Parameters:
title
- the titleauthor
- the authorpages
- the collection of pages- Returns:
- a book
- Since:
- 4.0.0
-
book
@NotNull static @NotNull Book book(@NotNull @NotNull Component title, @NotNull @NotNull Component author, @NotNull @NotNull Component @NotNull ... pages) Creates a book.- Parameters:
title
- the titleauthor
- the authorpages
- an array of pages- Returns:
- a book
- Since:
- 4.0.0
-
builder
Create a new builder that will create aBook
.- Returns:
- a builder
- Since:
- 4.0.0
-
title
Gets the title.- Returns:
- the title
- Since:
- 4.0.0
-
title
@Contract(value="_ -> new", pure=true) @NotNull @NotNull Book title(@NotNull @NotNull Component title) Changes the book's title.- Parameters:
title
- the title- Returns:
- a new book with modifications
- Since:
- 4.0.0
-
author
Gets the author.- Returns:
- the author
- Since:
- 4.0.0
-
author
@Contract(value="_ -> new", pure=true) @NotNull @NotNull Book author(@NotNull @NotNull Component author) Changes the book's author.- Parameters:
author
- the author- Returns:
- a new book with modifications
- Since:
- 4.0.0
-
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) @NotNull default @NotNull Book pages(@NotNull @NotNull Component @NotNull ... 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) @NotNull @NotNull Book pages(@NotNull @NotNull 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
-
toBuilder
Create a new builder initialized with the attributes of this book.- Specified by:
toBuilder
in interfaceBuildable<Book,
Book.Builder> - Returns:
- the builder
-