Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.inventory.meta.BookMeta Interface Reference
Inheritance diagram for org.bukkit.inventory.meta.BookMeta:
org.bukkit.inventory.meta.ItemMeta org.bukkit.configuration.serialization.ConfigurationSerializable

Public Member Functions

boolean hasTitle ()
 
String getTitle ()
 
boolean setTitle (String title)
 
boolean hasAuthor ()
 
String getAuthor ()
 
void setAuthor (String author)
 
boolean hasPages ()
 
String getPage (int page)
 
void setPage (int page, String data)
 
List< String > getPages ()
 
void setPages (List< String > pages)
 
void setPages (String...pages)
 
void addPage (String...pages)
 
int getPageCount ()
 
BookMeta clone ()
 
- Public Member Functions inherited from org.bukkit.inventory.meta.ItemMeta
boolean hasDisplayName ()
 
String getDisplayName ()
 
void setDisplayName (String name)
 
boolean hasLore ()
 
List< String > getLore ()
 
void setLore (List< String > lore)
 
boolean hasEnchants ()
 
boolean hasEnchant (Enchantment ench)
 
int getEnchantLevel (Enchantment ench)
 
Map< Enchantment, Integer > getEnchants ()
 
boolean addEnchant (Enchantment ench, int level, boolean ignoreLevelRestriction)
 
boolean removeEnchant (Enchantment ench)
 
boolean hasConflictingEnchant (Enchantment ench)
 
- Public Member Functions inherited from org.bukkit.configuration.serialization.ConfigurationSerializable
Map< String, Object > serialize ()
 

Detailed Description

Represents a book (Material#BOOK_AND_QUILL or Material#WRITTEN_BOOK) that can have a title, an author, and pages.

Definition at line 11 of file BookMeta.java.

Member Function Documentation

void org.bukkit.inventory.meta.BookMeta.addPage ( String...  pages)

Adds new pages to the end of the book. Up to a maximum of 50 pages with 256 characters per page.

Parameters
pagesA list of strings, each being a page
String org.bukkit.inventory.meta.BookMeta.getAuthor ( )

Gets the author of the book.

Plugins should check that hasAuthor() returns true before calling this method.

Returns
the author of the book
String org.bukkit.inventory.meta.BookMeta.getPage ( int  page)

Gets the specified page in the book. The given page must exist.

Parameters
pagethe page number to get
Returns
the page from the book
int org.bukkit.inventory.meta.BookMeta.getPageCount ( )

Gets the number of pages in the book.

Returns
the number of pages in the book
List<String> org.bukkit.inventory.meta.BookMeta.getPages ( )

Gets all the pages in the book.

Returns
list of all the pages in the book
String org.bukkit.inventory.meta.BookMeta.getTitle ( )

Gets the title of the book.

Plugins should check that hasTitle() returns true before calling this method.

Returns
the title of the book
boolean org.bukkit.inventory.meta.BookMeta.hasAuthor ( )

Checks for the existence of an author in the book.

Returns
the author of the book
boolean org.bukkit.inventory.meta.BookMeta.hasPages ( )

Checks for the existence of pages in the book.

Returns
true if the book has pages
boolean org.bukkit.inventory.meta.BookMeta.hasTitle ( )

Checks for the existence of a title in the book.

Returns
true if the book has a title
void org.bukkit.inventory.meta.BookMeta.setAuthor ( String  author)

Sets the author of the book. Removes author when given null.

Parameters
authorthe author of the book
void org.bukkit.inventory.meta.BookMeta.setPage ( int  page,
String  data 
)

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.

Parameters
pagethe page number to set
datathe data to set for that page
void org.bukkit.inventory.meta.BookMeta.setPages ( List< String >  pages)

Clears the existing book pages, and sets the book to use the provided pages. Maximum 50 pages with 256 characters per page.

Parameters
pagesA list of pages to set the book to use
void org.bukkit.inventory.meta.BookMeta.setPages ( String...  pages)

Clears the existing book pages, and sets the book to use the provided pages. Maximum 50 pages with 256 characters per page.

Parameters
pagesA list of strings, each being a page
boolean org.bukkit.inventory.meta.BookMeta.setTitle ( String  title)

Sets the title of the book.

Limited to 16 characters. Removes title when given null.

Parameters
titlethe title to set
Returns
true if the title was successfully set

The documentation for this interface was generated from the following file: