Skip to content
Success

Changes

Summary

  1. #3344: Fix legacy chat conversion losing format reset information. (commit: 2a716bb) (details)
Commit 2a716bbc7f91887e31bbc37fb608581673893605 by github
#3344: Fix legacy chat conversion losing format reset information.

In legacy chat format, colors and reset do not retain any formatting.

In order to prevent this behaviour from creating unnecessary long json containing many redundant `formatting: false`, the original `fromLegacyText(...)` idea was to just override the color to white and handle the format reset just internally.

However eventual previous format rejection (aka reset) information was lost when appending multiple legacy format strings to a `ComponentBuilder`.

With this change we save the "reset wish" in the `BaseComponent` and update `ComponentBuilder`'s append function to not copy over formatting if the component has the reset flag set.
(commit: 2a716bb)
The file was modifiedchat/src/main/java/net/md_5/bungee/api/chat/BaseComponent.java (diff)
The file was modifiedchat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java (diff)
The file was modifiedchat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java (diff)
The file was modifiedchat/src/main/java/net/md_5/bungee/api/chat/ComponentBuilder.java (diff)