diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index d992df8..41bef19 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -43,8 +43,9 @@ export default defineConfig({ ] }, { - text: "Miscellaneous", // also move the file + text: "Miscellaneous", items: [ + {text: "Pack Metadata", link: "/miscellaneous/pack_metadata"}, {text: "Data Types", link: "/miscellaneous/data_types"}, {text: "Timespan", link: "/miscellaneous/timespans"} ] diff --git a/docs/example_pack/pack.mcmeta b/docs/example_pack/pack.mcmeta index 1d764c9..6429fea 100755 --- a/docs/example_pack/pack.mcmeta +++ b/docs/example_pack/pack.mcmeta @@ -8,5 +8,106 @@ "max_inclusive": 69 }, "description": "Catharsis example pack" + }, + "catharsis:pack/v1": { + "id": "example_pack", + "version": "1.0.0", + "dependencies": { + "catharsis": ">=1.0.0-beta.5" + }, + "config": [ + { + "type": "tab", + "title": "Interesting Tab Title", + "options": [ + { + "type": "dropdown", + "id": "dropdown_example", + "title": "Example Dropdown Title", + "description": "An example dropdown description.", + "options": [ + { + "value": "a", + "text": "Option A", + "default": true + }, + { + "value": "b", + "text": "Option B" + }, + { + "value": "c", + "text": "Option C" + } + ] + } + ] + }, + { + "type": "separator", + "title": "Separator Example", + "description": "Can even have a description!" + }, + { + "type": "boolean", + "id": "boolean_example", + "title": "Example Boolean Title", + "description": { + "text": "", + "extra": [ + { + "text": "Can even have color, ", + "color": "red" + }, + { + "text": "or not." + } + ] + }, + "default": true + } + ] + }, + "fabric:overlays": { + "entries": [ + { + "directory": "example_boolean_overlay", + "condition": { + "condition": "catharsis:config", + "pack": "example_pack", + "id": "boolean_example" + } + }, + { + "directory": "example_dropdown_a_overlay", + "condition": { + "condition": "fabric:not", + "value": { + "condition": "catharsis:config", + "pack": "example_pack", + "id": "dropdown_example", + "value": "a" + } + } + }, + { + "directory": "example_dropdown_b_overlay", + "condition": { + "condition": "catharsis:config", + "pack": "example_pack", + "id": "dropdown_example", + "value": "b" + } + }, + { + "directory": "example_dropdown_c_overlay", + "condition": { + "condition": "catharsis:config", + "pack": "example_pack", + "id": "dropdown_example", + "value": "c" + } + } + ] } } diff --git a/docs/miscellaneous/pack_metadata.md b/docs/miscellaneous/pack_metadata.md new file mode 100644 index 0000000..cf5578d --- /dev/null +++ b/docs/miscellaneous/pack_metadata.md @@ -0,0 +1,59 @@ +--- +title: Pack Metadata +lang: en-US +--- + +# Defining Catharsis Pack Metadata + + + +TODO + +<<< @/example_pack/pack.mcmeta{json:line-numbers} + + + + A .mcmeta ResourcePack object + +- **catharsis:pack/v1**: The Catharsis pack metadata. + - **id**: A unique id for the pack, needs to be `[a-z0-9_.-]+`. + - **version**: The version of the pack. + - **dependencies**: (Optional) A map of required mods. + - **<key>**: The id of the mod. + - The version range (e.g., `>=1.0.0`). + - **config**: (Optional) A list of config elements for the settings menu. + - **Config Element**: + - **type**: The type of element (`tab`, `dropdown`, `boolean`, or `separator`). + - **id**: (Required for inputs) The unique key for this config option, needs to be `[a-z0-9_.-]+`. + - **title**: The display name, supporting both string and JSON text component. + - **description**: (Optional) A description for the option, supporting both string and JSON text component. + - **default**: (Optional) (For `boolean`) The default toggle state, defaults to `false`. + - **options**: (For `dropdown`) A list of selectable values. + - **Dropdown Option**: + - **value**: The internal ID used for conditions, needs to be `[a-z0-9_.-]+`. + - **text**: The display label for the user. + - **default**: (Optional) Whether this option is selected by default, defaults to `false`. + +- **fabric:overlays**: (Optional) A system for conditional resource loading. + - **entries**: A list of overlay definitions. + - **Overlay Entry**: + - **directory**: The sub-folder within the pack to apply if conditions are met, needs to be `[a-z0-9_.-]+`. + - **condition**: The logic required to enable this overlay. + - **condition**: The condition type (e.g., `catharsis:config`, `fabric:not`, ...). + - **pack**: The ID of the pack containing the config. + - **id**: The ID of the config option to check. + - **value**: (Optional) The specific value to match (used for dropdowns). + + +## Catharsis Metadata Explanation + +Catharsis pack metadata is defined within the `catharsis:pack/v1` object inside the `pack.mcmeta` file of your resource pack. + +This metadata allows you to specify important information about your Catharsis pack, including its unique identifier, version, dependencies on other mods, and configuration options for users. + + +## Fabric Overlays Explanation + +Pack overlays, (or also called Minipacks by a few), are a system provided by Fabric themselves, just not documented anywhere. + +They allow resource packs to conditionally load sub-folders based on certain conditions (or always), providing a way to have modular resource packs or just organised packs.