Package net.kyori.adventure.text
Class LinearComponents
- java.lang.Object
-
- net.kyori.adventure.text.LinearComponents
-
public final class LinearComponents extends Object
A utility class that allowscomponents
to be created wherestyles
can be specified inline.- Since:
- 4.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NonNull Component
linear(@NonNull ComponentBuilderApplicable @NonNull ... applicables)
Styles apply to all components after them until a conflicting style is discovered
-
-
-
Method Detail
-
linear
public static @NonNull Component linear(@NonNull ComponentBuilderApplicable @NonNull ... applicables)
Styles apply to all components after them until a conflicting style is discoveredComponent message = LinearComponents.linear(NamedTextColor.RED, translatable("welcome.message"), TextDecoration.BOLD, text(" SERVER));
In this example all the text is red, but only the last word is bold.Component message = LinearComponents.linear(NamedTextColor.GREEN, text("I am green. "), NamedTextColor.GRAY, text("I am gray."));
In this example, the first text is green and the second is gray.- Parameters:
applicables
- the things used to make the component- Returns:
- a component
- Since:
- 4.0.0
-
-