public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book
Material.WRITABLE_BOOK
or Material.WRITTEN_BOOK
) that can have a title, an author, and pages.Modifier and Type | Interface and Description |
---|---|
static interface |
BookMeta.BookMetaBuilder |
static class |
BookMeta.Generation
Represents the generation (or level of copying) of a written book
|
static class |
BookMeta.Spigot |
Modifier and Type | Method and Description |
---|---|
void |
addPage(String... pages)
Deprecated.
in favour of
addPages(net.kyori.adventure.text.Component...) |
void |
addPages(net.kyori.adventure.text.Component... pages)
Adds new pages to the end of the book.
|
net.kyori.adventure.text.Component |
author()
Gets the author of the book.
|
@NotNull BookMeta |
author(net.kyori.adventure.text.Component author)
Sets the author of the book.
|
@NotNull BookMeta |
clone() |
@Nullable String |
getAuthor()
Gets the author of the book.
|
@Nullable BookMeta.Generation |
getGeneration()
Gets the generation of the book.
|
@NotNull String |
getPage(int page)
Deprecated.
in favour of
page(int) |
int |
getPageCount()
Gets the number of pages in the book.
|
@NotNull List<String> |
getPages()
Deprecated.
in favour of
Book.pages() |
@Nullable String |
getTitle()
Gets the title of the book.
|
boolean |
hasAuthor()
Checks for the existence of an author in the book.
|
boolean |
hasGeneration()
Checks for the existence of generation level in the book.
|
boolean |
hasPages()
Checks for the existence of pages in the book.
|
boolean |
hasTitle()
Checks for the existence of a title in the book.
|
net.kyori.adventure.text.Component |
page(int page)
Gets the specified page in the book.
|
void |
page(int page,
net.kyori.adventure.text.Component data)
Sets the specified page in the book.
|
void |
setAuthor(@Nullable String author)
Sets the author of the book.
|
void |
setGeneration(@Nullable BookMeta.Generation generation)
Sets the generation of the book.
|
void |
setPage(int page,
@NotNull String data)
Deprecated.
in favour of
page(int, net.kyori.adventure.text.Component) |
void |
setPages(@NotNull List<String> pages)
Deprecated.
in favour of
Book.pages(List) |
void |
setPages(String... pages)
Deprecated.
in favour of
Book.pages(net.kyori.adventure.text.Component...) |
boolean |
setTitle(@Nullable String title)
Sets the title of the book.
|
@NotNull BookMeta.Spigot |
spigot() |
net.kyori.adventure.text.Component |
title()
Gets the title of the book.
|
@NotNull BookMeta |
title(net.kyori.adventure.text.Component title)
Sets the title of the book.
|
@NonNull BookMeta.BookMetaBuilder |
toBuilder() |
addAttributeModifier, addEnchant, addItemFlags, displayName, displayName, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCanDestroy, getCanPlaceOn, getCustomModelData, getCustomTagContainer, getDestroyableKeys, getDisplayName, getDisplayNameComponent, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, getLoreComponents, getPlaceableKeys, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDestroyableKeys, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, hasPlaceableKeys, isUnbreakable, lore, lore, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCanDestroy, setCanPlaceOn, setCustomModelData, setDestroyableKeys, setDisplayName, setDisplayNameComponent, setLocalizedName, setLore, setLoreComponents, setPlaceableKeys, setUnbreakable, setVersion
serialize
getPersistentDataContainer
boolean hasTitle()
@Nullable @Nullable String getTitle()
Plugins should check that hasTitle() returns true before calling this method.
boolean setTitle(@Nullable @Nullable String title)
Limited to 32 characters. Removes title when given null.
title
- the title to setboolean hasAuthor()
@Nullable @Nullable String getAuthor()
Plugins should check that hasAuthor() returns true before calling this method.
void setAuthor(@Nullable @Nullable String author)
author
- the author to setboolean hasGeneration()
@Nullable @Nullable BookMeta.Generation getGeneration()
Plugins should check that hasGeneration() returns true before calling this method.
void setGeneration(@Nullable @Nullable BookMeta.Generation generation)
generation
- the generation to setboolean hasPages()
@Nullable net.kyori.adventure.text.Component title()
Plugins should check that hasTitle() returns true before calling this method.
title
in interface net.kyori.adventure.inventory.Book
@NotNull @NotNull BookMeta title(@Nullable net.kyori.adventure.text.Component title)
Limited to 32 characters. Removes title when given null.
title
in interface net.kyori.adventure.inventory.Book
title
- the title to set@Nullable net.kyori.adventure.text.Component author()
Plugins should check that hasAuthor() returns true before calling this method.
author
in interface net.kyori.adventure.inventory.Book
@NotNull @NotNull BookMeta author(@Nullable net.kyori.adventure.text.Component author)
author
in interface net.kyori.adventure.inventory.Book
author
- the author to set@NotNull net.kyori.adventure.text.Component page(int page)
Pages are 1-indexed.
page
- the page number to get, in range [1, getPageCount()]void page(int page, @NotNull net.kyori.adventure.text.Component data)
The data can be up to 256 characters in length, additional characters are truncated.
Pages are 1-indexed.
page
- the page number to set, in range [1, getPageCount()]data
- the data to set for that pagevoid addPages(@NotNull net.kyori.adventure.text.Component... pages)
pages
- A list of strings, each being a page@NonNull BookMeta.BookMetaBuilder toBuilder()
toBuilder
in interface net.kyori.adventure.inventory.Book
toBuilder
in interface net.kyori.adventure.util.Buildable<net.kyori.adventure.inventory.Book,net.kyori.adventure.inventory.Book.Builder>
@NotNull @Deprecated @NotNull String getPage(int page)
page(int)
Pages are 1-indexed.
page
- the page number to get, in range [1, getPageCount()]@Deprecated void setPage(int page, @NotNull @NotNull String data)
page(int, net.kyori.adventure.text.Component)
The data can be up to 256 characters in length, additional characters are truncated.
Pages are 1-indexed.
page
- the page number to set, in range [1, getPageCount()]data
- the data to set for that page@NotNull @Deprecated @NotNull List<String> getPages()
Book.pages()
@Deprecated void setPages(@NotNull @NotNull List<String> pages)
Book.pages(List)
pages
- A list of pages to set the book to use@Deprecated void setPages(@NotNull String... pages)
Book.pages(net.kyori.adventure.text.Component...)
pages
- A list of strings, each being a page@Deprecated void addPage(@NotNull String... pages)
addPages(net.kyori.adventure.text.Component...)
pages
- A list of strings, each being a pageint getPageCount()
@NotNull @NotNull BookMeta.Spigot spigot()
Copyright © 2021. All rights reserved.