mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
fix(limbo): convert MOTD to JSON chat format (#1259)
This commit is contained in:
parent
c506cf11ac
commit
977d082638
@ -587,6 +587,8 @@ Configuration options with defaults:
|
|||||||
- `LIMBO_SCHEMA_FILENAME`=default.schem
|
- `LIMBO_SCHEMA_FILENAME`=default.schem
|
||||||
- `LEVEL`="Default;${LIMBO_SCHEMA_FILENAME}"
|
- `LEVEL`="Default;${LIMBO_SCHEMA_FILENAME}"
|
||||||
|
|
||||||
|
> NOTE: instead of using format codes in the MOTD, Limbo requires [JSON chat content](https://minecraft.fandom.com/wiki/Raw_JSON_text_format#Java_Edition). If a plain string is provided, which is the default, then it gets converted into the required JSON structure.
|
||||||
|
|
||||||
### Running a Crucible server
|
### Running a Crucible server
|
||||||
|
|
||||||
A [Crucible](https://github.com/CrucibleMC/Crucible) server can be run by setting `TYPE` to `CRUCIBLE`.
|
A [Crucible](https://github.com/CrucibleMC/Crucible) server can be run by setting `TYPE` to `CRUCIBLE`.
|
||||||
|
@ -48,7 +48,7 @@ function customizeServerProps {
|
|||||||
|
|
||||||
# If not provided, generate a reasonable default message-of-the-day,
|
# If not provided, generate a reasonable default message-of-the-day,
|
||||||
# which shows up in the server listing in the client
|
# which shows up in the server listing in the client
|
||||||
if [ -z "$MOTD" ]; then
|
if ! [ -v "$MOTD" ]; then
|
||||||
# snapshot is the odd case where we have to look at version to identify that label
|
# snapshot is the odd case where we have to look at version to identify that label
|
||||||
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
|
if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then
|
||||||
label=SNAPSHOT
|
label=SNAPSHOT
|
||||||
@ -62,6 +62,13 @@ function customizeServerProps {
|
|||||||
MOTD="A ${label} Minecraft Server powered by Docker"
|
MOTD="A ${label} Minecraft Server powered by Docker"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# normalize MOTD
|
||||||
|
if [[ ${TYPE^^} = LIMBO ]]; then
|
||||||
|
if [[ $MOTD ]] && ! [[ $MOTD =~ ^{ ]]; then
|
||||||
|
MOTD="{\"text\":\"${MOTD}\"}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
setServerProp "server-name" SERVER_NAME
|
setServerProp "server-name" SERVER_NAME
|
||||||
setServerProp "server-ip" SERVER_IP
|
setServerProp "server-ip" SERVER_IP
|
||||||
setServerProp "server-port" SERVER_PORT
|
setServerProp "server-port" SERVER_PORT
|
||||||
|
Loading…
Reference in New Issue
Block a user