2023-12-19 14:14:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# shellcheck source=start-utils
|
|
|
|
. "${SCRIPTS:-/}start-utils"
|
|
|
|
isDebugging && set -x
|
|
|
|
|
|
|
|
: "${FORGE_VERSION:=}"
|
|
|
|
: "${MAGMA_MAINTAINED_TAG:=}"
|
|
|
|
|
|
|
|
resolveVersion
|
|
|
|
|
|
|
|
if [ -z $MAGMA_MAINTAINED_TAG ]; then
|
2024-10-22 21:04:38 +00:00
|
|
|
logError "The variable MAGMA_MAINTAINED_TAG is not specified"
|
2023-12-19 14:14:56 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-12-29 14:57:13 +00:00
|
|
|
# Magma-1.12.2/releases/download/88659fb/Magma-1.12.2-88659fb-server.jar
|
|
|
|
# Magma-1.20.1/releases/download/adec9ce/magma-1.20.1-47.2.17-adec9ce-server.jar
|
|
|
|
if [[ ${VERSION} = "1.12.2" ]]; then
|
|
|
|
fileName="Magma-${VERSION}-${MAGMA_MAINTAINED_TAG}-server.jar"
|
|
|
|
else
|
|
|
|
if [ -z $FORGE_VERSION ]; then
|
2024-10-22 21:04:38 +00:00
|
|
|
logError "The variable FORGE_VERSION is not specified"
|
2023-12-29 14:57:13 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fileName="magma-${VERSION}-${FORGE_VERSION}-${MAGMA_MAINTAINED_TAG}-server.jar"
|
|
|
|
fi
|
|
|
|
downloadUrl="https://github.com/magmamaintained/Magma-${VERSION}/releases/download/${MAGMA_MAINTAINED_TAG}/${fileName}"
|
2023-12-19 14:14:56 +00:00
|
|
|
|
|
|
|
if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "$downloadUrl"); then
|
2024-10-22 21:04:38 +00:00
|
|
|
logError "Failed to download Magma Maintained server jar from $downloadUrl"
|
2023-12-19 14:14:56 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
export SERVER
|
|
|
|
export FAMILY=HYBRID
|
|
|
|
|
|
|
|
exec "${SCRIPTS:-/}start-spiget" "$@"
|