Skip to content

Commit 739dda9

Browse files
Hbg1010matcool
andauthored
Updated dependency page to match new syntax (needs proof reading) (#66)
Co-authored-by: mat <[email protected]>
1 parent 1969e7e commit 739dda9

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

mods/dependencies.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ Dependencies can be added to your mod by simply adding it to the `dependencies`
2929
"name": "My example mod",
3030
"developer": "Me",
3131
"version": "v1.0.0",
32-
"dependencies": [
33-
{
34-
"id": "someone-elses.mod",
32+
"dependencies": {
33+
"someones-mod": ">=v1.0.5",
34+
"someone-elses.mod": {
3535
"version": ">=v1.2.5",
3636
"importance": "required"
3737
}
38-
]
38+
}
3939
}
4040
```
4141

42-
Dependencies have two required properties: the ID of the dependency and the version depended on. Additionally, the dependency may have an [importance](#importance), which specifies if the dependency is required or not.
42+
Dependencies can be specified by using an object that maps from a mod id to a version, or more information if needed. The dependency may have an [importance](#importance), which specifies if the dependency is required or not. If this is not specified, the dependency is marked as required.
4343

4444
The `version` field of a dependency may be written as `>=version`, `=version`, or `<=version`. The comparisons work as expected, with the addition that if the major versions are different, the comparison is always false. This means that if you depend on version `>=1.2.5` of a mod, version `v1.8.0` will be considered acceptable but `v2.0.0` will not. For this reason, [if you make a mod that is depended upon, you should follow strict semver](https://semver.org).
4545

@@ -51,12 +51,9 @@ The mod `hjfod.gmd-api` contains utilities for working with [.GMD files](https:/
5151

5252
```json
5353
{
54-
"dependencies": [
55-
{
56-
"id": "hjfod.gmd-api",
57-
"version": ">=v1.0.0"
58-
}
59-
]
54+
"dependencies": {
55+
"hjfod.gmd-api": ">=v1.0.0"
56+
}
6057
}
6158
```
6259

0 commit comments

Comments
 (0)