diff --git a/package.json b/package.json index 40a222ac..9006b366 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "scripts": { "test": "npm run mochaTest", - "mochaTest": "mocha --recursive --reporter spec --exit", + "mochaTest": "mocha --recursive --reporter spec --retries 2 --exit", "lint": "standard", "fix": "standard --fix", "pretest": "npm run lint", diff --git a/src/server/login.js b/src/server/login.js index 858b952c..2dcfad28 100644 --- a/src/server/login.js +++ b/src/server/login.js @@ -196,7 +196,12 @@ module.exports = function (client, server, options) { client.settings = {} if (client.supportFeature('chainedChatWithHashing')) { // 1.19.1+ + const jsonMotd = server.motdMsg ?? { text: server.motd } + const nbtMotd = nbt.comp({ text: nbt.string(server.motd) }) client.write('server_data', { + motd: client.supportFeature('chatPacketsUseNbtComponents') ? nbtMotd : motd, + icon: server.favicon, // b64 + iconBytes: server.favicon ? Buffer.from(server.favicon, 'base64') : undefined, previewsChat: options.enableChatPreview, // Note: in 1.20.5+ user must send this with `login` enforcesSecureChat: options.enforceSecureProfile