The below code worked fine until the last Paper update. Now I get:
Can’t access member of class org.bukkit.craftbukkit.v1_16_R3.inventory.CraftMetaBook with modifiers “protected”
I know is a coding issue but this has been working for over a year and has not been changed.
In fact, it still works on my Production server which I have not updated to the newer paper due to this issue. Any idea what has happened?
private static List PAGES;
private static ItemStack BOOK;
private static BookMeta BM;
Constructor.BOOK = new ItemStack(Material.WRITTEN_BOOK, 1);
Constructor.BM = (BookMeta)BOOK.getItemMeta();
public ItemStack CreateBook()
PAGES = (List) CraftMetaBook.class.getDeclaredField(“pages”).get(BM);
(Add Pages code would be here but on PROD we don’t get this far)
catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException ex)
LOG.log(Level.SEVERE, “Book not Created. ***”, ex);