Package valorless.rarespawns.datamodels
Class WrittenBook
java.lang.Object
valorless.rarespawns.datamodels.WrittenBook
Represents the data structure for a written book item in RareSpawns.
Stores title, author, generation, and pages for a Minecraft written book.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new page to the end of the book.Gets the author of the book.org.bukkit.inventory.meta.BookMeta.GenerationGets the generation of the book.getPages()Gets the pages of the book.getTitle()Gets the title of the book.voidremovePage(Integer page) Removes a page by index.voidSets the author of the book.voidsetGeneration(org.bukkit.inventory.meta.BookMeta.Generation generation) Sets the generation of the book.voidSets a specific page by index.voidSets the pages of the book.voidSets the title of the book.
-
Constructor Details
-
WrittenBook
public WrittenBook()Constructs an empty WrittenBook.
-
-
Method Details
-
getTitle
Gets the title of the book.- Returns:
- The book title.
-
setTitle
Sets the title of the book.- Parameters:
title- The book title.
-
getAuthor
Gets the author of the book.- Returns:
- The book author.
-
setAuthor
Sets the author of the book.- Parameters:
author- The book author.
-
getGeneration
public org.bukkit.inventory.meta.BookMeta.Generation getGeneration()Gets the generation of the book.- Returns:
- The book generation.
-
setGeneration
public void setGeneration(org.bukkit.inventory.meta.BookMeta.Generation generation) Sets the generation of the book.- Parameters:
generation- The book generation.
-
getPages
Gets the pages of the book.- Returns:
- The pages map (index to lines).
-
setPages
Sets the pages of the book.- Parameters:
pages- The pages map (index to lines).
-
setPage
Sets a specific page by index.- Parameters:
index- The page index.page- The list of lines for the page.
-
addPage
Adds a new page to the end of the book.- Parameters:
page- The list of lines for the new page.
-
removePage
Removes a page by index.- Parameters:
page- The page index to remove.
-