mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-10 18:45:09 +00:00
Added support for NeoForge (#2408)
This commit is contained in:
+1
-1
@@ -42,7 +42,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
|
|||||||
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
|
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
|
||||||
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
|
||||||
|
|
||||||
ARG MC_HELPER_VERSION=1.35.3
|
ARG MC_HELPER_VERSION=1.36.0
|
||||||
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
|
ARG MC_HELPER_BASE_URL=https://github.com/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
|
||||||
|
|||||||
@@ -35,3 +35,23 @@ In both of the cases above, there is no need for the `VERSION` or `FORGE_VERSION
|
|||||||
!!! note
|
!!! note
|
||||||
|
|
||||||
If an error occurred while installing Forge, it might be possible to resolve by temporarily setting `FORGE_FORCE_REINSTALL` to "true". Be sure to remove that variable after successfully starting the server.
|
If an error occurred while installing Forge, it might be possible to resolve by temporarily setting `FORGE_FORCE_REINSTALL` to "true". Be sure to remove that variable after successfully starting the server.
|
||||||
|
|
||||||
|
## Alternatives
|
||||||
|
|
||||||
|
### NeoForge
|
||||||
|
|
||||||
|
Support for [NeoForge](https://neoforged.net/) is also provided. A NeoForge server can be automatically managed by setting `TYPE` to "NEOFORGE". `VERSION` specifies the Minecraft version and `NEOFORGE_VERSION` can be set to select a specific sub-version. By default, the latest NeoForge version available for the requested Minecraft version will be used.
|
||||||
|
|
||||||
|
!!! example
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -e TYPE=NEOFORGE -e VERSION=1.20.1 -e NEOFORGE_VERSION=47.1.79 ...
|
||||||
|
```
|
||||||
|
|
||||||
|
or in a compose file
|
||||||
|
```yaml
|
||||||
|
environment:
|
||||||
|
TYPE: NEOFORGE
|
||||||
|
VERSION: "1.20.1"
|
||||||
|
NEOFORGE_VERSION: "47.1.79"
|
||||||
|
```
|
||||||
|
|||||||
@@ -185,6 +185,10 @@ case "${TYPE^^}" in
|
|||||||
exec "${SCRIPTS:-/}start-deployForge" "$@"
|
exec "${SCRIPTS:-/}start-deployForge" "$@"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
NEOFORGE|NEOFORGED)
|
||||||
|
exec "${SCRIPTS:-/}start-deployNeoForge" "$@"
|
||||||
|
;;
|
||||||
|
|
||||||
FABRIC)
|
FABRIC)
|
||||||
exec "${SCRIPTS:-/}start-deployFabric" "$@"
|
exec "${SCRIPTS:-/}start-deployFabric" "$@"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
: "${NEOFORGE_VERSION:=latest}"
|
||||||
|
: "${NEOFORGE_FORCE_REINSTALL:=false}}"
|
||||||
|
|
||||||
|
# shellcheck source=start-utils
|
||||||
|
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
||||||
|
isDebugging && set -x
|
||||||
|
|
||||||
|
resultsFile=/data/.run-neoforge.env
|
||||||
|
|
||||||
|
if ! mc-image-helper install-neoforge \
|
||||||
|
--output-directory=/data \
|
||||||
|
--results-file=${resultsFile} \
|
||||||
|
--minecraft-version="${VERSION}" \
|
||||||
|
--neoforge-version="${NEOFORGE_VERSION}" \
|
||||||
|
--force-reinstall="${NEOFORGE_FORCE_REINSTALL}"; then
|
||||||
|
log "ERROR failed to install Forge"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# grab SERVER and export it
|
||||||
|
set -a
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
source ${resultsFile}
|
||||||
|
set +a
|
||||||
|
|
||||||
|
export FAMILY=FORGE
|
||||||
|
|
||||||
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|
||||||
Reference in New Issue
Block a user