addonscript-spec/docs/concepts/minecraft.md

3.8 KiB

Minecraft

Minecraft itself can be used as a relation in AddonScript manifests. This way addons MAY define, with which versions of Minecraft they are compatible. Instance addons MUST have their launch configuration based on the launch configuration of a Minecraft version. This way it is also defined, on which version of Minecraft an instance is base on. The version of Minecraft, which will be used, MUST be defined either by using the included relational flag with an exact Minecraft version or by using the expected relational flag, while the exact version later gets defined by the user or by the env relational flag. There is no AddonScript manifest for Minecraft, AddonScript implementations MUST know the ID and namespace of Minecraft and how to handle it as specified below.

ID and Namespace

The addon ID of Minecraft, which will be used for relations is minecraft and the namespace is net.minecraft.

Versions

The AddonScript version number of a Minecraft version is equal to the version ID from the piston-meta API of Mojang and the official version manifests used by the Minecraft launcher, except for the difference that characters, which are invalid in AddonScript versioning (whitespace and non-ASCII characters), will be replaced with an underscore (_).

Release

Release versions of Minecraft are SemVer compatible. Addons, which only use release versions as relations SHOULD use SemVer version ranges instead of Maven version ranges. Release versions are correctly ordered according to both, SemVer and Maven.

Alpha and Beta

Alpha and beta versions are all Minecraft versions before the initial release 1.0. They are not SemVer compatible. Most alpha and beta versions are correctly ordered according to Maven, except for some early alpha versions. AddonScript implementations SHOULD be careful when ordering alpha versions and SHOULD rather trust the information from piston-meta than the Maven order.

Snapshot

Snapshot versions are mostly neither SemVer compatible nor do they fit into Maven version ordering. AddonScript implementations SHOULD use piston-meta to order snapshot versions. When installing an addon into an instace, which is based on a snapshot version, AddonScript implementations SHOULD NOT trust the version range for Minecraft of that addon, as it might be incorrect due to version ordering. Instead the user SHOULD be asked, if the installation should be proceeded, and warned about possible incompatibilities.

Launch configuration

AddonScript implementations, which are meant to install or launch AddonScript instances MUST know the launch configuration for Minecraft itself. For the server side, the launch configuration only consists of the server jar, which already includes the required libraries and a manifest with 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 about the main file, the main class, all required libraries and launch arguments. In contrast to launch config modifications done by instance addons, 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 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 to retrieve game assets (if they are not already cached).