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

Legacy serializer doesn't apply color for empty content #1030

Open
WhatCats opened this issue Jan 28, 2024 · 0 comments
Open

Legacy serializer doesn't apply color for empty content #1030

WhatCats opened this issue Jan 28, 2024 · 0 comments

Comments

@WhatCats
Copy link

Code

Component component = Component.text().color(NamedTextColor.GRAY).build();
Loggers.debug(
    "%s -> %s",
    GsonComponentSerializer.gson().serialize(component),
    LegacyComponentSerializer.legacyAmpersand().serialize(component)
);

Ouput

{"color":"gray","text":""} ->

Expected Output

{"color":"gray","text":""} -> &7

Reason

If you are using Components for prefix's in 1.8 for example you might have this condition where you want a color but no text.

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

No branches or pull requests

1 participant