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

LegacyComponentSerializer does not deserialize components properly if formatting code char is capitalized #1043

Closed
pop4959 opened this issue Feb 26, 2024 · 4 comments · Fixed by #1044

Comments

@pop4959
Copy link

pop4959 commented Feb 26, 2024

Related: EssentialsX/Essentials#5710

As referenced, this is unfortunately common and recognized usage, color codes chars should be case-insensitive ideally.

Example component output from the deserializer without normalization using Essentials /nick to trigger the issue:

/nick &epop4959

TextComponentImpl{content="pop4959", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=NamedTextColor{name="yellow", value="#ffff55"}, clickEvent=null, hoverEvent=null, insertion=null, font=null}

/nick &Epop4959

TextComponentImpl{content="§Epop4959", style=StyleImpl{obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, color=null, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}
@kezz
Copy link
Member

kezz commented Feb 26, 2024

Do capital letters after section signs render in the client? If not, then this isn't a bug report and something that can already be achieved by modifying the serializer using the builder to set additional formats.

@kezz kezz transferred this issue from KyoriPowered/adventure-platform Feb 26, 2024
@pop4959
Copy link
Author

pop4959 commented Feb 26, 2024

I quickly tested this (in a lazy way, so if you don't trust the method feel free to double check) - sending a custom brand packet which if I recall correctly the client only supports Legacy in. I tried §etest and §Etest which both appear as "test" in yellow on the vanilla client. So I believe this is indeed a bug.

Also noted on the additional formats, should have probably checked that before coming up with my other solution.

@kezz
Copy link
Member

kezz commented Feb 26, 2024

Yep, I can test and confirm that capitalisation doesn't matter so this is indeed a bug!

@pop4959
Copy link
Author

pop4959 commented Feb 26, 2024

Thanks, also applied your suggested fix to Essentials and it appears to work beautifully. Should hold us over until it gets addressed over here.

github-merge-queue bot pushed a commit that referenced this issue Feb 27, 2024
fix: Allow for case-insensitivity in legacy serializer, closes #1043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants