-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04edd55
commit 30358fb
Showing
7 changed files
with
103 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
docs/getting-started/step-by-step-with-datapack/step-by-step-with-datapack.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
sidebar_position: 10 | ||
--- | ||
|
||
# Step by Step Guide for a Book via Datapack | ||
|
||
This page will guide you through a reasonably easy way to create a book _without_ datagen. | ||
It uses the [Demo Book](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/books) modonomicon provides as a starting point. | ||
|
||
:::tip | ||
|
||
If you run into any issues or have any questions, join our Discord: **https://dsc.gg/klikli** | ||
|
||
::: | ||
|
||
:::warning | ||
|
||
It is not recommended to manually create books. It is much more convenient and error-free to use [datagen](../step-by-step-with-datagen/). JSON is not a great format for text editing, and can be annoying to properly format text. | ||
|
||
::: | ||
|
||
|
||
The best approach is to create a datapack from the demo book, and then modify and extend it to your needs. This saves you a lot of time and effort in manually creating a valid file structure for your book. | ||
|
||
:::tip | ||
|
||
If you are already well-versed with datapacks you can look at the demo book **[here](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/books)** and the demo multiblocks used by the book **[here](https://github.com/klikli-dev/modonomicon/tree/HEAD/neo/src/generated/resources/data/modonomicon/modonomicon/multiblocks)** and simply download the individual files you want to use as a reference. | ||
|
||
::: | ||
|
||
First, download the modonomicon source code, as it contains the demo book: | ||
1. Start by visiting https://github.com/klikli-dev/modonomicon | ||
2. Find the green "Code" button and click it. Then click "Download ZIP" at the bottom of the dropdown menu. | ||
3. Extract the ZIP file to a location of your choice. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
sidebar_position: 10 | ||
--- | ||
|
||
# Step 1: Set up an empty datapack | ||
|
||
1. Set up a folder structure as required by minecraft: https://minecraft.wiki/w/Data_pack#Folder_structure. | ||
1. You do not need to create all the subfolders of the `data` folder, you can keep `data` empty in the first step. | ||
|
||
2. Now create a folder for your namespace. Usually your namespace is your mod id or modpack id (e.g. the modpack name in all lowercase with no spaces) (See also https://minecraft.wiki/w/Resource_location#Namespaces) | ||
|
||
3. In your namespace folder, create a folder `/modonomicon/`. | ||
|
||
4. In the `/modonomicon/` folder, create a folder `/books/` and `/multiblocks/`: | ||
:::info | ||
If you do not plan on having any multiblocks or multiblock pages, you can skip the `/multiblocks/` folder. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
sidebar_position: 20 | ||
--- | ||
|
||
# Step 2: Copy demo content into your datapack | ||
|
||
|
||
1. In your file explorer go to the folder you extracted and then into `<extracted_folder>\neo\src\generated\resources\data\modonomicon\modonomicon\books\`. | ||
|
||
2. Copy the `demo` folder (or if you want to make a leaflet, the `demo_leaflet` folder) and paste it in your datapack's `/modonomicon/books/` folder. | ||
|
||
3. In your file explorer go to the folder you extracted and then into `<extracted_folder>\neo\src\generated\resources\data\modonomicon\modonomicon\multiblocks\`. | ||
|
||
4. Copy all `.json` files and paste them in your datapack's `/modonomicon/multiblocks/` folder. | ||
:::info | ||
If you do not plan on having any multiblocks or multiblock pages, you can skip copying the contents of the `/multiblocks/` folder. | ||
::: | ||
|
||
5. If you did not set up multiblocks, go into your datapack folder `<your datapack>/data/<your namespace>/modonomicon/books/demo/entries/features/` and delete the `multiblock.json` file. | ||
:::info | ||
If you do not delete that file, this multiblock entry will look for the multiblocks in the `/multiblocks/` folder and will throw an error if it does not find them. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
sidebar_position: 30 | ||
--- | ||
|
||
# Step 3: Test and extend the Demo Book | ||
|
||
You can now test your datapack in game. An item named `book.modonomicon.demo.name` should be available in the Modonomicon creative tab and JEI/REI/EMI. | ||
|
||
When you first open the book, it will not have proper texts instead it will have contents like `book.modonomicon.demo.features.spotlight.description`. | ||
|
||
Both the weird book name and weird content texts happen because the demo book uses the minecraft translation system. You can either create a resource pack with a language file (you can copy individual lines or the entire file from https://github.com/klikli-dev/modonomicon/blob/version/1.21.1/neo/src/generated/resources/assets/modonomicon/lang/en_us.json), or you can directly type your desired text in the json files. | ||
|
||
:::tip | ||
It is recommended to use the translation system, otherwise it is impossible for others to translate your book. | ||
::: | ||
|
||
**You can now edit the demo book to your liking to make your own book**. | ||
Reference the [Basics](../basics/) and [Advanced](../advanced/) sections to learn about the valid JSON keys and structures. |