public interface BookMeta extends ItemMeta
限定符和类型 | 接口和说明 |
---|---|
static class |
BookMeta.Generation
Represents the generation (or level of copying) of a written book
|
限定符和类型 | 方法和说明 |
---|---|
void |
addPage(java.lang.String... pages)
在这本书的最后添加页面.最多50页,每页最多256个字符.
|
BookMeta |
clone() |
java.lang.String |
getAuthor()
获取这本书的作者.
|
BookMeta.Generation |
getGeneration()
Gets the generation of the book.
|
java.lang.String |
getPage(int page)
获取这本书指定页面的内容.给定的页面必须存在.
|
int |
getPageCount()
获取这本书有多少页.
|
java.util.List<java.lang.String> |
getPages()
获取这本书的全部页面.
|
java.lang.String |
getTitle()
获取这本书的标题.
|
boolean |
hasAuthor()
检测这本书是否存在作者.
|
boolean |
hasGeneration()
Checks for the existence of generation level in the book.
|
boolean |
hasPages()
检测这本书是否存在页面.
|
boolean |
hasTitle()
检测书是否存在标题.
|
void |
setAuthor(java.lang.String author)
设置这本书的作者.如果设置为null将移除作者.
|
void |
setGeneration(BookMeta.Generation generation)
Sets the generation of the book.
|
void |
setPage(int page,
java.lang.String data)
设置这本书指定页面的内容.书页必须是连续的.
|
void |
setPages(java.util.List<java.lang.String> pages)
清除存在的书页,并设置书提供的书页.最多50页,每页最多256个字符.
|
void |
setPages(java.lang.String... pages)
清除存在的书页,并设置书提供的书页.最多50页,每页最多256个字符.
|
boolean |
setTitle(java.lang.String title)
设置这本书的标题.
|
addEnchant, addItemFlags, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasConflictingEnchant, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeEnchant, removeItemFlags, setDisplayName, setLocalizedName, setLore, setUnbreakable
serialize
boolean hasTitle()
原文:Checks for the existence of a title in the book.
java.lang.String getTitle()
插件应该在调用这个方法之前检测hasTitle()是否返回true.
原文:Gets the title of the book.
Plugins should check that hasTitle() returns true before calling this method.
boolean setTitle(java.lang.String title)
仅限16个字符.如果设置为null将移除标题.
原文:Sets the title of the book.
Limited to 16 characters. Removes title when given null.
title
- 要设置的标题boolean hasAuthor()
原文:Checks for the existence of an author in the book.
java.lang.String getAuthor()
插件应该在调用这个方法之前检测hasAuthor()是否返回true.
原文:Gets the author of the book.
Plugins should check that hasAuthor() returns true before calling this method.
void setAuthor(java.lang.String author)
原文:Sets the author of the book. Removes author when given null.
author
- 这本书的作者boolean hasGeneration()
BookMeta.Generation getGeneration()
Plugins should check that hasGeneration() returns true before calling this method.
void setGeneration(BookMeta.Generation generation)
generation
- the generation to setboolean hasPages()
原文:Checks for the existence of pages in the book.
java.lang.String getPage(int page)
原文:Gets the specified page in the book. The given page must exist.
page
- 指定页码void setPage(int page, java.lang.String data)
数据的长度最大为256个字符,超出部分将被截断.
原文:Sets the specified page in the book. Pages of the book must be contiguous.
The data can be up to 256 characters in length, additional characters are truncated.
page
- 要设置的页码data
- 那个书页的内容java.util.List<java.lang.String> getPages()
原文:Gets all the pages in the book.
void setPages(java.util.List<java.lang.String> pages)
原文:Clears the existing book pages, and sets the book to use the provided pages. Maximum 50 pages with 256 characters per page.
pages
- 要设置的书页的内容的列表void setPages(java.lang.String... pages)
原文:Clears the existing book pages, and sets the book to use the provided pages. Maximum 50 pages with 256 characters per page.
pages
- 每页的内容的列表void addPage(java.lang.String... pages)
原文:Adds new pages to the end of the book. Up to a maximum of 50 pages with 256 characters per page.
pages
- 每页的内容的列表int getPageCount()
原文:Gets the number of pages in the book.