Skip to content

Commit

Permalink
Fix SpigotMC#3623: Do not add white (default) color if its unset when…
Browse files Browse the repository at this point in the history
… converting to legacy.

In Tests: Add static ChatColor import, replace all usages of '§' with ChatColor.

Co-authored-by: bob7l <[email protected]>

# Conflicts:
#	chat/src/test/java/net/md_5/bungee/api/chat/ComponentsTest.java
#	chat/src/test/java/net/md_5/bungee/api/chat/TranslatableComponentTest.java
  • Loading branch information
Janmm14 committed Apr 14, 2024
1 parent bc528d5 commit 765858f
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,10 @@ void toLegacyText(StringBuilder builder)

void addFormat(StringBuilder builder)
{
builder.append( getColor() );
if ( style.hasColor() || parent != null )
{
builder.append( getColor() );
}
if ( isBold() )
{
builder.append( ChatColor.BOLD );
Expand Down
Loading

0 comments on commit 765858f

Please sign in to comment.