Class WrittenBook

java.lang.Object
valorless.rarespawns.datamodels.WrittenBook

public class WrittenBook extends Object
Represents the data structure for a written book item in RareSpawns. Stores title, author, generation, and pages for a Minecraft written book.
  • Constructor Details

    • WrittenBook

      public WrittenBook()
      Constructs an empty WrittenBook.
  • Method Details

    • getTitle

      public String getTitle()
      Gets the title of the book.
      Returns:
      The book title.
    • setTitle

      public void setTitle(String title)
      Sets the title of the book.
      Parameters:
      title - The book title.
    • getAuthor

      public String getAuthor()
      Gets the author of the book.
      Returns:
      The book author.
    • setAuthor

      public void setAuthor(String author)
      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

      public HashMap<Integer,List<String>> getPages()
      Gets the pages of the book.
      Returns:
      The pages map (index to lines).
    • setPages

      public void setPages(HashMap<Integer,List<String>> pages)
      Sets the pages of the book.
      Parameters:
      pages - The pages map (index to lines).
    • setPage

      public void setPage(Integer index, List<String> page)
      Sets a specific page by index.
      Parameters:
      index - The page index.
      page - The list of lines for the page.
    • addPage

      public void addPage(List<String> page)
      Adds a new page to the end of the book.
      Parameters:
      page - The list of lines for the new page.
    • removePage

      public void removePage(Integer page)
      Removes a page by index.
      Parameters:
      page - The page index to remove.