Skip to content

API Usage

leonardo-dgs edited this page Sep 25, 2023 · 2 revisions

Maven

<repository>
    <id>codemc-repo</id>
    <url>https://repo.codemc.io/repository/maven-public/</url>
</repository>
<dependency>
    <groupId>net.leonardo_dgs</groupId>
    <artifactId>InteractiveBooks</artifactId>
    <version>1.7.2</version>
</dependency>

Gradle

maven { url = 'https://repo.codemc.org/repository/maven-public/' }
implementation 'net.leonardo_dgs:InteractiveBooks:1.7.2'

Get a book

You can get a book already loaded calling the function InteractiveBooks.getBook(String id)
Where id is the book id, player is the player used to get placeholders, can be omitted if you don't use placeholders.

Get a book by id

You can get a book, already saved in memory, from its id, calling the function InteractiveBooks.getBook(String id).
Where id is the book's id.

Get loaded books

You can get an HashMap with all loaded books by calling the function InteractiveBooks.getBooks()

Register books in InteractiveBooks

You can register a book, so it will be as if it had been loaded from a file in the InteractiveBooks' books folder.
The function is: InteractiveBooks.registerBook(IBook book)
You can unregister it, with: InteractiveBooks.unregisterBook(String id)
Where id is the book id

Clone this wiki locally