[SPIGOT-783] BookMeta API methods for getting/setting book generation data Created: 08/Apr/15  Updated: 03/Jun/16  Resolved: 03/Jun/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: VanDerProtofsky Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: 1.8, API, Books, Bukkit, Generation


 Description   

In the Bukkit API, BookMeta.java allows for books to have their author, titles and page data set and retrieved. However, Minecraft 1.8 introduced book "generation" tracking so that copies of books are marked as such.

I would like to suggest an extension of the Bukkit API and subsequent implementation in CraftBukkit of the following:

  • enum BookGeneration - Example implementation (unsure if correct values)
    ORIGINAL(0),
    COPY_OF_ORIGINAL(1),
    COPY_OF_COPY(2),
    TATTERED(3)
    
  • int getGeneration() - Would return the generation of a book
  • void setGeneration(int generation) - Would set the generation of a book

An example use-case for this would be SignShop; to work around complications with written books, code was recently added to recreate a book to a newer "format". However, as the Bukkit API does not expose methods for setting book generation, this metadata is envitably lost.



 Comments   
Comment by VanDerProtofsky [ 08/Apr/15 ]

Whoops. I am unable to edit the issue; I intended to suggest that getGeneration() and setGeneration() would use BookGeneration rather than int.

Comment by SpigotMC [ 08/Apr/15 ]

Your build is not the latest and therefore may be the reason you are having this issue. Spigot is 0 version(s) behind. CraftBukkit is 1 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue.

Generated at Mon Apr 07 22:55:56 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.