diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 51e45d0..b970415 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -13,7 +13,6 @@ - [File Object](schema/file.md) - [Install Object](schema/install.md) - [Relation Object](schema/relation.md) - - [Conditions Object](schema/conditions.md) - [Repository Object](schema/repository.md) - [Meta Object](schema/meta.md) diff --git a/docs/concepts/flags.md b/docs/concepts/flags.md index 38a5726..20e63e2 100644 --- a/docs/concepts/flags.md +++ b/docs/concepts/flags.md @@ -24,8 +24,7 @@ or [files](../schema/file.md). - `required` This flag specifies, that the related addon or file is required for the addon. If the addon gets installed, than any relation or file, which has this flag set, also has to be installed. - `optional` This flag specifies, that the related addon or file is optional for this addon. If the addon gets installed, - the user should be able to choose, whether he wants to install the relation or file with this flag, or not. This flag - can be used in combination with the [conditions](../schema/conditions.md) property. + the user should be able to choose, whether he wants to install the relation or file with this flag, or not. ### Relation specific diff --git a/docs/schema/conditions.md b/docs/schema/conditions.md deleted file mode 100644 index 0f709f7..0000000 --- a/docs/schema/conditions.md +++ /dev/null @@ -1,154 +0,0 @@ -# Conditions Object - -```json -{ - "require": ["some-addon"], - "companion": ["another-addon"], - "exclude": ["incompatible-addon"] -} -``` - -## Optional properties - -All addons in the arrays are specified as addon IDs or namespaced addon IDs. They all need to be specified -as optional relations in this version. - -### require - -This is an array of addon IDs, which are required for this relation or file and must be present. - -### companion - -This is an array of addon IDs which go together with this relation/file. -This field is fairly complex. - -The `companion` field is used to represent a relation between an optional file/relation, and an optional relation. -This means, if one of them isn't optional, an error occurs. - -The behaviour can be summarized as such: - -1. The relation/file that declares companions is only installed if all companions are also installed. -2. A relation that is a companion also will not be installed, unless **all** files/relations of that - relation declare it as a companion are also installed. - -This can be described as the relation and the relation/file that is a companion of the relation requiring **eachother**. -The reason this isn't done by declaring a `require` condition both on the addon/file and the file, is that files -cannot be referenced, as only addon-ids are used. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeInstalled ifFlagsConditions
companion-relationrelationexample-file is installed - -```json -["optional"] -``` - - - -```json -{} -``` - -
example-filefilecompanion-relation is installed - -```json -["optional"] -``` - - - - -```json -{ - "companion": [ - "companion-relation" - ] -} -``` - -
- -An example of this would be to present alternative files for different modloaders in the case of a mod. -Let's consider this example addon: - -```json -{ - "addonscript": { "version": 2 }, - "id": "example-addon", - "version": "0.1.0", - "relations": [ - { - "id": "forge", - "version": "37.0", - "flags": ["optional"] - }, - { - "id": "fabric", - "version": "9.0", - "flags": ["optional"] - }, - { - "id": "fabric-api", - "version": "0.42.1", - "flags": ["optional"], - "conditions": { - "companion": ["fabric"] - } - } - ], - "files": [ - { - "id": "example-addon-forge", - "url": "./example_addon_forge.jar", - "conditions": { - "companion": ["forge"] - }, - "flags": ["optional"] - }, - { - "id": "example-addon-fabric", - "url": "./example_addon_fabric.jar", - "conditions": { - "companion": ["fabric"] - }, - "flags": ["optional"] - } - ] -} -``` - -This example addon provides files for forge and fabric, the files both having their -respective modloaders as companions. This allows a mod to ship files for both modloaders -without using different addons. - -Also note that the addon also adds the `fabric` relation to the `fabric-api` relation. -Thus it will also be installed if the fabric version of the mod is used. - -### exclude - -This is an array of addon IDs, which can't be installed together with this relation or file. diff --git a/docs/schema/file.md b/docs/schema/file.md index a697ff4..ca5a3d9 100644 --- a/docs/schema/file.md +++ b/docs/schema/file.md @@ -7,8 +7,7 @@ "flags": [], "maven": {}, "install": [], - "sha1": "somesha1checksum", - "conditions": {} + "sha1": "somesha1checksum" } ``` @@ -46,10 +45,6 @@ inherit the [side flags](../concepts/flags.md#side-flags) from the [version](add This is the sha1 checksum of the file. Although the checksum is optional, it is strongly recommended. -### conditions - -This is a [conditions object](conditions.md). It can only be used, if the [optional flag](../concepts/flags.md) was set. - ### maven ```json diff --git a/docs/schema/relation.md b/docs/schema/relation.md index 1825e63..ccfe780 100644 --- a/docs/schema/relation.md +++ b/docs/schema/relation.md @@ -6,8 +6,7 @@ "namespace": "com.example", "version": "[1.0]", "repositories": ["repo1"], - "flags": [], - "conditions": {} + "flags": [] } ``` @@ -44,7 +43,3 @@ the namespace from all defined repositories. This is an array of [flags](../concepts/flags.md) for this relation. If this property is not present in a relation object, the relation will inherit the [side flags](../concepts/flags.md#side-flags) from the [version](addon.md) and have the `required` flag set by default. - -### conditions - -This is a [conditions object](conditions.md). It can only be used, if the [optional flag](../concepts/flags.md) was set.