Added support for NeoForge (#2408)

This commit is contained in:
Geoff Bourne 2023-10-03 18:00:24 -05:00 committed by GitHub
parent d5e315bba8
commit fa235e97c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 1 deletions

View File

@ -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}} \
--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}
# used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1

View File

@ -35,3 +35,23 @@ In both of the cases above, there is no need for the `VERSION` or `FORGE_VERSION
!!! 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.
## 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"
```

View File

@ -185,6 +185,10 @@ case "${TYPE^^}" in
exec "${SCRIPTS:-/}start-deployForge" "$@"
;;
NEOFORGE|NEOFORGED)
exec "${SCRIPTS:-/}start-deployNeoForge" "$@"
;;
FABRIC)
exec "${SCRIPTS:-/}start-deployFabric" "$@"
;;

View File

@ -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" "$@"