diff --git a/CHANGELOG.md b/CHANGELOG.md index 3182c4e..8d3ca06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## To Be Released... -## 5.0.0 -* To be made... +## 5.X.Y +* Fix the `name` field on Minecraft servers running Velocity with multiple layers of color encoding (#595) ## 5.1.0 * FOUNDRY - Added support (#585) diff --git a/protocols/minecraft.js b/protocols/minecraft.js index 86f8ddf..0d5eeab 100644 --- a/protocols/minecraft.js +++ b/protocols/minecraft.js @@ -65,7 +65,19 @@ export default class minecraft extends Core { name = description.text } if (!name && typeof description === 'object' && description.extra) { - name = description.extra.map(part => part.text).join('') + let stack = [description]; + + while (stack.length) { + let current = stack.pop(); + + if (current.text) { + name += current.text; + } + + if (Array.isArray(current.extra)) { + stack.push(...current.extra.reverse()); + } + } } state.name = name } catch (e) {}