diff --git a/Dockerfile b/Dockerfile index 08dde081ff7..4753a65e84c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/docs/types-and-platforms/server-types/forge.md b/docs/types-and-platforms/server-types/forge.md index e0f03bc195f..a86f587aa97 100644 --- a/docs/types-and-platforms/server-types/forge.md +++ b/docs/types-and-platforms/server-types/forge.md @@ -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" + ``` diff --git a/scripts/start-configuration b/scripts/start-configuration index 5e49e827abc..d5da1cae64c 100755 --- a/scripts/start-configuration +++ b/scripts/start-configuration @@ -185,6 +185,10 @@ case "${TYPE^^}" in exec "${SCRIPTS:-/}start-deployForge" "$@" ;; + NEOFORGE|NEOFORGED) + exec "${SCRIPTS:-/}start-deployNeoForge" "$@" + ;; + FABRIC) exec "${SCRIPTS:-/}start-deployFabric" "$@" ;; diff --git a/scripts/start-deployNeoForge b/scripts/start-deployNeoForge new file mode 100644 index 00000000000..3115f67d6d3 --- /dev/null +++ b/scripts/start-deployNeoForge @@ -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" "$@"