2019-07-10 03:19:59 +00:00
|
|
|
#!/bin/bash
|
2019-09-15 14:54:13 +00:00
|
|
|
set -eu
|
|
|
|
|
2021-10-09 20:22:42 +00:00
|
|
|
# shellcheck source=start-utils
|
2021-12-12 21:34:24 +00:00
|
|
|
. "${SCRIPTS:-/}start-utils"
|
2019-07-10 03:19:59 +00:00
|
|
|
|
|
|
|
export TYPE=FABRIC
|
2022-02-12 02:37:39 +00:00
|
|
|
: "${FABRIC_LAUNCHER_VERSION:=${FABRIC_INSTALLER_VERSION:-LATEST}}"
|
|
|
|
: "${FABRIC_LAUNCHER:=}"
|
|
|
|
: "${FABRIC_LAUNCHER_URL:=}"
|
2021-12-12 21:34:24 +00:00
|
|
|
: "${FABRIC_LOADER_VERSION:=LATEST}"
|
2019-07-10 03:19:59 +00:00
|
|
|
|
2023-01-09 01:15:24 +00:00
|
|
|
resultsFile=/data/.install-fabric.env
|
|
|
|
|
2021-07-10 19:56:10 +00:00
|
|
|
isDebugging && set -x
|
2019-07-10 03:19:59 +00:00
|
|
|
|
2022-02-12 02:37:39 +00:00
|
|
|
# Custom fabric jar
|
|
|
|
if [[ $FABRIC_LAUNCHER ]]; then
|
2023-01-09 01:15:24 +00:00
|
|
|
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
|
2022-02-12 02:37:39 +00:00
|
|
|
# Custom fabric jar url
|
|
|
|
elif [[ $FABRIC_LAUNCHER_URL ]]; then
|
2023-01-09 01:15:24 +00:00
|
|
|
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
|
2022-02-12 02:37:39 +00:00
|
|
|
# Official fabric launcher
|
|
|
|
else
|
2023-01-09 01:15:24 +00:00
|
|
|
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
|
2021-10-17 19:43:41 +00:00
|
|
|
fi
|
2022-02-12 02:37:39 +00:00
|
|
|
fi
|
2021-10-17 19:43:41 +00:00
|
|
|
|
2023-01-09 01:15:24 +00:00
|
|
|
# grab SERVER and export it
|
|
|
|
set -a
|
|
|
|
# shellcheck disable=SC1090
|
|
|
|
source "${resultsFile}"
|
|
|
|
set +a
|
2021-12-13 19:50:20 +00:00
|
|
|
|
2021-12-11 02:50:40 +00:00
|
|
|
export FAMILY=FABRIC
|
2021-12-12 21:34:24 +00:00
|
|
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|