Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
Timo Ley | 25cf1e7561 | ||
Timo Ley | 3c2dd500a2 | ||
Timo Ley | f5f0d8c1e3 | ||
Timo Ley | a4ef1a5c34 | ||
Timo Ley | f2ca4f5177 | ||
Timo Ley | 6414425d5e | ||
Timo Ley | c7e68360fb | ||
Timo Ley | 41fe553787 |
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
The official AddonScript specification is available in the master branch of the
|
The official AddonScript specification is available in the master branch of the
|
||||||
[addonscript-spec](https://git.tilera.org/AddonScript/addonscript-spec) repository
|
[addonscript-spec](https://git.tilera.org/AddonScript/addonscript-spec) repository
|
||||||
and on [docs.addonscript.org](https://docs.addonscript.org/).
|
and on [spec.addonscript.org](https://spec.addonscript.org/).
|
||||||
|
|
||||||
## What is AddonScript?
|
## What is AddonScript?
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
- [AddonScript API](api/README.md)
|
- [AddonScript API](api/README.md)
|
||||||
- [Addon repository](api/features/addons.md)
|
- [Addon repository](api/features/addons.md)
|
||||||
- [File repository](api/features/files.md)
|
- [File repository](api/features/files.md)
|
||||||
- [Environment builder](api/features/env.md)
|
- [Environment builder](api/features/builder.md)
|
||||||
|
|
||||||
# Schema
|
# Schema
|
||||||
|
|
||||||
|
@ -19,13 +19,12 @@
|
||||||
- [Flags Object](schema/flags.md)
|
- [Flags Object](schema/flags.md)
|
||||||
- [Repository Object](schema/repository.md)
|
- [Repository Object](schema/repository.md)
|
||||||
- [Meta Object](schema/meta.md)
|
- [Meta Object](schema/meta.md)
|
||||||
- [Launch Config Object](schema/launch.md)
|
- [Launch Patch Object](schema/patch.md)
|
||||||
- [Library Object](schema/library.md)
|
|
||||||
- [API Addon Object](schema/api_addon.md)
|
- [API Addon Object](schema/api_addon.md)
|
||||||
- [API File Object](schema/api_file.md)
|
- [API File Object](schema/api_file.md)
|
||||||
- [Environment Builder Request Object](schema/api_env_request.md)
|
- [Environment Builder Request Object](schema/api_builder_request.md)
|
||||||
- [Addon Descriptor Object](schema/api_addon_descriptor.md)
|
- [Addon Descriptor Object](schema/api_addon_descriptor.md)
|
||||||
- [Environment Builder Response Object](schema/api_env_response.md)
|
- [Environment Builder Response Object](schema/api_builder_response.md)
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
|
|
|
@ -66,4 +66,4 @@ These API features are part of the AddonScript specification itself:
|
||||||
|
|
||||||
- `addons`: [Addon repository](./features/addons.md)
|
- `addons`: [Addon repository](./features/addons.md)
|
||||||
- `files`: [File repository](./features/files.md)
|
- `files`: [File repository](./features/files.md)
|
||||||
- `env`: [Environment builder](./features/env.md)
|
- `builder`: [Environment builder](./features/builder.md)
|
|
@ -4,48 +4,49 @@
|
||||||
|
|
||||||
### Build launch environment
|
### Build launch environment
|
||||||
|
|
||||||
`POST {base URL}/v2/env`
|
`POST {base URL}/v2/builder`
|
||||||
|
|
||||||
This endpoint can be used to build the launch environment for an [instance addon](../../concepts/instance.md).
|
This endpoint can be used to build the launch environment for an [instance addon](../../concepts/instance.md).
|
||||||
|
|
||||||
If an [instance addon](../../concepts/instance.md), which has to provide a launch configuration, has the
|
If an [instance addon](../../concepts/instance.md), which has to provide a launch configuration, has
|
||||||
`env` [manifest flag](../../concepts/flags.md#manifest-flags), AddonScript will send a request to this
|
[`use_builder`](../../schema/manifest.md#use_builder) set to `true`, AddonScript will send a request to this
|
||||||
endpoint of an API instance, on which the [repository](../../schema/repository.md) of the
|
endpoint of an API instance, on which the [repository](../../schema/repository.md) of the
|
||||||
[namespace](../../schema/manifest.md#namespace) of this addon can be found.
|
[namespace](../../schema/manifest.md#namespace) of this addon can be found.
|
||||||
This request contains information about the AddonScript [schema version](../../schema/api_env_request.md#addonscript),
|
This request contains information about the AddonScript [schema version](../../schema/api_builder_request.md#addonscript),
|
||||||
which will be used in the request and about which [addon](../../schema/api_env_request.md#addon) this request is for.
|
which will be used in the request and about which [addon](../../schema/api_builder_request.md#addon) this request is for.
|
||||||
Moreover it contains for both sides a list of addons, including their version, which will be part of the
|
Moreover it contains for both sides a list of addons, including their version, which will be part of the
|
||||||
[addon](../../schema/api_env_request.md#addon) in this environment on that side. The [manifest](../../schema/manifest.md)
|
[addon](../../schema/api_builder_request.md#addon) in this environment on that side. The [manifest](../../schema/manifest.md)
|
||||||
of this [addon](../../schema/api_env_request.md#addon) uses the `env` [relation flag](../../concepts/flags.md#relational-flags)
|
of this [addon](../../schema/api_builder_request.md#addon) uses the `expected` [relation flag](../../concepts/flags.md#relational-flags)
|
||||||
to tell AddonScript, which [related addons](../../schema/relation.md) MAY and which MUST be requested on this endpoint
|
to tell AddonScript, which [related addons](../../schema/relation.md) MAY and which MUST be requested on this endpoint
|
||||||
and which [versions](../../schema/relation.md#version) of them are valid. Which exact version of them and which optional
|
and which [versions](../../schema/relation.md#version) of them are valid. Which exact version of them and which optional
|
||||||
addons will be requested is either decided by the user, if the instance addon is installed manually, or by another
|
addons will be requested is either decided by the user, if the instance addon is installed manually, or by another
|
||||||
[instance addon](../../concepts/instance.md), which delegates the launch configuration to this addon. In later case,
|
[instance addon](../../concepts/instance.md), which inherits the launch configuration from this addon. In later case,
|
||||||
that [instance addon](../../concepts/instance.md) uses the `env` [relation flag](../../concepts/flags.md#relational-flags)
|
that [instance addon](../../concepts/instance.md) uses the `env` [relation flag](../../concepts/flags.md#relational-flags)
|
||||||
to specify an exact version for each addon, that will be requested. Each required `env` addon MUST be covered this way
|
to specify an exact version for each addon, that will be requested. Each required `expected` addon MUST be covered this way
|
||||||
while only those optional `env` addons will be requested, which are covered this way. Lastly the request also contains
|
while only those optional `expected` addons will be requested, which are covered this way. Lastly the request also contains
|
||||||
for each side a list of all [related addons](../../schema/relation.md) of this one, which are or will be installed
|
for each side a list of all [related addons](../../schema/relation.md) of this one, which are or will be installed
|
||||||
into this instance, including their version. This does not include [relations](../../schema/relation.md) with the
|
into this instance, including their version. This does not include [relations](../../schema/relation.md) with the
|
||||||
`env` [relation flag](../../concepts/flags.md#relational-flags).
|
`expected` [relation flag](../../concepts/flags.md#relational-flags).
|
||||||
|
|
||||||
Since the API instance MAY download files or build/compile things to build the launch environment, this request MAY
|
Since the API instance MAY download files or build/compile things to build the launch environment, this request MAY
|
||||||
take some time so the client implementation SHOULD set the request timeout for this endpoint rather high. It is
|
take some time so the client implementation SHOULD set the request timeout for this endpoint rather high. It is
|
||||||
RECOMMENDED to have a timeout of at least 5 minutes, better about 10 minutes.
|
RECOMMENDED to have a timeout of at least 5 minutes, better about 10 minutes.
|
||||||
|
|
||||||
After the launch environment was build by the API instance, this endpoint will respond with a list of
|
After the launch environment was build by the API instance, this endpoint will respond with a list of
|
||||||
[file objects](../../schema/api_env_response.md#files) and the AddonScript
|
[file objects](../../schema/api_builder_response.md#files), the AddonScript
|
||||||
[schema version](../../schema/api_env_response.md#addonscript) for the response. These files MUST be considered
|
[schema version](../../schema/api_builder_response.md#addonscript) for the response and the
|
||||||
to be part of the [files](../../schema/manifest.md#files) of the addon, from which the request was send
|
[launch configuration](../../concepts/instance.md#launch-configurations) for this addon.
|
||||||
and can then be installed.
|
These files MUST be considered to be part of the [files](../../schema/manifest.md#files) of the addon,
|
||||||
|
from which the request was send and can then be installed. The launch configuration will override the entirely.
|
||||||
|
|
||||||
#### Request Body:
|
#### Request Body:
|
||||||
|
|
||||||
The request body MUST be an [Environment Builder Request Object](../../schema/api_env_request.md).
|
The request body MUST be an [Environment Builder Request Object](../../schema/api_builder_request.md).
|
||||||
|
|
||||||
#### Responses:
|
#### Responses:
|
||||||
|
|
||||||
- `200 OK`: The launch environment was successfully build.
|
- `200 OK`: The launch environment was successfully build.
|
||||||
The response body MUST be an [Environment Builder Response Object](../../schema/api_env_response.md).
|
The response body MUST be an [Environment Builder Response Object](../../schema/api_builder_response.md).
|
||||||
- `400 Bad Request`: The server was not able to build the launch environment because of
|
- `400 Bad Request`: The server was not able to build the launch environment because of
|
||||||
invalid information send by the client. The client SHOULD NOT try this request on
|
invalid information send by the client. The client SHOULD NOT try this request on
|
||||||
another API instance, since the request is invalid.
|
another API instance, since the request is invalid.
|
|
@ -16,39 +16,43 @@ addon manifest, including for which side it is available and for which side it i
|
||||||
meaning, that this addon is not required on this side to be compatible, even if the other side has this addon installed.
|
meaning, that this addon is not required on this side to be compatible, even if the other side has this addon installed.
|
||||||
- `incompatible` This flag specifies, that the manifest is not compatible with the side which has this flag set.
|
- `incompatible` This flag specifies, that the manifest is not compatible with the side which has this flag set.
|
||||||
If a side has this flag, this side will completly be ignored for the manifest.
|
If a side has this flag, this side will completly be ignored for the manifest.
|
||||||
- `env` This flag is only valid for [instance addons](instance.md). It specifies, that the
|
|
||||||
[environment builder API](../api/features/env.md) will be used to get the launch files for this addon.
|
|
||||||
An addon with this flag MUST have a [repository](../schema/repository.md) for it's
|
|
||||||
[canonical namespace](../schema/manifest.md#namespace).
|
|
||||||
|
|
||||||
## Relational flags
|
## Relational flags
|
||||||
|
|
||||||
- `required` This flag specifies, that the related addon or file is required for the addon. If the addon gets installed,
|
- `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.
|
then 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,
|
- `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.
|
the user SHOULD be able to choose, whether he wants to install the relation or file with this flag, or not.
|
||||||
- `included` This flag is only valid for relations. It specifies, that the related addon is included in this one.
|
- `included` This flag is only valid for relations. It specifies, that the related addon is included in this one.
|
||||||
This also means, that if some addon requires the related addon, it can also be installed with this addon instead.
|
This also means, that if some addon requires the related addon, it can also be installed with this addon instead.
|
||||||
Relations with this flag MUST have an exact version specified, a version range, which includes multiple versions
|
Relations with this flag MUST have an exact version specified, a version range, which includes multiple versions
|
||||||
is not allowed. If this flag is used together with `required` or `optional`, the files of the related addon will
|
is not allowed. If this flag is used together with `required` or `optional`, the files of the related addon will
|
||||||
be installed like if the relation wouldn't have this flag, relations of the related addon will however be ignored
|
be installed like if the relation wouldn't have this flag, transistive relations will however be ignored
|
||||||
since AddonScript assumes, that they are already covered by this addon.
|
since AddonScript assumes, that they are already covered by this addon.
|
||||||
- `incompatible` This flag specifies for a relation, that the related addon is incompatible to this one, which means,
|
- `incompatible` This flag specifies for a relation, that the related addon is incompatible to this one, which means,
|
||||||
that they can't be installed together in the same instance. For a file this flag specifies, that the file can't be
|
that they can't be installed together in the same instance. For a file this flag specifies, that the file can't be
|
||||||
installed on the side which has this flag set.
|
installed on the side which has this flag set.
|
||||||
- `launch` This flag is only valid for relations of [instance addons](instance.md). It specifies, that the
|
- `launch` This flag is only valid for relations and files of [instance addons](instance.md). For relations, it specifies,
|
||||||
[launch configuration](../schema/launch.md) should be inherited from the related addon (which MUST als be an
|
that the [launch patches](../schema/patch.md) from the related addon (which MUST also be an instance addon) will also be
|
||||||
instance addon or [Minecraft](./minecraft.md) itself). The inherited launch configuration, MAY still be modified
|
applied for this addon, including those inherited by other addons using the `patch` flag or the `launch` flag. This flag
|
||||||
using the [launch object](../schema/launch.md) of this addon. This flag always also implies any effect of `required`.
|
will also inherit the main file of the relation, if it has any. `launch` only applies for one relation. If multiple relations
|
||||||
- `env` This flag is only valid for relations of [instance addons](instance.md). It MUST only be used for instance
|
have the `launch` flag, it only applies for the first of them, which will be installed in the instance.
|
||||||
addons, that either have the `env` [manifest flag](#manifest-flags) or are delegating the launch configuration
|
For files, it specifies, that the file will be the main jar for this instance. `launch` only applies for one file. If multiple
|
||||||
to such an addon. This flag speficies, that the related addon will be [requested](../schema/api_env_request.md#requested)
|
files have the `launch` flag, it only applies for the first of them, which will be installed in the instance.
|
||||||
to be part of the [launch environment](../api/features/env.md#build-launch-environment). For the addon, for
|
- `env` (DEPRECATED) This flag is only valid for relations of [instance addons](instance.md).
|
||||||
which the launch environment will be build, it is used together with the `required` or `optional` flag
|
An addon, that is inheriting the launch configuration from one, which uses the
|
||||||
to specify, which addons are required for the launch environment, which are optional and which versions
|
[environment builder](../api/features/builder.md), uses this flag to tell AddonScript, which version of the `expected`
|
||||||
of them are valid. An addon, that is delegating the launch configuration to one, which has the `env`
|
addons will be requested for the environment by setting an exact [version](../schema/relation.md#version) for the relation.
|
||||||
[manifest flag](#manifest-flags), uses this flag to tell AddonScript, which version of the addons will be requested
|
It also tells AddonScript, which optional `expected` addons will be part of the environment and which not.
|
||||||
for the environment by setting an exact [version](../schema/relation.md#version) for the relation. It also tells
|
- `expected` (DEPRECATED) This flag is only valid for relations of [instance addons](instance.md), which use the
|
||||||
AddonScript, which optional `env` addons will be part of the environment. If an addon with the `env`
|
[environment builder](../api/features/builder.md). This flag speficies, that this addon expects the related addon
|
||||||
[manifest flag](#manifest-flags) gets manually installed, meaning not as a dependency, the user SHOULD be asked,
|
to be [requested](../schema/api_builder_request.md#requested) as a part of the
|
||||||
which optional `env` addons and which version of each `env` addon will be requested.
|
[launch environment](../api/features/builder.md#build-launch-environment).
|
||||||
|
It is used together with the `required` or `optional` flag to specify, which addons are required for the launch
|
||||||
|
environment, which are optional and which versions of them are valid. If an addon, which uses the
|
||||||
|
[environment builder](../api/features/builder.md), gets manually installed, meaning not as a dependency, the user
|
||||||
|
SHOULD be asked, which optional `expected` addons and which version of each `expected` addon will be requested.
|
||||||
|
- `patch` This flag is only valid for relations of [instance addons](instance.md). It specifies, that the
|
||||||
|
[launch patches](../schema/patch.md) from the related addon (which MUST also be an instance addon) will be also be
|
||||||
|
applied for this addon. This flag is not transistive, `patch` flags of the related addon will be ignored.
|
||||||
|
If used in conjunction with `optional`, this flag will only take effect, if the relation will be installed.
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
args:
|
args:
|
||||||
|
|
||||||
- `[location]`
|
- `<location>`
|
||||||
|
|
||||||
`move` moves the file to the given location.
|
`move` moves the file to the given location.
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ args:
|
||||||
|
|
||||||
args:
|
args:
|
||||||
|
|
||||||
- `[location]`
|
- `<location>`
|
||||||
|
|
||||||
`extract` can be used with zip files, to extract the contents of the zip file
|
`extract` can be used with zip files, to extract the contents of the zip file
|
||||||
to the given location.
|
to the given location.
|
||||||
|
@ -23,17 +23,30 @@ to the given location.
|
||||||
|
|
||||||
args:
|
args:
|
||||||
|
|
||||||
- `[new name]`
|
- `<new name>`
|
||||||
|
|
||||||
`rename` renames the file to the new given filename.
|
`rename` renames the file to the new given filename.
|
||||||
|
|
||||||
|
### library
|
||||||
|
|
||||||
|
args:
|
||||||
|
|
||||||
|
- `<namespace>`
|
||||||
|
- `<name>`
|
||||||
|
- `<version>`
|
||||||
|
|
||||||
|
`library` can be used with jar files, to add them to the classpath of the game.
|
||||||
|
If a library with the same `<namespace>` and `<name>`, as specified in the arguments
|
||||||
|
of this action, was already added to the classpath, it will be replaced by this one.
|
||||||
|
This install action can only be used by [instance addons](./instance.md).
|
||||||
|
|
||||||
### inject
|
### inject
|
||||||
|
|
||||||
`inject` can be used with zip or jar files, to inject the contents of that file
|
`inject` can be used with zip or jar files, to inject the contents of that file
|
||||||
into the server launch jar on server side or into the client jar on client side.
|
into the server launch jar on server side or into the client jar on client side.
|
||||||
In contrast to libraries, `inject` will not add just that file to the classpath, but
|
In contrast to libraries, `inject` will not add just that file to the classpath, but
|
||||||
will also overwrite classes, which are already contained in the game jar, if they
|
will also overwrite classes, which are already contained in the game jar, if they
|
||||||
are also in injected file.
|
are also in injected file. This install action can only be used by [instance addons](./instance.md).
|
||||||
|
|
||||||
## Locations
|
## Locations
|
||||||
|
|
||||||
|
|
|
@ -1,32 +1,47 @@
|
||||||
# Instance addons
|
# Instance addons
|
||||||
|
|
||||||
Instance addons represent instances of Minecraft itself, while non-instance addons
|
Instance addons represent instances of Minecraft itself, while non-instance addons
|
||||||
have to be installed into an existing instance of Minecraft. An instance addon MUST have
|
have to be installed into an existing instance of Minecraft. An instance addon MAY have
|
||||||
a launch configuration for each side by inheriting the launch configuration of another
|
launch patches for each side by applying launch patches of other instance addons using
|
||||||
instance addon or [Minecraft](./minecraft.md) itself using the `launch` [flag](flags.md).
|
the `patch` [flag](flags.md) or by patching the [Minecraft](./minecraft.md)
|
||||||
Inheriting a launch configuration MAY be recursive which
|
launch configuration directly using a [launch patch object](../schema/patch.md).
|
||||||
means, that an instance addon MAY inherit it's launch configuration from another addon, which
|
Moreover they MAY override the main jar file using the `launch` [flag](flags.md)
|
||||||
|
or inherit the launch configuration, including main jar overrides and patches,
|
||||||
|
from another instance addon using the the `launch` [flag](flags.md).
|
||||||
|
The `launch` [flag](flags.md) is recursive which means, that an instance addon MAY
|
||||||
|
inherit it's launch configuration from another addon, which
|
||||||
itself inherits it. Instance addons MAY modify inherited launch configurations using a
|
itself inherits it. Instance addons MAY modify inherited launch configurations using a
|
||||||
[launch config object](../schema/launch.md) by overriding the main file or main class, or by
|
[launch patch object](../schema/patch.md) or override the main jar file. Inheriting a
|
||||||
adding libraries or launch arguments. Inheriting a launch configuration also includes any
|
launch configuration with the `launch` [flag](flags.md) also includes any
|
||||||
modifications to it.
|
modifications to it.
|
||||||
|
|
||||||
## Instance addons as relations
|
|
||||||
|
|
||||||
If an instance addon is a relation of another instance addon, each side of that
|
|
||||||
relation MUST have at least one of the [flags](flags.md) `included`, `launch`, `env`
|
|
||||||
or `incompatible`. Non-instance addons MAY have instance addons as relations without
|
|
||||||
this restriction.
|
|
||||||
|
|
||||||
## Launch configurations
|
## Launch configurations
|
||||||
|
|
||||||
Instance launch configurations are always based on a
|
Instance launch configurations are always based on a
|
||||||
[Minecraft launch config](./minecraft.md#launch-configuration) and MAY have modifications
|
[Minecraft launch config](./minecraft.md#launch-configuration) and MAY have patches
|
||||||
applied to it. Modifications are done by [launch config objects](../schema/launch.md) and
|
applied to it. Patches are done by [launch patch objects](../schema/patch.md), which
|
||||||
can override the main class or main file and include additional libraries and arugments.
|
can override the main class and include additional arguments. Moreover instance addons MAY also
|
||||||
|
add libraries to the classpath using the `library` [install action](./install.md#library).
|
||||||
When launching a Minecraft instance, AddonScript implementations SHOULD take the Minecraft
|
When launching a Minecraft instance, AddonScript implementations SHOULD take the Minecraft
|
||||||
launch configuration as specified [here](./minecraft.md#launch-configuration) and then apply
|
launch configuration as specified [here](./minecraft.md#launch-configuration) of the version,
|
||||||
all modifications by instance addons in the instance stack to it. When overriding the main class
|
on which the instance is based on, and then apply all patches of instance addons in the instance
|
||||||
or file, an instance addon has always priority over the instance addon, from which it inherits
|
to it. Patches are applied in the order [specified below](#patch-apply-order). Patches, which
|
||||||
the launch config. When adding arguments, they are always appended at the end of those
|
are applied later, MAY override settings from earlier patches.
|
||||||
arguments from the inherited launch config.
|
|
||||||
|
### Patch apply order
|
||||||
|
|
||||||
|
Patches are applied in the following order:
|
||||||
|
|
||||||
|
1. Patches inherited from the another instance addon using the `launch` [flag](flags.md). The
|
||||||
|
patches of that instance addon are applied according to the same order rules
|
||||||
|
2. Patches inherited from the another instance addon using the `patch` [flag](flags.md) in the order,
|
||||||
|
in which the addons are specified in the [relations array](../schema/manifest.md#relations)
|
||||||
|
3. Patches done directly by the instance addon using the [patches array](../schema/manifest.md#patches)
|
||||||
|
in the order, in which they are specified in the array.
|
||||||
|
|
||||||
|
## Main file
|
||||||
|
|
||||||
|
Instance addons MAY have a main jar file for each side. The main file MAY be specified for a side
|
||||||
|
using the `launch` [flag](flags.md) or MAY be inherited from another instance addon or from
|
||||||
|
[Minecraft](./minecraft.md) itself using the `launch` [flag](flags.md). If it is neither specified
|
||||||
|
nor inherited, the instance doesn't have a main jar file.
|
|
@ -2,9 +2,13 @@
|
||||||
|
|
||||||
Minecraft itself can be used as a [relation](../schema/relation.md) in AddonScript
|
Minecraft itself can be used as a [relation](../schema/relation.md) in AddonScript
|
||||||
[manifests](../schema/manifest.md). This way addons MAY define, with which versions
|
[manifests](../schema/manifest.md). This way addons MAY define, with which versions
|
||||||
of Minecraft they are compatible. [Instance addons](./instance.md) MUST either
|
of Minecraft they are compatible. Instances MUST be based on a Minecraft version.
|
||||||
directly or indirectly inherit their launch configuration from Minecraft. This
|
[Instance addons](./instance.md) MAY apply [patches](../schema/patch.md) to the
|
||||||
way it is also defined, on which version of Minecraft an instance is base on.
|
Minecraft version of the instance. The version of Minecraft,
|
||||||
|
which will be used, MUST be defined by the [instance addon](./instance.md) by
|
||||||
|
using the `required` [relational flag](./flags.md#relational-flags) with either
|
||||||
|
an exact version or a version range, in which case the user SHOULD be asked to
|
||||||
|
select a version, which fulfills all version restrictions in the instance.
|
||||||
There is no AddonScript manifest for Minecraft, AddonScript implementations
|
There is no AddonScript manifest for Minecraft, AddonScript implementations
|
||||||
MUST know the [ID and namespace](#id-and-namespace) of Minecraft and how to
|
MUST know the [ID and namespace](#id-and-namespace) of Minecraft and how to
|
||||||
handle it as specified below.
|
handle it as specified below.
|
||||||
|
@ -52,14 +56,14 @@ be proceeded, and warned about possible incompatibilities.
|
||||||
|
|
||||||
AddonScript implementations, which are meant to install or launch AddonScript
|
AddonScript implementations, which are meant to install or launch AddonScript
|
||||||
instances MUST know the launch configuration for Minecraft itself.
|
instances MUST know the launch configuration for Minecraft itself.
|
||||||
For the server side, the launch configuration only consists of the server jar,
|
For the server side, the launch configuration only consists of the server jar as
|
||||||
which already includes the required libraries and a manifest with the main class.
|
the main jar, which already includes the required libraries and a manifest with the
|
||||||
For the client side the launch configuration SHOULD be retrieved from the
|
main class. For the client side the launch configuration SHOULD be retrieved from the
|
||||||
piston-meta API in form of the version manifest. This manifest includes information
|
piston-meta API in form of the version manifest. This manifest includes information
|
||||||
about the main file, the main class, all required libraries and launch arguments.
|
about the main jar, the main class, all required libraries and launch arguments.
|
||||||
In contrast to launch config modifications done by [instance addons](./instance.md),
|
In contrast to [patches](../schema/patch.md) done by [instance addons](./instance.md),
|
||||||
arguments in the version manifest can include variables, which MUST be replaced with
|
arguments in the version manifest can include variables, which MUST be replaced with
|
||||||
the correct values when launching the game and both, libraries and arguments, can
|
the correct values when launching the game and both, libraries and arguments, can
|
||||||
be operating system or architecture specific, which MUST also be considered by
|
be operating system or architecture specific, which MUST also be considered by
|
||||||
implementations. Moreover they also provide an asset index, which SHOULD be used by
|
implementations. Moreover it also provides an asset index, which SHOULD be used by
|
||||||
implementations to retrieve game assets (if they are not already cached).
|
implementations to retrieve game assets (if they are not already cached).
|
|
@ -4,7 +4,8 @@
|
||||||
{
|
{
|
||||||
"addonscript": {},
|
"addonscript": {},
|
||||||
"files": [],
|
"files": [],
|
||||||
"launch": {}
|
"launch_client": {},
|
||||||
|
"launch_server": {},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -13,7 +14,7 @@
|
||||||
### addonscript
|
### addonscript
|
||||||
|
|
||||||
This is an [AddonScript object](addonscript.md) containing information about the version of AddonScript used in this response.
|
This is an [AddonScript object](addonscript.md) containing information about the version of AddonScript used in this response.
|
||||||
It MUST be equal to the [addonscript Property](api_env_request.md#addonscript) of the [request](api_env_request.md).
|
It MUST be equal to the [addonscript Property](api_builder_request.md#addonscript) of the [request](api_builder_request.md).
|
||||||
|
|
||||||
### files
|
### files
|
||||||
|
|
||||||
|
@ -22,6 +23,10 @@ environment was build, and MUST be treated equal to the [files in the manifest](
|
||||||
|
|
||||||
## Optional properties
|
## Optional properties
|
||||||
|
|
||||||
### launch
|
### launch_client
|
||||||
|
|
||||||
This is a [Launch Config object](./launch.md) which can be used, to modify the launch configuration of the instance.
|
This is a [Launch Config object](./patch.md) for the client, which can be used, to modify the launch configuration of the instance.
|
||||||
|
|
||||||
|
### launch_server
|
||||||
|
|
||||||
|
This is a [Launch Config object](./patch.md) for the server, which can be used, to modify the launch configuration of the instance.
|
|
@ -1,68 +0,0 @@
|
||||||
# Launch Config Object
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"libraries": [],
|
|
||||||
"java_version": 8,
|
|
||||||
"client": {},
|
|
||||||
"server": {}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Optional properties
|
|
||||||
|
|
||||||
|
|
||||||
### libraries
|
|
||||||
|
|
||||||
This is an array of [libraries](library.md), which are added to the instance in
|
|
||||||
addition to those of inherited launch configurations.
|
|
||||||
|
|
||||||
### java_version
|
|
||||||
|
|
||||||
This is the recommended major Java version for this instance. It MAY work on other
|
|
||||||
Java versions, but there is no guarantee for that. This overrides inherited `java_version`
|
|
||||||
settings.
|
|
||||||
|
|
||||||
### client
|
|
||||||
|
|
||||||
This is a [side config object](#side-config-object) containing the launch configuration
|
|
||||||
for the client.
|
|
||||||
|
|
||||||
### server
|
|
||||||
|
|
||||||
This is a [side config object](#side-config-object) containing the launch configuration
|
|
||||||
for the server.
|
|
||||||
|
|
||||||
# Side Config Object
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"main_file": "somefilequalifier",
|
|
||||||
"main_class": "com.example.SomeClass",
|
|
||||||
"arguments": ["--someArgument"]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Optional properties
|
|
||||||
|
|
||||||
### main_file
|
|
||||||
|
|
||||||
This is the [qualifier](./file.md#qualifier) of the main jar file for
|
|
||||||
this side. It will override any inherited main file for this side.
|
|
||||||
That file MUST be specified in the [manifest](./manifest.md), which
|
|
||||||
uses this library. Setting this to an empty string will indicate, that
|
|
||||||
there is no main file for this instance, in which case the
|
|
||||||
[main_file](#mainfile) MUST be explicitly configured.
|
|
||||||
|
|
||||||
### main_class
|
|
||||||
|
|
||||||
This is the main class for this instance, which will be used to launch
|
|
||||||
the game. It will override any inherited main class for this side.
|
|
||||||
Setting this to an empty string will indicate, that the main class
|
|
||||||
specified in of manifest of the [main jar file](#mainfile) should be used.
|
|
||||||
|
|
||||||
### arguments
|
|
||||||
|
|
||||||
This is an array of arguments, which will be used to launch the instance
|
|
||||||
in addition to inherited arguments. They will be appendes after inherited
|
|
||||||
arguments.
|
|
|
@ -1,24 +0,0 @@
|
||||||
# Library Object
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"file": "somequalifier",
|
|
||||||
"side": "both"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Required properties
|
|
||||||
|
|
||||||
### file
|
|
||||||
|
|
||||||
This is the [qualifier](./file.md#qualifier) of the file of this library.
|
|
||||||
That file MUST be specified in the [manifest](./manifest.md), which
|
|
||||||
uses this library.
|
|
||||||
|
|
||||||
### Optional properties
|
|
||||||
|
|
||||||
### side
|
|
||||||
|
|
||||||
This specifies, for which side this library should be used. Valid values
|
|
||||||
are `client`, `server` and `both`. If this property is not present,
|
|
||||||
it defaults to `both`.
|
|
|
@ -11,7 +11,8 @@
|
||||||
"flags": {},
|
"flags": {},
|
||||||
"repositories": [],
|
"repositories": [],
|
||||||
"instance": false,
|
"instance": false,
|
||||||
"launch": {},
|
"use_builder": false,
|
||||||
|
"patches": [],
|
||||||
"meta": {}
|
"meta": {}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -54,19 +55,25 @@ This is an array of [relation objects](relation.md) which represent addons in re
|
||||||
|
|
||||||
This is an array of [repository objects](repository.md). Each repository object defines one repository from which files or
|
This is an array of [repository objects](repository.md). Each repository object defines one repository from which files or
|
||||||
addons can be retrieved. Each AddonScript manifest SHOULD have a repository for the [canonical namespace](#namespace) of
|
addons can be retrieved. Each AddonScript manifest SHOULD have a repository for the [canonical namespace](#namespace) of
|
||||||
that manifest, from which AddonScript implementations MAY check for updates for this addon. If this addon has the `env`
|
that manifest, from which AddonScript implementations MAY check for updates for this addon. If [use_builder](#use_builder) is `true`,
|
||||||
[manifest flag](../concepts/flags.md#manifest-flags), it MUST have such a repository to provide API instances, which can
|
this addon MUST have such a repository to provide API instances, which can be used to request the
|
||||||
be used to request the [launch environment](../api/features/env.md#build-launch-environment).
|
[launch environment](../api/features/builder.md#build-launch-environment).
|
||||||
|
|
||||||
### instance
|
### instance
|
||||||
|
|
||||||
This is a boolean which specifies, if this addon is an [instance addon](../concepts/instance.md).
|
This is a boolean which specifies, if this addon is an [instance addon](../concepts/instance.md).
|
||||||
If this property is not present, it defaults to `false`.
|
If this property is not present, it defaults to `false`.
|
||||||
|
|
||||||
### launch
|
### use_builder
|
||||||
|
|
||||||
This is a [launch config object](launch.md) which can be used to modify the
|
This is a boolean which specifies, if this addon will use the [environment builder](../api/features/builder.md).
|
||||||
inherited launch configuration of this instance.
|
Only valid if [instance](#instance) is `true`.
|
||||||
|
If this property is not present, it defaults to `false`. (DEPRECATED)
|
||||||
|
|
||||||
|
### patches
|
||||||
|
|
||||||
|
This is an array of [patch object](patch.md) which can be used to modify t
|
||||||
|
he launch configuration of this instance.
|
||||||
Only available for [instance addons](../concepts/instance.md).
|
Only available for [instance addons](../concepts/instance.md).
|
||||||
|
|
||||||
### meta
|
### meta
|
||||||
|
|
98
docs/schema/patch.md
Normal file
98
docs/schema/patch.md
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
# Launch Patch Object
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"side": "client",
|
||||||
|
"main_class": "com.example.SomeClass",
|
||||||
|
"arguments": [],
|
||||||
|
"jvm_arguments": ["-Djvmargument"],
|
||||||
|
"replace_jvm_arguments": false,
|
||||||
|
"java_version": 8
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Required properties
|
||||||
|
|
||||||
|
### side
|
||||||
|
|
||||||
|
This specifies, for which side this patch should be applied. Valid values are `client`, `server` and `both`.
|
||||||
|
|
||||||
|
## Optional properties
|
||||||
|
|
||||||
|
### main_class
|
||||||
|
|
||||||
|
This is the main class for this instance, which will be used to launch
|
||||||
|
the game. It will override any main class from other patches for this side.
|
||||||
|
Setting this to an empty string will indicate, that the main class
|
||||||
|
specified in of manifest of the [main jar file](../concepts/instance.md#main-file)
|
||||||
|
should be used.
|
||||||
|
|
||||||
|
### arguments
|
||||||
|
|
||||||
|
This is an array of [game argument objects](#game-argument-object), which will be
|
||||||
|
used to launch the instance in addition to arguments from other patches.
|
||||||
|
|
||||||
|
### jvm_arguments
|
||||||
|
|
||||||
|
This is an array of JVM arguments, which will be used to launch the instance
|
||||||
|
in addition to inherited JVM arguments. They will be appended after JVM arguments
|
||||||
|
from other patches.
|
||||||
|
|
||||||
|
### replace_jvm_arguments
|
||||||
|
|
||||||
|
This is a boolean which indicates, if the [JVM arguments](#jvmarguments) from
|
||||||
|
this patch should replace all other JVM arguments from other patches instead of
|
||||||
|
appending them. Defaults to `false`.
|
||||||
|
|
||||||
|
### java_version
|
||||||
|
|
||||||
|
This is the recommended major Java version for this instance. It MAY work on other
|
||||||
|
Java versions, but there is no guarantee for that. This overrides `java_version`
|
||||||
|
settings from other patches.
|
||||||
|
|
||||||
|
# Game Argument Object
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"mode": "replace", //replace, append, expand, override
|
||||||
|
"key": "tweakerClass",
|
||||||
|
"value": "net.anvilcraft.SomeTweaker",
|
||||||
|
"raw": "--some ArguemtnString"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Required properties
|
||||||
|
|
||||||
|
### mode
|
||||||
|
|
||||||
|
This is the mode, which defines how the argument is added to the other arguments.
|
||||||
|
Possible values are:
|
||||||
|
|
||||||
|
- `replace` Removes all arguments with the same `key` as this one and adds this argument
|
||||||
|
instead. Prevents other arguments with the same `key` to be added laster, except they
|
||||||
|
are also using the `replace` mode. Requires `key` to be set.
|
||||||
|
- `append` Appends the argument to the previous ones.
|
||||||
|
- `expand` Appends the argument to the previous ones, if none with the same key was already
|
||||||
|
added. Requires `key` to be set.
|
||||||
|
- `override` Overrides all previous arguments with those specified in `raw`
|
||||||
|
Requires `raw` to be set.
|
||||||
|
|
||||||
|
## Optional properties
|
||||||
|
|
||||||
|
### key
|
||||||
|
|
||||||
|
This is the key of the argument, which MUST be a string. If used together with
|
||||||
|
`value` the resulting game argument will be in the form `--<key> <value>`.
|
||||||
|
If `raw` is not set, this property is required.
|
||||||
|
|
||||||
|
### value
|
||||||
|
|
||||||
|
This is the value of the argument, which MUST be a string. It is used together
|
||||||
|
with `key` to generate the resulting game argument. Defaults to an empty string.
|
||||||
|
|
||||||
|
### raw
|
||||||
|
|
||||||
|
This is a string, which can override the resulting game argument. If this is set,
|
||||||
|
the resulting game argument will be equal to this string instead of the generated
|
||||||
|
argument. `key` MAY still be used in conjunction with this and MUST be considered
|
||||||
|
by the `mode`.
|
|
@ -19,8 +19,8 @@ This is an array of base URLs of [AddonScript API](../api) instances, on which t
|
||||||
repository can be found. To get an addon from this repository, AddonScript will
|
repository can be found. To get an addon from this repository, AddonScript will
|
||||||
try to get it from the [addon endpoint](../api/features/addons.md#get-addon)
|
try to get it from the [addon endpoint](../api/features/addons.md#get-addon)
|
||||||
of these API instances in the order, in which they are specified in this array.
|
of these API instances in the order, in which they are specified in this array.
|
||||||
Instances in this array with the `env` [feature](../api/features/env.md) will
|
Instances in this array with the `builder` [feature](../api/features/builder.md) will
|
||||||
be used by AddonScript, to request the launch environment for an addon with a
|
be used by AddonScript, to request the launch environment for an addon with a
|
||||||
[canonical namespace](../concepts/namespaces.md#canonical-namespaces) equal
|
[canonical namespace](../concepts/namespaces.md#canonical-namespaces) equal
|
||||||
to the [namespace](#namespace) of this repository. The first API instance with
|
to the [namespace](#namespace) of this repository. The first API instance with
|
||||||
the `env` feature will be used in this case with the others as fallback.
|
the `builder` feature will be used in this case with the others as fallback.
|
Loading…
Reference in a new issue