Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed parsing of the MOTD as Component #625

Merged
1 commit merged into from Apr 6, 2021
Merged

Conversation

darbyjack
Copy link
Contributor

When the change to handling the MOTD as Adventure components was implemented, there seemed to have been a tiny mistake on how things were being parsed.

I noticed this when I was updating one of my personal projects that uses MCProtocolLib as a dependency.

Below are some examples of how the MOTD looked before switching to Adventure and after.
Before: https://paste.gg/p/anonymous/47f169ede38d453e80ca7338acc9c4c7
After: https://paste.gg/p/anonymous/037d5fad36704d5ca67a8b59cbcdaa28

The main thing to notice here is the MOTD section. As you can see in the before, the raw and formatted are cleanly done with not much extra whitespace. After updating to a version of MCProtocolLib that used Adventure, the output looked like the after post, which instantly caught my eye that something was off. After doing some digging, it turns out the issue was that the MOTD was being converted to a string directory from the JsonElement. This caused some double parsing to go on and have some escape character problems as you also saw in the after post. This PR fixes how the MOTD is being parsed and returns it back to normal. Below, I have linked another paste which shows what my PR changes and you can see how the MOTD section looks back normal.

This PR: https://paste.gg/p/anonymous/ae1929ab813a47b4aa1ec5011ddc99b7

@ghost ghost merged commit 6af0257 into GeyserMC:master Apr 6, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant