PlainText

class PlainText : Record, Component, FormattedCharSequence, CharSequence

A plain and immutable Component, FormattedCharSequence and CharSequence.

Constructors

Link copied to clipboard
constructor(content: PlainTextContents)

Properties

Link copied to clipboard
val EMPTY: FormattedText
val EMPTY: FormattedCharSequence
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun accept(visitor: FormattedCharSink): Boolean
Link copied to clipboard
fun FormattedText.asFormattedCharSequence(): FormattedCharSequence
Link copied to clipboard
open fun backward(plainText: String, style: Style): FormattedCharSequence
Link copied to clipboard
open fun charAt(index: Int): Char
Link copied to clipboard
open fun chars(): IntStream
Link copied to clipboard
open fun codepoint(codepoint: Int, style: Style): FormattedCharSequence
Link copied to clipboard
open fun codePoints(): IntStream
Link copied to clipboard
inline fun FormattedCharSequence.codePointsToString(): String
Link copied to clipboard
open fun compare(cs1: CharSequence, cs2: CharSequence): Int
Link copied to clipboard
open fun composite(parts: Array<FormattedText>): FormattedText
open fun composite(): FormattedCharSequence
Link copied to clipboard
open fun contains(@Nullable text: @Nullable Component): Boolean
Link copied to clipboard
open fun copy(): MutableComponent
Link copied to clipboard
open fun decorateOutput(output: FormattedCharSink, modifier: Int2IntFunction): FormattedCharSink
Link copied to clipboard
open fun empty(): PlainText
open fun empty(): MutableComponent
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
open fun forward(plainText: String, style: Style): FormattedCharSequence
Link copied to clipboard
open fun fromList(partCopy: List<FormattedCharSequence>): FormattedCharSequence
Link copied to clipboard
open fun fromPair(first: FormattedCharSequence, second: FormattedCharSequence): FormattedCharSequence
Link copied to clipboard
open fun getChars(srcBegin: Int, srcEnd: Int, dst: Array<Char>, dstBegin: Int)
Link copied to clipboard
open fun getContents(): ComponentContents
Link copied to clipboard
open fun getSiblings(): List<Component>
Link copied to clipboard
open fun getString(): String
open fun getString(length: Int): String
Link copied to clipboard
open fun getStyle(): Style
Link copied to clipboard
open fun getVisualOrderText(): FormattedCharSequence
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
open fun keybind(name: String): MutableComponent
Link copied to clipboard
open fun length(): Int
Link copied to clipboard
open fun literal(text: String): MutableComponent
Link copied to clipboard
fun Component.mapComponent(contentMapper: UnaryOperator<ComponentContents> = UnaryOperator.identity(), styleMapper: UnaryOperator<Style> = UnaryOperator.identity()): Component

Returns a new component with contentMapper applied to the contents and styleMapper applied to the style of every part, or the receiver itself if nothing changed.

Link copied to clipboard
open fun nbt(nbtPath: CompilableString<NbtPathArgument.NbtPath>, interpreting: Boolean, plain: Boolean, separator: Optional<Component>, dataSource: DataSource): MutableComponent
Link copied to clipboard
open fun nullToEmpty(text: @Nullable String): Component
Link copied to clipboard
open fun object(info: ObjectInfo): MutableComponent
Link copied to clipboard
open fun of(content: String): PlainText
open fun of(content: String, formatting: ChatFormatting): PlainText
open fun of(content: String, style: Style): PlainText
open fun of(content: String, textColor: TextColor): PlainText
open fun of(content: PlainTextContents, style: Style): PlainText
open fun of(text: String): FormattedText
Link copied to clipboard
open fun plainCopy(): MutableComponent
Link copied to clipboard
inline operator fun FormattedCharSequence.plus(other: FormattedCharSequence): FormattedCharSequence?
Link copied to clipboard
fun Component.sanitizeForeignInput(): FormattedCharSequence

Sanitizes texts which are sent to the client.

inline fun FormattedCharSequence.sanitizeForeignInput(): FormattedCharSequence

Applies ModuleNameProtect - if needed

Link copied to clipboard
fun Component.sanitizeForSerialization(): Component
Link copied to clipboard
open fun score(pattern: CompilableString<EntitySelector>, objective: String): MutableComponent
Link copied to clipboard
open fun selector(pattern: CompilableString<EntitySelector>, separator: Optional<Component>): MutableComponent
Link copied to clipboard
open fun string(): String
Link copied to clipboard
open fun subSequence(start: Int, end: Int): CharSequence
Link copied to clipboard
open fun toFlatList(): List<Component>
open fun toFlatList(style: Style): List<Component>
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
fun FormattedCharSequence.toText(): Component
Link copied to clipboard
open fun translatable(key: String): MutableComponent
Link copied to clipboard
open fun translatableEscape(key: String, args: Array<Any>): MutableComponent
Link copied to clipboard
open fun translatableWithFallback(key: String, fallback: @Nullable String): MutableComponent
Link copied to clipboard
open fun translationArg(date: Date): Component
Link copied to clipboard
@Nullable
open fun tryCollapseToString(): @Nullable String
Link copied to clipboard
open fun <T> visit(visitor: FormattedText.ContentConsumer<T>): Optional<T>
open fun <T> visit(styledVisitor: FormattedText.StyledContentConsumer<T>, style: Style): Optional<T>