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

Only serialize color that color is actually present #3621

Closed
wants to merge 2 commits into from

Conversation

Rothes
Copy link
Contributor

@Rothes Rothes commented Feb 25, 2024

Since 1.20.3/4, Minecraft cannot parse json with color reset (or any other that is not a color) set. It will just throw Invalid chat component: Invalid color name: reset strictly, making some plugins that trying to set component color to reset causing errors.

@md-5
Copy link
Member

md-5 commented Feb 25, 2024

Does this produce the desired effect in older versions?

If not, plugins should be prevented from setting ît entirely.

Do other formats, eg, bold still work?

@Rothes
Copy link
Contributor Author

Rothes commented Feb 25, 2024

Does this produce the desired effect in older versions?

If not, plugins should be prevented from setting ît entirely.

Do other formats, eg, bold still work?

It doesn't produce any effect, but plugins may do it for some reason like flag the component. Preventing it may break some plugin from working. Formats will not work either, I will add them later.

@Rothes Rothes changed the title Not serializing reset color to fix Minecraft deserializer error Only serialize color that color is actually present Feb 26, 2024
@Rothes
Copy link
Contributor Author

Rothes commented Feb 26, 2024

Since setting formats as color has been allowed for years, many plugins may be vulnerable to doing that. Preventing it might break the working of some legacy plugins.
Change serialization can do the trick without breaking anything.

@md-5 md-5 closed this Mar 30, 2024
thxrben pushed a commit to thxrben/BungeeCord that referenced this pull request Jun 16, 2024
thxrben pushed a commit to thxrben/BungeeCord that referenced this pull request Jun 16, 2024
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.

2 participants