#2421: fromLegacyText - return formatted component even if empty

This commit is contained in:
CosmoConsole
2018-05-12 17:27:31 +03:00
committed by md_5
parent 88bacf12a3
commit f54f0e3f6a
2 changed files with 18 additions and 12 deletions

View File

@@ -132,17 +132,9 @@ public final class TextComponent extends BaseComponent
}
builder.append( c );
}
if ( builder.length() > 0 )
{
component.setText( builder.toString() );
components.add( component );
}
// The client will crash if the array is empty
if ( components.isEmpty() )
{
components.add( new TextComponent( "" ) );
}
component.setText( builder.toString() );
components.add( component );
return components.toArray( new BaseComponent[ components.size() ] );
}