Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz

ARG MC_HELPER_VERSION=1.49.1
ARG MC_HELPER_VERSION=1.49.2
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
# used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1
Expand Down
Binary file added docs/img/modrinth-copy-project-id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/mods-and-plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ The newline delimiting allows for compose file usage like:
https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot
```

!!! note "Auto-removal"

Entries that are removed from the `MODS` or `PLUGINS` list will be automatically removed from the `mods` or `plugins` directory. This is useful for removing mods/plugins that are no longer needed. An empty `MODS` or `PLUGINS` list will remove all mods/plugins.

!!! note "Disable processing"

To temporarily disable processing of the `MODS` or `PLUGINS` list, then comment out the `MODS` or `PLUGINS` environment variable.

## Mod/Plugin URL Listing File

As an alternative to `MODS`/`PLUGINS`, the variable `MODS_FILE` or `PLUGINS_FILE` can be set with the container path or URL of a text file listing a mod/plugin URLs on each line. For example, the following
Expand Down
62 changes: 44 additions & 18 deletions docs/mods-and-plugins/modrinth.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,46 @@

[Modrinth](https://modrinth.com/) is an open source modding platform with a clean, easy to use website for finding [Fabric, Forge, etc mods](https://modrinth.com/mods) and [Paper, etc plugins](https://modrinth.com/plugins), and [datapacks](https://modrinth.com/datapacks). At startup, the container will automatically locate and download the newest versions of mod/plugin files that correspond to the `TYPE` and `VERSION` in use. Older file versions downloaded previously will automatically be cleaned up.

- **MODRINTH_PROJECTS** : comma or newline separated list of project slugs (short name) or IDs. The project ID is located in the "Technical information" section. The project slug is the part of the URL that follows `/mod/`, `/plugin/`, or `/datapack/`. For example:
```
## Usage

To use this feature, set the environment variable `MODRINTH_PROJECTS` to a comma or newline separated list of project slugs (short name) or IDs.

!!! tip "Project ID"

The project ID can be copied to the clipboard from the project page menu:

![Modrinth copy project ID](../img/modrinth-copy-project-id.png)

!!! tip "Project Slug"

The project slug is the part of the URL that follows `/mod/`, `/plugin/`, or `/datapack/`. For example:

```
https://modrinth.com/mod/fabric-api
----------
|
+-- project slug
```
Also, a specific version (or release type) can be declared adding a colon and then the version id, version number/name, or release type after the project slug. The version ID or number can be found in the 'Metadata' section. Valid release types are `release`, `beta`, `alpha`.

To select a datapack from a Modrinth project, prefix the entry with "datapack:". When running a vanilla server, this is optional since only datapacks will be available for vanilla servers to select.

You can also reference a file containing project entries by prefixing the **container path** path with `@`.

| Description | Example projects entry |
|---------------------------------|-------------------------------------------------------|
| Select latest version | `fabric-api` |
| Select specific version | `fabric-api:bQZpGIz0`<br/>`fabric-api:0.119.2+1.21.4` |
| Select latest beta version | `fabric-api:beta` |
| Latest version using project ID | `P7dR8mSH` |
| Latest version of datapack | `datapack:terralith` |
| Specific version of datapack | `datapack:terralith:2.5.5` |
| Projects Listing File | `@/path/to/modrinth-mods.txt` |
```

Also, a specific version (or release type) can be declared by adding a colon and then the version id, version number/name, or release type after the project slug. The version ID or number can be found in the 'Metadata' section. Valid release types are `release`, `beta`, `alpha`.

To select a datapack from a Modrinth project, prefix the entry with "datapack:". When running a vanilla server, this is optional since only datapacks will be available for vanilla servers to select.

You can also reference a file containing project entries by prefixing the **container path** path with `@`.

### Examples

| Description | Example projects entry |
|---------------------------------|-------------------------------------------------------|
| Select latest version | `fabric-api` |
| Select specific version | `fabric-api:bQZpGIz0`<br/>`fabric-api:0.119.2+1.21.4` |
| Select latest beta version | `fabric-api:beta` |
| Latest version using project ID | `P7dR8mSH` |
| Latest version of datapack | `datapack:terralith` |
| Specific version of datapack | `datapack:terralith:2.5.5` |
| Projects Listing File | `@/path/to/modrinth-mods.txt` |

### Notes

!!! info "More about listing files"

Expand All @@ -42,6 +60,14 @@
datapack:terralith
```

!!! note "Auto-removal"

Entries that are removed from the `MODRINTH_PROJECTS` list will be automatically removed from the `mods` or `plugins` directory. This is useful for removing mods/plugins that are no longer needed. An empty `MODRINTH_PROJECTS` list will remove all mods/plugins.

!!! note "Disable processing"

To temporarily disable processing of the `MODRINTH_PROJECTS` list, then comment out the `MODRINTH_PROJECTS` environment variable.

## Version from Projects

When the environment variable `VERSION_FROM_MODRINTH_PROJECTS` is set to "true" the Minecraft [`VERSION`](../versions/minecraft.md) will be automatically determined by looking at the most recent version of Minecraft that is supported by all the projects provided in `MODRINTH_PROJECTS`.
Expand Down
10 changes: 4 additions & 6 deletions scripts/start-setupModpack
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
set -e -o pipefail

: "${REMOVE_OLD_MODS:=false}"
: "${MODS:=}"
: "${MODS_OUT_DIR:=/data/mods}"
: "${MODS_FILE:=}"
: "${PLUGINS:=}"
: "${PLUGINS_OUT_DIR:=/data/plugins}"
: "${PLUGINS_FILE:=}"
: "${REMOVE_OLD_MODS_DEPTH:=1} "
Expand Down Expand Up @@ -94,7 +92,7 @@ fi

function handleListings() {
if usesMods && usesPlugins; then
if [[ "$MODS" ]]; then
if [[ -v MODS ]]; then

ensureRemoveAllModsOff "MODS is set"

Expand All @@ -105,7 +103,7 @@ function handleListings() {
--to="$MODS_OUT_DIR" \
"$MODS"
fi
if [[ "$PLUGINS" ]]; then
if [[ -v PLUGINS ]]; then
ensureRemoveAllModsOff "PLUGINS is set"
mkdir -p "$PLUGINS_OUT_DIR"
mc-image-helper mcopy \
Expand Down Expand Up @@ -140,14 +138,14 @@ function handleListings() {
outDir="$PLUGINS_OUT_DIR"
fi

if [[ "$MODS" || "$PLUGINS" ]]; then
if [[ -v MODS || -v PLUGINS ]]; then
ensureRemoveAllModsOff "MODS or PLUGINS is set"
mkdir -p "$outDir"
mc-image-helper mcopy \
--glob=*.jar \
--scope=var-list \
--to="$outDir" \
"$MODS" "$PLUGINS"
"${MODS:-}" "${PLUGINS:-}"
fi

if [[ "$MODS_FILE" || "$PLUGINS_FILE" ]]; then
Expand Down