Add support for youer and banner (#3484)

This commit is contained in:
kingcavespider1
2025-06-02 21:45:52 -04:00
committed by GitHub
parent 5416cedc1f
commit 6ede7e930c
3 changed files with 40 additions and 11 deletions

View File

@@ -49,6 +49,34 @@ By default the latest build will be used; however, a specific build number can b
-e VERSION=1.16.5 -e MOHIST_BUILD=374
### Youer
A [Youer](https://github.com/MohistMC/Youer) server can be used with
-e TYPE=YOUER
!!! note
There are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2"
By default the latest build will be used; however, a specific build number can be selected by setting `MOHIST_BUILD`, such as
-e VERSION=1.16.5 -e MOHIST_BUILD=374
### Banner
A [Banner](https://github.com/MohistMC/Banner) server can be used with
-e TYPE=BANNER
!!! note
There are limited base versions supported, so you will also need to set `VERSION`, such as "1.12.2"
By default the latest build will be used; however, a specific build number can be selected by setting `MOHIST_BUILD`, such as
-e VERSION=1.16.5 -e MOHIST_BUILD=374
### Catserver
A [Catserver](http://catserver.moe/) type server can be used with

View File

@@ -147,11 +147,11 @@ if isTrue "${ENABLE_AUTOSTOP}"; then
"${SCRIPTS:-/}start-autostop"
fi
if
if
[[ "$RCON_CMDS_STARTUP" ]] ||
[[ "$RCON_CMDS_ON_CONNECT" ]] ||
[[ "$RCON_CMDS_ON_DISCONNECT" ]] ||
[[ "$RCON_CMDS_FIRST_CONNECT" ]] ||
[[ "$RCON_CMDS_ON_DISCONNECT" ]] ||
[[ "$RCON_CMDS_FIRST_CONNECT" ]] ||
[[ "$RCON_CMDS_LAST_DISCONNECT" ]]
then
log "Starting RCON commands"
@@ -250,7 +250,7 @@ case "${TYPE^^}" in
exec "${SCRIPTS:-/}start-deployKetting" "$@"
;;
MOHIST)
MOHIST|YOUER|BANNER)
exec "${SCRIPTS:-/}start-deployMohist" "$@"
;;
@@ -286,7 +286,7 @@ case "${TYPE^^}" in
logError "Invalid TYPE: '$TYPE'"
logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT,"
logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH,"
logError " CANYON, LIMBO, CRUCIBLE, LEAF"
logError " CANYON, LIMBO, CRUCIBLE, LEAF, YOUER, BANNER"
exit 1
;;

View File

@@ -10,11 +10,12 @@ resolveVersion
: "${MOHIST_BUILD:=lastSuccessfulBuild}"
# Docs at https://mohistmc.com/mohistmc-api
mohistApiUrl="https://api.mohistmc.com/project/mohist"
mohistDownloadsPage="https://mohistmc.com/downloadSoftware?project=mohist"
mohistType="${TYPE,,}"
mohistApiUrl="https://api.mohistmc.com/project/${mohistType}"
mohistDownloadsPage="https://mohistmc.com/downloadSoftware?project=${mohistType}"
if ! get --exists "${mohistApiUrl}/${VERSION}/builds"; then
logError "Mohist builds do not exist for ${VERSION}"
logError "${mohistType} builds do not exist for ${VERSION}"
logError " check ${mohistDownloadsPage} for available versions"
logError " and set VERSION accordingly"
exit 1
@@ -25,7 +26,7 @@ if [[ "${MOHIST_BUILD}" == "lastSuccessfulBuild" ]]; then
if ! buildNumber=$(
get --json-path '$[0].id' "${mohistApiUrl}/${VERSION}/builds"
); then
logError "failed to list Mohist builds for ${VERSION}"
logError "failed to list ${mohistType} builds for ${VERSION}"
exit 1
fi
MOHIST_BUILD="${buildNumber}"
@@ -40,10 +41,10 @@ if [[ -z "${downloadUrl}" ]]; then
exit 1
fi
SERVER="/data/mohist-${VERSION}-${MOHIST_BUILD}-server.jar"
SERVER="/data/${mohistType}-${VERSION}-${MOHIST_BUILD}-server.jar"
if [ ! -f "${SERVER}" ]; then
log "Downloading Mohist build ${MOHIST_BUILD} for ${VERSION}"
log "Downloading ${mohistType^} build ${MOHIST_BUILD} for ${VERSION}"
get -o "${SERVER}" "${downloadUrl}"
fi