ModUpdater/MOD_DEVELOPERS.md

110 lines
2.5 KiB
Markdown
Raw Normal View History

2020-06-29 14:21:36 +00:00
# Mod Developers
To opt-in a mod for ModUpdater, you must select an update strategy in ```fabric.mod.json```.
## CurseForge
This update strategy uses the CurseForge API to check for updates.
### ```fabric.mod.json```
```json
{
"custom": {
"modupdater": {
"strategy": "curseforge",
"projectID": 306612
}
}
}
```
- Requires Semantic Versioning
2020-06-29 14:26:25 +00:00
- [Requires ```build.gradle``` modification](#build-gradle-modification)
2020-06-29 14:21:36 +00:00
## GitHub Releases
This update strategy uses the GitHub Releases API to check for updates.
### ```fabric.mod.json```
```json
{
"custom": {
"modupdater": {
"strategy": "github",
"owner": "Repository Owner",
"repository": "Repository Name"
}
}
}
```
- Requires Semantic Versioning
2020-06-29 14:26:25 +00:00
- [Requires ```build.gradle``` Modification](#build-gradle-modification)
2020-06-29 14:21:36 +00:00
## Maven
This update strategy uses the specified Maven repository to check for updates.
### ```fabric.mod.json```
```json
{
"custom": {
"modupdater": {
"strategy": "maven",
"repository": "https://maven.fabricmc.net",
"group": "net.fabricmc.fabric-api",
"artifact": "fabric-api"
}
}
}
```
- Requires Semantic Versioning
2020-06-29 14:26:25 +00:00
- [Requires ```build.gradle``` Modification](#build-gradle-modification)
2020-06-29 14:21:36 +00:00
## JSON
This update strategy uses the specified JSON file to check for updates.
### ```fabric.mod.json```
```json
{
"custom": {
"modupdater": {
"strategy": "json",
"url": "https://example.com/thing.json"
}
}
}
```
### JSON Format
```json
{
"1.16.1": {
"version": "1.0.1",
"downloadUrl": "https://example.com/thing2.jar"
},
"20w20a": {
"version": "1.0.0",
"downloadUrl": "https://example.com/thing.jar"
}
}
```
- Does Not Require Semantic Versioning
- ```build.gradle``` Modification Is Not Required
## ```build.gradle``` Modification
Multiple update strategies require the Minecraft version to be appended to the end of the JAR version to detect what Minecraft version a JAR supports.
Replace:
```gradle
version = project.mod_version
```
with:
```gradle
version = "${project.mod_version}+${project.minecraft_version}"
```
If you prefer hyphens you can also use:
```gradle
version = "${project.mod_version}-${project.minecraft_version}"
```
You can also just use the major version of Minecraft instead of the full version (like ```1.16``` instead of ```1.16.1``` or ```20w20a```).