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 same color after linebreak #50

Open
wizjany opened this issue Oct 5, 2019 · 0 comments
Open

Legacy serializer doesn't apply same color after linebreak #50

wizjany opened this issue Oct 5, 2019 · 0 comments

Comments

@wizjany
Copy link

wizjany commented Oct 5, 2019

String str = "&cLine1\n&cLine2";
TextComponent comp = LegacyComponentSerializer.INSTANCE.deserialize(str, '&');
// comp looks fine - empty component, two children, "Line1\n" and "Line2", both red
// now serialize again:
str = LegacyComponentSerializer.INSTANCE.serialize(comp);
 // Not fine: "§cLine1\nLine2" - second red coloring dropped due to linked line thinking that text is still red. however, the client resets color when a newline is encountered, so "Line2" is white

https://github.com/KyoriPowered/text/blob/f83cd4cfc9fdb4ef41fff8188ceeaa5e4acd6a4d/serializer-legacy/src/main/java/net/kyori/text/serializer/legacy/AbstractLegacyComponentSerializer.java#L229

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants