2020-06-19 16:31:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-10-17 03:09:44 +00:00
|
|
|
# shellcheck source=start-utils
|
|
|
|
. "${SCRIPTS:-$(dirname "$0")}/start-utils"
|
2020-06-19 16:31:56 +00:00
|
|
|
set -o pipefail
|
|
|
|
set -e
|
|
|
|
isDebugging && set -x
|
|
|
|
|
2020-06-19 20:34:56 +00:00
|
|
|
requireVar VANILLA_VERSION
|
2021-10-17 03:09:44 +00:00
|
|
|
: "${MOHIST_BUILD:=lastSuccessfulBuild}"
|
2020-06-19 20:34:56 +00:00
|
|
|
|
2021-05-22 03:05:22 +00:00
|
|
|
mohistJobs=https://ci.codemc.io/job/MohistMC/job/
|
2020-06-19 16:31:56 +00:00
|
|
|
mohistJob=${mohistJobs}Mohist-${VANILLA_VERSION}/
|
|
|
|
|
2021-10-17 03:09:44 +00:00
|
|
|
if ! get --exists "${mohistJob}"; then
|
2020-06-19 16:31:56 +00:00
|
|
|
log "ERROR: mohist builds do not exist for ${VANILLA_VERSION}"
|
2021-05-22 03:05:22 +00:00
|
|
|
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
2020-06-20 14:07:38 +00:00
|
|
|
log " and set VERSION accordingly"
|
2020-06-19 16:31:56 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-02-28 02:37:59 +00:00
|
|
|
buildRelPath=$(
|
2021-10-17 03:09:44 +00:00
|
|
|
get --json-path '$.artifacts[0].relativePath' "${mohistJob}${MOHIST_BUILD}/api/json"
|
2020-06-19 16:31:56 +00:00
|
|
|
)
|
|
|
|
|
2021-02-28 02:37:59 +00:00
|
|
|
baseName=$(basename "${buildRelPath}")
|
2020-06-19 16:31:56 +00:00
|
|
|
if [[ ${baseName} != *-server.jar* ]]; then
|
|
|
|
log "ERROR: mohist build for ${VANILLA_VERSION} is not a valid server jar, found ${baseName}"
|
2021-05-22 03:05:22 +00:00
|
|
|
log " check https://ci.codemc.io/job/MohistMC/ for available versions"
|
2020-06-20 14:07:38 +00:00
|
|
|
log " and set VERSION accordingly"
|
2020-06-19 16:31:56 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
export SERVER="/data/${baseName}"
|
|
|
|
|
2021-10-17 03:09:44 +00:00
|
|
|
if [ ! -f "${SERVER}" ]; then
|
2020-06-20 20:28:21 +00:00
|
|
|
log "Downloading ${baseName}"
|
2021-10-17 03:09:44 +00:00
|
|
|
get -o "${SERVER}" "${mohistJob}${MOHIST_BUILD}/artifact/${buildRelPath}"
|
2020-06-19 16:31:56 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
export SKIP_LOG4J_CONFIG=true
|
|
|
|
|
2021-12-11 02:50:40 +00:00
|
|
|
export FAMILY=HYBRID
|
2021-10-17 03:09:44 +00:00
|
|
|
exec "${SCRIPTS:-$(dirname "$0")}/start-setupWorld" "$@"
|