Files
docker-minecraft-server/scripts/start-deployFabric
2025-07-19 06:55:03 -05:00

60 lines
1.5 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}"
: "${FABRIC_FORCE_REINSTALL:=false}"
resultsFile=/data/.install-fabric.env
isDebugging && set -x
commonArgs=(
--results-file="${resultsFile}"
)
if isTrue "${FABRIC_FORCE_REINSTALL}"; then
log "Forcing re-install of Fabric"
commonArgs+=(--force-reinstall)
fi
# Custom fabric jar
if [[ $FABRIC_LAUNCHER ]]; then
if ! mc-image-helper install-fabric-loader \
"${commonArgs[@]}" \
--from-local-file="$FABRIC_LAUNCHER"; then
logError "Failed to use provided Fabric launcher"
exit 1
fi
# Custom fabric jar url
elif [[ $FABRIC_LAUNCHER_URL ]]; then
if ! mc-image-helper install-fabric-loader \
"${commonArgs[@]}" \
--from-url="$FABRIC_LAUNCHER_URL"; then
logError "Failed to installFabric launcher from $FABRIC_LAUNCHER_URL"
exit 1
fi
# Official fabric launcher
else
if ! mc-image-helper install-fabric-loader \
"${commonArgs[@]}" \
--minecraft-version="${VERSION}" \
--installer-version="${FABRIC_LAUNCHER_VERSION}" \
--loader-version="${FABRIC_LOADER_VERSION}"; then
logError "Failed to installFabric launcher given $VERSION, $FABRIC_LAUNCHER_VERSION, $FABRIC_LOADER_VERSION"
exit 1
fi
fi
applyResultsFile ${resultsFile}
export FAMILY=FABRIC
exec "${SCRIPTS:-/}start-setupWorld" "$@"