mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-13 23:57:08 +00:00
52 lines
1.4 KiB
Bash
Executable file
52 lines
1.4 KiB
Bash
Executable file
#!/bin/bash
|
|
set -eu
|
|
|
|
# shellcheck source=start-utils
|
|
. "${SCRIPTS:-/}start-utils"
|
|
|
|
export TYPE=FABRIC
|
|
: "${FABRIC_LAUNCHER_VERSION:=${FABRIC_INSTALLER_VERSION:-LATEST}}"
|
|
: "${FABRIC_LAUNCHER:=}"
|
|
: "${FABRIC_LAUNCHER_URL:=}"
|
|
: "${FABRIC_LOADER_VERSION:=LATEST}"
|
|
|
|
resultsFile=/data/.install-fabric.env
|
|
|
|
isDebugging && set -x
|
|
|
|
# Custom fabric jar
|
|
if [[ $FABRIC_LAUNCHER ]]; then
|
|
if ! mc-image-helper install-fabric-loader \
|
|
--results-file=${resultsFile} \
|
|
--from-local-file="$FABRIC_LAUNCHER"; then
|
|
log "ERROR failed to install Fabric launcher from $FABRIC_LAUNCHER"
|
|
exit 1
|
|
fi
|
|
# Custom fabric jar url
|
|
elif [[ $FABRIC_LAUNCHER_URL ]]; then
|
|
if ! mc-image-helper install-fabric-loader \
|
|
--results-file=${resultsFile} \
|
|
--from-url="$FABRIC_LAUNCHER_URL"; then
|
|
log "ERROR failed to install Fabric launcher from $FABRIC_LAUNCHER_URL"
|
|
exit 1
|
|
fi
|
|
# Official fabric launcher
|
|
else
|
|
if ! mc-image-helper install-fabric-loader \
|
|
--results-file=${resultsFile} \
|
|
--minecraft-version="${VANILLA_VERSION}" \
|
|
--installer-version="${FABRIC_LAUNCHER_VERSION}" \
|
|
--loader-version="${FABRIC_LOADER_VERSION}"; then
|
|
log "ERROR failed to install Fabric launcher from $VANILLA_VERSION, $FABRIC_LAUNCHER_VERSION, $FABRIC_LOADER_VERSION"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# grab SERVER and export it
|
|
set -a
|
|
# shellcheck disable=SC1090
|
|
source "${resultsFile}"
|
|
set +a
|
|
|
|
export FAMILY=FABRIC
|
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|