public class BookLoader extends java.lang.Object implements net.minecraft.client.resources.IResourceManagerReloadListener, IBookLoader
| Modifier and Type | Field and Description |
|---|---|
static com.google.gson.Gson |
GSON |
static BookLoader |
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Class<? extends BookContent> |
getContentType(java.lang.String name) |
IBookPageFactory |
getPageFactory(java.lang.String name) |
static net.minecraft.client.resources.IResource |
getResource(java.lang.String path) |
void |
invalidateBook()
Invalidates the current instance of the book.
|
IForesterBook |
loadBook()
Loads the book if it was not loaded already or if it was invalidated.
|
void |
onResourceManagerReload(net.minecraft.client.resources.IResourceManager resourceManager) |
void |
registerContentType(java.lang.String name,
java.lang.Class<? extends BookContent> contentClass)
Adds a content type.
|
void |
registerPageFactory(java.lang.String name,
IBookPageFactory factory) |
public static final com.google.gson.Gson GSON
public static final BookLoader INSTANCE
public void registerContentType(java.lang.String name,
java.lang.Class<? extends BookContent> contentClass)
IBookLoaderregisterContentType in interface IBookLoadername - The name of the content type.contentClass - The class for the deserialization of the content.public void registerPageFactory(java.lang.String name,
IBookPageFactory factory)
registerPageFactory in interface IBookLoaderpublic IBookPageFactory getPageFactory(java.lang.String name)
getPageFactory in interface IBookLoaderpublic IForesterBook loadBook()
IBookLoaderloadBook in interface IBookLoaderpublic void invalidateBook()
IBookLoaderIBookLoader.loadBook() gets called a new instance of the book will be loaded.invalidateBook in interface IBookLoader@Nullable public static net.minecraft.client.resources.IResource getResource(java.lang.String path)
@Nullable public java.lang.Class<? extends BookContent> getContentType(java.lang.String name)
public void onResourceManagerReload(net.minecraft.client.resources.IResourceManager resourceManager)
onResourceManagerReload in interface net.minecraft.client.resources.IResourceManagerReloadListener