Interface ComponentStringBuilder
- All Superinterfaces:
Appendable
- All Known Implementing Classes:
ComponentAccumulator
A component string builder.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentStringBuilderansi(KeyContainer context) Returns an ANSI component string builder.static ComponentStringBuilderansi(KeyContainer context, ComponentRendererProvider provider) Returns an ANSI component string builder.append(char c) append(@Nullable CharSequence csq) append(@Nullable CharSequence csq, int start, int end) Appends the specified component.Returns the context of this builder.static ComponentStringBuildermindustry(KeyContainer context) Returns a Mindustry component string builder.static ComponentStringBuildermindustry(KeyContainer context, ComponentRendererProvider provider) Returns a Mindustry component string builder.static ComponentStringBuilderplain(KeyContainer context) Returns a plain component string builder.static ComponentStringBuilderplain(KeyContainer context, ComponentRendererProvider provider) Returns a plain component string builder.toString()Returns the rendered string.
-
Method Details
-
plain
Returns a plain component string builder. Will not apply any text styles or colors.- Parameters:
context- the contextprovider- the component renderer provider- Returns:
- the plain component string builder
-
plain
Returns a plain component string builder. Will not apply any text styles or colors.Uses the component renderer provided by
Distributor.- Parameters:
context- the context- Returns:
- the plain component string builder
-
ansi
Returns an ANSI component string builder. Will apply ANSI escape codes for text styles and colors.If a valid ANSI escape code is found in an appended text, it will be removed.
- Parameters:
context- the contextprovider- the component renderer provider- Returns:
- the ANSI component string builder
-
ansi
Returns an ANSI component string builder. Will apply ANSI escape codes for text styles and colors.If a valid ANSI escape code is found in an appended text, it will be removed.
Uses the component renderer provided by
Distributor.- Parameters:
context- the context- Returns:
- the ANSI component string builder
-
mindustry
Returns a Mindustry component string builder. Will apply Mindustry-specific text colors.If an open square bracket is found in an appended text, it will be replaced with a double square bracket.
- Parameters:
context- the contextprovider- the component renderer provider- Returns:
- the Mindustry component string builder
-
mindustry
Returns a Mindustry component string builder. Will apply Mindustry-specific text colors.If an open square bracket is found in an appended text, it will be replaced with a double square bracket.
Uses the component renderer provided by
Distributor.- Parameters:
context- the context- Returns:
- the Mindustry component string builder
-
getContext
KeyContainer getContext()Returns the context of this builder. -
append
Appends the specified component.- Parameters:
component- the component- Returns:
- this builder
-
append
- Specified by:
appendin interfaceAppendable
-
append
- Specified by:
appendin interfaceAppendable
-
append
- Specified by:
appendin interfaceAppendable
-
toString
String toString()Returns the rendered string.
-