2023-01-14 20:18:48 +01:00
|
|
|
FalsePatternLib JSON dependency file example
|
2025-08-01 00:07:07 +02:00
|
|
|
Version 2
|
2023-01-14 20:18:48 +01:00
|
|
|
|
|
|
|
|
An example JSON file that can be used to download dependencies using FalsePatternLib. This replaces the legacy
|
2023-01-14 20:46:33 +01:00
|
|
|
DependencyLoader api. This file needs to reside inside the META-INF directory.
|
2023-07-16 13:09:05 +02:00
|
|
|
|
2023-01-14 20:18:48 +01:00
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"identifier": "falsepatternlib_dependencies",
|
2025-08-01 00:07:07 +02:00
|
|
|
"minJava": 8,
|
|
|
|
|
"maxJava": 8,
|
2025-11-13 00:22:29 +01:00
|
|
|
"bundledArtifacts": [
|
|
|
|
|
"com.example:myjar:1.2.3"
|
|
|
|
|
],
|
2023-01-14 20:18:48 +01:00
|
|
|
"repositories": [
|
|
|
|
|
"https://example.com/"
|
|
|
|
|
],
|
|
|
|
|
"dependencies": {
|
|
|
|
|
"always": {
|
|
|
|
|
"common": [],
|
|
|
|
|
"client": [],
|
|
|
|
|
"server": []
|
|
|
|
|
},
|
|
|
|
|
"obf": {
|
|
|
|
|
"common": [
|
|
|
|
|
"com.example:examplejar:1.0.0"
|
|
|
|
|
],
|
|
|
|
|
"client": [],
|
|
|
|
|
"server": []
|
|
|
|
|
},
|
|
|
|
|
"dev": {
|
|
|
|
|
"common": [],
|
|
|
|
|
"client": [],
|
|
|
|
|
"server": []
|
|
|
|
|
}
|
2025-11-13 00:22:29 +01:00
|
|
|
},
|
|
|
|
|
"modDependencies": {
|
|
|
|
|
"always": {
|
|
|
|
|
"common": [
|
2025-11-14 00:30:34 +01:00
|
|
|
"com.example:mymod:3.0.0",
|
|
|
|
|
{
|
|
|
|
|
"modid": "mylib",
|
|
|
|
|
"artifact": "com.example:mylib:1.0.2"
|
|
|
|
|
}
|
2025-11-13 00:22:29 +01:00
|
|
|
],
|
|
|
|
|
"client": [],
|
|
|
|
|
"server": []
|
|
|
|
|
},
|
|
|
|
|
"obf": {
|
|
|
|
|
"common": [],
|
|
|
|
|
"client": [],
|
|
|
|
|
"server": []
|
|
|
|
|
},
|
|
|
|
|
"dev": {
|
|
|
|
|
"common": [],
|
|
|
|
|
"client": [],
|
|
|
|
|
"server": []
|
|
|
|
|
}
|
2023-01-14 20:18:48 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Explanation:
|
2023-07-16 13:09:05 +02:00
|
|
|
|
|
|
|
|
- `identifier`: The identifier of the json file. This must always be `falsepatternlib_dependencies` for the library
|
|
|
|
|
downloader
|
2023-01-14 20:18:48 +01:00
|
|
|
to recognize it.
|
2025-08-01 00:07:07 +02:00
|
|
|
- `minJava`: The lowest java major version to load dependencies from this file for (inclusive). Can be omitted, in which case
|
|
|
|
|
it will load dependencies for any java versions below or equal maxJava.
|
|
|
|
|
- `maxJava`: The highest java major version to load dependencies from this file for (inclusive). If omitted, it will load dependencies
|
|
|
|
|
for any java versions above or equal minJava.
|
|
|
|
|
- If both `minJava` and `maxJava` are unset, dependencies from the file will be loaded regardless of java version.
|
|
|
|
|
- If you want to load dependencies for multiple different java ranges, use multiple dependency jsons.
|
2025-11-13 00:22:29 +01:00
|
|
|
- `bundledArtifacts`: A list of maven artifacts which are "shaded" into this jar without relocation. Useful for recursive deploading of mc mods.
|
2023-01-14 20:18:48 +01:00
|
|
|
- `repositories`: A list of maven repositories to use when downloading dependencies. These are used in addition to the
|
|
|
|
|
default maven repositories. This is just a list of strings, each string being a https repository url.
|
2025-05-18 13:27:23 +02:00
|
|
|
Additionally, every jar with a dependencies json file inside of it is treated as a "jar in jar" maven repository.
|
|
|
|
|
This maven repository exists under `META-INF/falsepatternlib_repo/`
|
2023-01-14 20:18:48 +01:00
|
|
|
- `dependencies`: A categorized list of dependencies.
|
2023-07-16 13:09:05 +02:00
|
|
|
- The `always` category gets downloaded both inside and outside the dev environment. Usually not needed, as gradle
|
|
|
|
|
will automatically download dependencies.
|
|
|
|
|
- The `obf` category gets downloaded only in the obfuscated environment. Any third party libraries that are not
|
|
|
|
|
available by default from minecraft or forge, AND are also not shaded/shadowed into the jar, should be placed
|
|
|
|
|
here.
|
|
|
|
|
- The `dev` category gets downloaded only in the dev environment. Usually not needed, as gradle will automatically
|
|
|
|
|
download dependencies.
|
2025-11-13 00:22:29 +01:00
|
|
|
- `modDependencies`: Same as `dependencies`, but files from here get downloaded into `.minecraft/mods/1.7.10`. Useful
|
2025-11-14 00:30:34 +01:00
|
|
|
if you want to download third party mods as well. Additionally, instead of a single maven artifact string, you can use
|
|
|
|
|
a json object with separate `modid` and `artifact` attributes, which can be used to filter against a specific mod ID in
|
|
|
|
|
addition to plain artifact matching against other downloaded libraries and `bundledArtifacts`. This is useful if you
|
|
|
|
|
want to depload a mod that doesn't have a marker json in it.
|
2023-01-14 20:18:48 +01:00
|
|
|
|
|
|
|
|
Each of these categories also have 3 more subcategories:
|
2023-07-16 13:09:05 +02:00
|
|
|
|
2023-01-14 20:18:48 +01:00
|
|
|
- `common`: Dependencies that are required on both the client and the server.
|
|
|
|
|
- `client`: Dependencies that are required on the client only.
|
|
|
|
|
- `server`: Dependencies that are required on the server only.
|
|
|
|
|
|
|
|
|
|
Each of these subcategories is a list of strings, each string being a maven dependency string. These are the same as
|
|
|
|
|
the ones used in the gradle dependencies block. Note that this DOES NOT support the version range syntax, so you must
|
2023-07-16 13:09:05 +02:00
|
|
|
specify a specific version. For example, `com.example:examplejar:1.0.0` is valid,
|
2025-05-18 13:27:23 +02:00
|
|
|
but `com.example:examplejar:[1.0.0,2.0.0]` is not.
|