Package net.kyori.adventure.text
Class LinearComponents
java.lang.Object
net.kyori.adventure.text.LinearComponents
A utility class that allows
components
to be created where styles
can be specified inline.- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Component
linear
(@NotNull ComponentBuilderApplicable @NotNull ... applicables) Styles apply to all components after them until a conflicting style is discovered
-
Method Details
-
linear
@NotNull public static @NotNull Component linear(@NotNull @NotNull ComponentBuilderApplicable @NotNull ... 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
-