Files
wiki/Mod-Data-Format.md
T

80 lines
4.2 KiB
Markdown

The Mod file format is a very simple command-based language which is very similar to [YAML](http://www.yaml.org). There are commands for entering all various kinds of data needed to describe a mod and what versions are supported. Most commands are optional, and can be entered in any order. Anywhere this isn't true will be called out below.
Each mod data file is stored in its own directory under `/static/data`. The directory should be named using the Mod's slug name (see: [[About Slugs]]), and contain a file named `mod.cg` using the format described later on this page.
Each mod should also have its own directory under `/static/browse`. This directory should contain:
* a 160x160 `icon.png` file used to represent the mod in various places on the site
* (optional) a `tutorials` directory. See [[Tutorial Data Format]] for details.
* a directory for each item (named using the item's slug). Each directory should have a 48x48
`icon.png` file for that item. See [[Mod Version Data Format]] for details.
## Example
```yaml
schema: 1
name: Buildcraft
author: SpaceToad
description: A technical mod which adds power generation, mining, and building systems
homePageUrl: http://www.mod-buildcraft.com
documentationUrl: http://www.mod-buildcraft.com/wiki/doku.php
downloadUrl: http://www.mod-buildcraft.com/download/
version: 6.2.6
```
## Basics
Each line of the file should usually contain a single command. Each command has the format: `<command>: <arg>, <arg>, ...`. All of the available commands are described below. Multiple commands may be listed on the same line by separating them with `;` characters. Comments are entered using the `#` character, which can itself be escaped if you need to use it in an item name. Blank lines are ignored. Whitespace is generally irrelevant outside item names, but following the conventions described above makes things easier.
## Command Reference
* `schema: <version>` _(required)_
The data schema used by the file. The current version is: 1.
* `name: <mod name>` _(required)_
The name of the mod described in the file. This should be the full name of the mod as referred to in
its own documentation; only use abbreviations if they are as commonly used as the full name itself
(e.g., "IC2").
* `author: <author(s)>`
The person or persons who created the mod or are now responsible for maintaining it (i.e., to whom you
would send a question or bug report). If the author chooses to use an alias, respect their chosen
name by spelling it as they spell it in their own documentation.
* `description: <description>`
A short description of the mod. Focus on briefly calling out the essence of the mod, and
differentiating it from the other mods supported by Crafting Guide. Keep it under about 150
characters in length.
* `homePageUrl: <url>` _(required)_
The URL which is the main landing page for the mod. If a mod has a dedicated website, this should be
the main page of that website. If not, it should be the announcement page in the official Minecraft
forum (if one is available), or otherwise the top search result on Google for the mod.
* `documentationUrl: <url>`
The URL which most directly points to the entryway to the mods documentation. This may or may not be
the same page as the official website (and usually isn't).
* `downloadUrl: <url>`
The URL which most directly leads to the downloads page for mod. This should never be used to
circumvent a paywall (e.g., AdFly links), and should never link to one specific version of the mod.
Instead, find the page which lists the available downloads for all versions of the mod (if possible).
* `version: <version>` _(required)_
Adds a version to the list of supported versions of this mod. The version should be specified exactly
as the mod owner describes it (e.g., "6.2.6" for a recent Buildcraft version, and "rv1-stable-1" for a
recent Applied Energistics 2 version).
Multiple versions may be specified, and if so, they should be listed with the most recent first.
For each version listed, a subdirectory should exist under `/static/data/<mod_slug>/<version>` containing a `mod-version.cg` file. See [[Mod Version Data Format]] for details on this file's format.