From cf1d0029fcde783abc11f4b0165e1486369f1d52 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 7 Jan 2022 18:21:47 -0600 Subject: [PATCH 1/2] fix(limbo): convert MOTD to JSON chat format Fixes #1223 --- scripts/start-setupServerProperties | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/start-setupServerProperties b/scripts/start-setupServerProperties index 0febd09694e..c700702e521 100755 --- a/scripts/start-setupServerProperties +++ b/scripts/start-setupServerProperties @@ -48,7 +48,7 @@ function customizeServerProps { # If not provided, generate a reasonable default message-of-the-day, # 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 if [[ ${ORIGINAL_TYPE} == "VANILLA" && ${VERSION} == "SNAPSHOT" ]]; then label=SNAPSHOT @@ -62,6 +62,13 @@ function customizeServerProps { MOTD="A ${label} Minecraft Server powered by Docker" fi + # normalize MOTD + if [[ ${TYPE^^} = LIMBO ]]; then + if [[ $MOTD ]] && ! [[ $MOTD =~ ^{ ]]; then + MOTD="{\"text\":\"${MOTD}\"}" + fi + fi + setServerProp "server-name" SERVER_NAME setServerProp "server-ip" SERVER_IP setServerProp "server-port" SERVER_PORT From 4e07f3864fa850c197cd3a1477ab5b3126976be9 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Fri, 7 Jan 2022 18:26:26 -0600 Subject: [PATCH 2/2] Added note to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 948fb452787..55e4310e092 100644 --- a/README.md +++ b/README.md @@ -587,6 +587,8 @@ Configuration options with defaults: - `LIMBO_SCHEMA_FILENAME`=default.schem - `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 A [Crucible](https://github.com/CrucibleMC/Crucible) server can be run by setting `TYPE` to `CRUCIBLE`.