BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
Not sure if this is intended behavior, but if we readBaseComponent a String which has no format (example: 'asdasd'), the string will be given a default white color.
Upon being converted back to legacy text through toLegacyText(), the string will now contain the white format symbols at the beginning of the string therefor incrementing it's original length by 2
I managed to "fix" this by simply adding this check to verify the component actually has a set color:
This implementation causes wrong results of toLegacyText(BaseComponent...).
I updated my PR (mentioned above) with new context-aware toLegacyText implementations.
Bungeecord version
BungeeCord-Proxy 1.20-R0.3-SNAPSHOT ( build 1800)
Server version
No response
Client version
1.8, 1.20.2
Bungeecord plugins
None
The bug
Not sure if this is intended behavior, but if we readBaseComponent a String which has no format (example: 'asdasd'), the string will be given a default white color.
Upon being converted back to legacy text through toLegacyText(), the string will now contain the white format symbols at the beginning of the string therefor incrementing it's original length by 2
I managed to "fix" this by simply adding this check to verify the component actually has a set color:
void addFormat(StringBuilder builder)
{
if (!(!style.hasColor() && parent == null))
builder.append(getColor());
At BaseComponent's addFormat function
Log output (links)
No response
Checking