mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-10-28 13:15:42 +00:00
Allow custom modloader versions for auto curseforge (#3759)
This commit is contained in:
1 parent
85673fb661
commit
c26119b512
5 files changed
+55
-1
No files matched your search
+1
-1
@@ -49,7 +49,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
|
--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
|
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_HELPER_VERSION=1.50.6
|
ARG MC_HELPER_VERSION=1.50.8
|
||||||
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
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
|
# used for cache busting local copy of mc-image-helper
|
||||||
ARG MC_HELPER_REV=1
|
ARG MC_HELPER_REV=1
|
||||||
|
|||||||
@@ -137,6 +137,30 @@ The following examples all refer to version 1.0.7 of ATM8:
|
|||||||
|
|
||||||
Pinning modpack version also pins the mod loader (to the version specified by the modpack). Mod loader version cannot be pinned independently of the modpack.
|
Pinning modpack version also pins the mod loader (to the version specified by the modpack). Mod loader version cannot be pinned independently of the modpack.
|
||||||
|
|
||||||
|
### Custom modloader versions
|
||||||
|
|
||||||
|
By default, AUTO_CURSEFORGE will use the exact modloader version declared by the modpack. However, you can override the modloader version by setting the following environment variable:
|
||||||
|
|
||||||
|
- `CF_MOD_LOADER_VERSION`: Override the mod loader version (e.g., `43.4.22`)
|
||||||
|
|
||||||
|
!!! example "Override mod loader version"
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
environment:
|
||||||
|
MODPACK_PLATFORM: AUTO_CURSEFORGE
|
||||||
|
CF_API_KEY: ${CF_API_KEY}
|
||||||
|
CF_SLUG: all-the-mods-8
|
||||||
|
CF_MOD_LOADER_VERSION: "43.4.22"
|
||||||
|
```
|
||||||
|
|
||||||
|
```title="Using docker run"
|
||||||
|
docker run -e CF_MOD_LOADER_VERSION=43.4.22 -e CF_SLUG=my-fabric-pack ...
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! warning "Compatibility"
|
||||||
|
|
||||||
|
Using a custom modloader version that differs significantly from what the modpack was designed for may cause compatibility issues. Use this feature carefully and test thoroughly.
|
||||||
|
|
||||||
## Manual Downloads
|
## Manual Downloads
|
||||||
|
|
||||||
For mod, modpacks, and world files that are not allowed for automated download, the container path `/downloads` can be attached and matching files will be retrieved from there. The subdirectories `mods`, `modpacks`, and `worlds` will also be checked accordingly. To change the source location of downloaded files, set `CF_DOWNLOADS_REPO` to an existing container path. To disable this feature, set `CF_DOWNLOADS_REPO` to an empty string.
|
For mod, modpacks, and world files that are not allowed for automated download, the container path `/downloads` can be attached and matching files will be retrieved from there. The subdirectories `mods`, `modpacks`, and `worlds` will also be checked accordingly. To change the source location of downloaded files, set `CF_DOWNLOADS_REPO` to an existing container path. To disable this feature, set `CF_DOWNLOADS_REPO` to an empty string.
|
||||||
|
|||||||
@@ -818,6 +818,12 @@ alternatively, you can mount: <code>/etc/localtime:/etc/localtime:ro
|
|||||||
<td><code>false</code></td>
|
<td><code>false</code></td>
|
||||||
<td>⬜️</td>
|
<td>⬜️</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>CF_MOD_LOADER_VERSION</code></td>
|
||||||
|
<td>Override the mod loader version declared by the modpack</td>
|
||||||
|
<td><code></code></td>
|
||||||
|
<td>⬜️</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
services:
|
||||||
|
mc:
|
||||||
|
image: itzg/minecraft-server
|
||||||
|
environment:
|
||||||
|
EULA: "TRUE"
|
||||||
|
MODPACK_PLATFORM: AUTO_CURSEFORGE
|
||||||
|
# Allocate API key from https://console.curseforge.com/
|
||||||
|
CF_API_KEY: ${CF_API_KEY}
|
||||||
|
# Example of overriding modloader version for a Fabric modpack
|
||||||
|
# Refer to https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#api-key
|
||||||
|
CF_SLUG: "cobblemon-fabric"
|
||||||
|
# Override the mod loader version from the modpack
|
||||||
|
CF_MOD_LOADER_VERSION: "0.16.14"
|
||||||
|
MEMORY: "4G"
|
||||||
|
ports:
|
||||||
|
- "25565:25565"
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
stdin_open: true
|
||||||
|
tty: true
|
||||||
|
|
||||||
|
# See https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/mod-platforms/auto-curseforge/#custom-modloader-versions
|
||||||
@@ -22,6 +22,7 @@ set -eu
|
|||||||
: "${CF_MODPACK_MANIFEST:=}"
|
: "${CF_MODPACK_MANIFEST:=}"
|
||||||
: "${CF_API_CACHE_DEFAULT_TTL:=}" # as ISO-8601 duration, such as P2D or PT12H
|
: "${CF_API_CACHE_DEFAULT_TTL:=}" # as ISO-8601 duration, such as P2D or PT12H
|
||||||
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
|
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
|
||||||
|
: "${CF_MOD_LOADER_VERSION:=}" # Override mod loader version
|
||||||
|
|
||||||
resultsFile=/data/.install-curseforge.env
|
resultsFile=/data/.install-curseforge.env
|
||||||
|
|
||||||
@@ -66,6 +67,7 @@ setArg --exclude-mods CF_EXCLUDE_MODS
|
|||||||
setArg --force-include-mods CF_FORCE_INCLUDE_MODS
|
setArg --force-include-mods CF_FORCE_INCLUDE_MODS
|
||||||
setArg --exclude-include-file CF_EXCLUDE_INCLUDE_FILE
|
setArg --exclude-include-file CF_EXCLUDE_INCLUDE_FILE
|
||||||
setArg --downloads-repo CF_DOWNLOADS_REPO
|
setArg --downloads-repo CF_DOWNLOADS_REPO
|
||||||
|
setArg --mod-loader-version CF_MOD_LOADER_VERSION
|
||||||
|
|
||||||
if ! mc-image-helper install-curseforge "${args[@]}"; then
|
if ! mc-image-helper install-curseforge "${args[@]}"; then
|
||||||
logError "Failed to auto-install CurseForge modpack"
|
logError "Failed to auto-install CurseForge modpack"
|
||||||
|
|||||||
Reference in new issue
Block a user