addonscript-spec/docs/concepts/install.md

61 lines
1.6 KiB
Markdown
Raw Normal View History

2021-06-29 16:34:01 +02:00
# File installing
2022-08-26 21:56:07 +02:00
## Install actions
2021-06-29 16:34:01 +02:00
### move
2021-11-14 00:25:43 +01:00
args:
2021-11-14 00:25:43 +01:00
2023-08-16 10:18:35 +02:00
- `<location>`
2021-07-18 12:35:35 +02:00
`move` moves the file to the given location.
2021-06-29 16:34:01 +02:00
### extract
2021-11-14 00:25:43 +01:00
args:
2021-11-14 00:25:43 +01:00
2023-08-16 10:18:35 +02:00
- `<location>`
2021-07-18 12:35:35 +02:00
2021-07-18 12:32:57 +02:00
`extract` can be used with zip files, to extract the contents of the zip file
2021-06-29 16:34:01 +02:00
to the given location.
### rename
2021-11-14 00:25:43 +01:00
args:
2021-11-14 00:25:43 +01:00
2023-08-16 10:18:35 +02:00
- `<new name>`
2021-07-18 12:35:35 +02:00
2022-08-26 21:56:07 +02:00
`rename` renames the file to the new given filename.
2021-06-29 16:34:01 +02:00
2023-08-16 10:18:35 +02:00
### 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).
2022-02-17 11:49:51 +01:00
### inject
`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.
In contrast to libraries, `inject` will not add just that file to the classpath, but
2022-02-17 11:49:51 +01:00
will also overwrite classes, which are already contained in the game jar, if they
2023-08-16 10:18:35 +02:00
are also in injected file. This install action can only be used by [instance addons](./instance.md).
2022-02-17 11:49:51 +01:00
2021-06-29 16:34:01 +02:00
## Locations
Locations are specified as a relative path from the Minecraft directory to which the file will be installed.
2021-11-14 00:25:43 +01:00
For example `./mods` would point to the mods directory of the Minecraft instance.
2021-06-29 16:34:01 +02:00
## Directories
2022-08-26 21:56:07 +02:00
If the file is a directory, then it is treated like a zip file, which means, that you can move and
rename it like a normal file, but also use the `extract` install action to move all contents of the directory
2021-06-29 16:34:01 +02:00
to the specified location.