/** * Adds a book to the loader, and returns a reference object * Be warned that the returned BookData object is not immediately populated, and is instead populated when the resources are loaded/reloaded * * @param name The name of the book, modid: will be automatically appended to the front of the name unless that is already added * @param appendIndex Whether an index should be added to the front of the book using a BookTransformer * @param appendContentTable Whether a table of contents should be added to the front of each section using a BookTransformer * @param repositories All the repositories the book will load the sections from * @return The book object, not immediately populated */ public static BookData registerBook(String name, boolean appendIndex, boolean appendContentTable, BookRepository... repositories) { BookData info = new BookData(repositories); books.put(name.contains(":") ? name : Loader.instance().activeModContainer().getModId() + ":" + name, info); if(appendIndex) { info.addTransformer(BookTransformer.IndexTranformer()); } if(appendContentTable) { info.addTransformer(BookTransformer.contentTableTransformer()); } return info; }