接口 BookMeta
Material.WRITABLE_BOOK
或者成书
),可以有标题,作者,页面.-
嵌套类概要
-
方法概要
修饰符和类型方法说明void
在这本书的最后添加页面.最多50页,每页最多256个字符.clone()
获取这本书的作者.获取本书的代次.getPage
(int page) 获取这本书指定页面的内容.给定的页面必须存在.int
获取这本书有多少页.getPages()
获取这本书的全部页面.getTitle()
获取这本书的标题.boolean
检测这本书是否存在作者.boolean
检测本书是否存在代次级别.boolean
hasPages()
检测这本书是否存在页面.boolean
hasTitle()
检测书是否存在标题.void
设置这本书的作者.如果设置为null将移除作者.void
setGeneration
(@Nullable BookMeta.Generation generation) 设置本书的代次.void
设置这本书指定页面的内容.书页必须是连续的.void
清除存在的书页,并设置书提供的书页.最多50页,每页最多256个字符.void
清除存在的书页,并设置书提供的书页.最多100页,每页最多256个字符.boolean
设置这本书的标题.spigot()
从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
从接口继承的方法 org.bukkit.inventory.meta.ItemMeta
addAttributeModifier, addEnchant, addItemFlags, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setLocalizedName, setLore, setUnbreakable, setVersion
从接口继承的方法 org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
方法详细资料
-
hasTitle
boolean hasTitle()检测书是否存在标题.原文:Checks for the existence of a title in the book.
- 返回:
- 这本书是否有标题
-
getTitle
获取这本书的标题.插件应该在调用这个方法之前检测hasTitle()是否返回true.
原文:Gets the title of the book.
Plugins should check that hasTitle() returns true before calling this method.
- 返回:
- 这本书的标题
-
setTitle
设置这本书的标题.仅限32个字符.如果设置为null将移除标题.
原文:Sets the title of the book.
Limited to 32 characters. Removes title when given null.
- 参数:
title
- 要设置的标题- 返回:
- 如果成功设置标题则为true
-
hasAuthor
boolean hasAuthor()检测这本书是否存在作者.原文:Checks for the existence of an author in the book.
- 返回:
- 这本书是否有作者
-
getAuthor
获取这本书的作者.插件应该在调用这个方法之前检测hasAuthor()是否返回true.
原文:Gets the author of the book.
Plugins should check that hasAuthor() returns true before calling this method.
- 返回:
- 这本书的作者
-
setAuthor
设置这本书的作者.如果设置为null将移除作者.原文:Sets the author of the book. Removes author when given null.
- 参数:
author
- 这本书的作者
-
hasGeneration
boolean hasGeneration()检测本书是否存在代次级别.原文: Checks for the existence of generation level in the book.
- 返回:
- 本书是否存在代次级别
-
getGeneration
获取本书的代次. 插件应该在调用这个方法之前检测 hasGeneration() 是否返回true
.原文: Gets the generation of the book.
Plugins should check that hasGeneration() returns true before calling this method.
- 返回:
- 本书的代次
-
setGeneration
设置本书的代次. 当参数为 null 时移除代次.原文: Sets the generation of the book. Removes generation when given null.
- 参数:
generation
- 要设置的代次
-
hasPages
boolean hasPages()检测这本书是否存在页面.原文:Checks for the existence of pages in the book.
- 返回:
- 如果这本书有页面返回true
-
getPage
获取这本书指定页面的内容.给定的页面必须存在.页码在1-书本总页数范围内.
原文:Gets the specified page in the book. The given page must exist.
Pages are 1-indexed.
- 参数:
page
- 指定页码- 返回:
- 这个页码的内容
-
setPage
设置这本书指定页面的内容.书页必须是连续的.数据的长度最大为256个字符,超出部分将被截断.
页码在1-书本总页数范围内.
原文: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.
Pages are 1-indexed.
- 参数:
page
- 要设置的页码,在[1, getPageCount()]区间内data
- 那个书页的内容
-
getPages
获取这本书的全部页面.原文:Gets all the pages in the book.
- 返回:
- 这本书的全部页面的内容
-
setPages
清除存在的书页,并设置书提供的书页.最多100页,每页最多256个字符.原文:Clears the existing book pages, and sets the book to use the provided pages. Maximum 100 pages with 256 characters per page.
- 参数:
pages
- 要设置的书页的内容的列表
-
setPages
清除存在的书页,并设置书提供的书页.最多50页,每页最多256个字符.原文:Clears the existing book pages, and sets the book to use the provided pages. Maximum 50 pages with 256 characters per page.
- 参数:
pages
- 每页的内容的列表
-
addPage
在这本书的最后添加页面.最多50页,每页最多256个字符.原文:Adds new pages to the end of the book. Up to a maximum of 50 pages with 256 characters per page.
- 参数:
pages
- 每页的内容的列表
-
getPageCount
int getPageCount()获取这本书有多少页.原文:Gets the number of pages in the book.
- 返回:
- 这本书的页数
-
clone
-
spigot
-