Class TownyComponents
java.lang.Object
com.palmergames.bukkit.towny.utils.TownyComponents
Internal utility class for common interactions with adventure components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.kyori.adventure.text.ComponentjoinList(List<net.kyori.adventure.text.Component> components, net.kyori.adventure.text.Component delimiter) static net.kyori.adventure.text.ComponentConverts legacy text to a componentstatic net.kyori.adventure.text.ComponentminiMessage(@NotNull String string) static Stringplain(@NotNull net.kyori.adventure.text.Component component) static StringstripClickTags(@NotNull String input) static StringStrips all tags known to the default minimessage instance.static StringstripTags(@NotNull String input, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolvers) Strips the specified tags from the inputstatic StringtoLegacy(@NotNull net.kyori.adventure.text.Component component) Converts a component to a legacy string using the legacy serializer
-
Constructor Details
-
TownyComponents
public TownyComponents()
-
-
Method Details
-
miniMessage
-
plain
-
legacy
Converts legacy text to a component- Parameters:
string- The input string with legacy ampersand/section characters- Returns:
- The component equivalent
-
toLegacy
Converts a component to a legacy string using the legacy serializer- Parameters:
component- The component to convert- Returns:
- A string with legacy section characters
-
stripTags
Strips all tags known to the default minimessage instance.- Parameters:
input- The input- Returns:
- The stripped output
-
stripTags
public static String stripTags(@NotNull @NotNull String input, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolvers) Strips the specified tags from the input- Parameters:
input- The input that may contain tagsresolvers- The resolver(s) for tags to strip from the input- Returns:
- The stripped output
-
stripClickTags
-
joinList
public static net.kyori.adventure.text.Component joinList(List<net.kyori.adventure.text.Component> components, net.kyori.adventure.text.Component delimiter)
-