diff --git a/build.gradle b/build.gradle index 39db3c1..ff760a8 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ repositories { apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'maven-publish' -version = "1.4.0" +version = "1.4.1" group = "gigaherz.guidebook" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Guidebook-1.10.2" diff --git a/src/main/resources/assets/gbook/xml/guidebook.xml b/src/main/resources/assets/gbook/xml/guidebook.xml index 71bea16..6d1b47a 100644 --- a/src/main/resources/assets/gbook/xml/guidebook.xml +++ b/src/main/resources/assets/gbook/xml/guidebook.xml @@ -28,8 +28,8 @@
Guidebook has 3 ways to declare new books, designed for different purposes:
- 1. Using the book registry API. - 2. Using the configuration folder. - 3. Using resource packs. +Guidebook has 3 ways to declare new books, designed for different purposes.
+For modders:
+ - Using the book registry API. +For adventure map authors:
+ - Using resource packs. +For modpack authors:
+ - Using the configuration folder.Afterward, you can give the books to the player by using the creative menu, or using a command (command-block) with
/give @p gbook:guidebook 1 0 {Book:"gbook:xml/book.xml"}
Finally, you can make the mod give new players one or more books the first time they join (applies retroactively to existing players if enabled).
@@ -54,7 +57,6 @@The preferred way to access the registry is through the BookRegistryEvent. An example of use is provided below:
-@Optional.Method(modid="gbook")
@SubscribeEvent
public static void registerBook
@@ -64,26 +66,43 @@new ResourceLocation(
"modid:xml/book.xml"));
}
-The Optional annotation is needed to prevent a hard-dependency on the mod. The event parameter has a register method, that can be used to perform the registration.
In order for this event to run, you need to annotate the class with @Mod.EventBusSubscriber.
- -If you are a modpack author, you may want to add custom books available to everyone using your pack. This can be done by using the `config/guidebook/` folder. This folder will behave like a resource pack, except the contents inside will be limited to the `gbook` resource domain.
-See the following section for details on how to declare books in a resource pack.
Another way to provide books is to use a resource pack. This is useful for adventure map developers, and users who just want some extra books without unnecessary hassle.
-The most important resource will be the `books.json` file, which will have to reside at the root of any resource domain. That is, in a folder like `assets/[ANY NAME HERE]/books.json`. Keep in mid that the resource domain must be lowercase, like `minecraft`.
-This JSON-formatted file will contain a single array, with the list of books inside. It will look like this:
-[ "domain1:path/book1.xml", "domain2:path/book2.xml", ... ]
+The final way to provide books is to use a resource pack. This is useful for adventure map developers, and users who just want some extra books without unnecessary hassle.
+Books will be placed as resources inside a resourcepack resource domain. That is, in a folder like `assets/gbook/` or similar. Note that it must be lowercase.
+If you don't know what resource domain to use, the preferred fallback should always be 'gbook' and not 'minecraft'. This is to avoid any potential future conflicts if Mojang ever decides to add resource-based custom books to the game.
+An example of structure is as follows:
+assets/
+gbook/
+books.json
+books/
+book1.xml
+book2.xml
+The most important resource will be the `books.json` file, which will have to reside at the root of any resource domain. This JSON-formatted file will contain a single array, with the list of books inside. It will look like this:
+[ "gbook:books/book1.xml", "gbook:books/book2.xml", ... ]
These resources are additive. That means an upper resource pack will not be able to remove books registered by a lower one, unlike normal resources which are replaced by upper packs.
-See the other sections of this document for information on the tags available, and read the source code of this book for a practical example.
+If you are a modpack author, you may want to add custom books available to everyone using your pack. This can be done by using the `config/books/` folder (it may need to be created). This folder will behave like a resource pack, except the contents inside will be limited to the `gbook` resource domain.
+See the previous section for details on how to declare books in a resource pack.
+The difference is, in this case, you would see this structure:
+config/books/
+books.json
+books/
+book1.xml
+book2.xml
+ +The contents of the 'books.json' would remain the same as if using a resource pack:
+[ "gbook:books/book1.xml", "gbook:books/book2.xml", ... ]