This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
ModUpdater/MOD_DEVELOPER.md

127 lines
3.0 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-07-25 18:10:06 +00:00
- In Loose Versioning Mode, Can Infer File's Supported Minecraft version From CurseForge Metadata
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"
}
}
```
2020-06-29 16:43:20 +00:00
- Does Not Use Semantic Versioning
- A mod is marked as out-of-date if the version in the JSON is different from the current version, so if the current version is newer than the one in the JSON, it will still be marked as out-of-date.
2020-06-29 14:21:36 +00:00
- ```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}"
```
2020-07-25 18:10:06 +00:00
## Loose VS Strict Versioning Mode
### Strict (Default)
In strict mode it only marks a file as compatibleif the Minecraft version is identical.
### Loose
```json
{
"custom": {
"modupdater": {
"strict": false
}
}
}
```
In loose mode, it will also mark a file as compatible if it has the same release target.