2021-02-09 02:42:54 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
IFS=$'\n\t'
|
|
|
|
|
|
|
|
. ${SCRIPTS:-/}start-utils
|
|
|
|
isDebugging && set -x
|
|
|
|
|
|
|
|
: ${VANILLA_VERSION:?}
|
2021-06-16 12:34:38 +00:00
|
|
|
: ${RELEASE:=latest}
|
2021-02-09 02:42:54 +00:00
|
|
|
: ${FORCE_REDOWNLOAD:=false}
|
|
|
|
|
|
|
|
requireEnum RELEASE stable latest
|
|
|
|
|
|
|
|
export SERVER="yatopia-${RELEASE}-${VANILLA_VERSION}.jar"
|
|
|
|
|
|
|
|
if [ ! -f "$SERVER" ] || isTrue "$FORCE_REDOWNLOAD"; then
|
|
|
|
downloadUrl="https://api.yatopiamc.org/v2/${RELEASE}Build/download?branch=ver/${VANILLA_VERSION}"
|
|
|
|
log "Downloading Yatopia from $downloadUrl ..."
|
|
|
|
if ! curl -fsSL -o "$SERVER" "$downloadUrl"; then
|
|
|
|
log "ERROR: failed to download from $downloadUrl (status=$?)"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Normalize on Spigot for later operations
|
|
|
|
export TYPE=SPIGOT
|
|
|
|
export SKIP_LOG4J_CONFIG=true
|
|
|
|
|
2021-09-16 02:27:48 +00:00
|
|
|
exec ${SCRIPTS:-/}start-setupWorld $@
|