Class TownyComponents
java.lang.Object
com.palmergames.bukkit.towny.utils.TownyComponents
Internal utility class for common interactions with adventure components.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.kyori.adventure.text.Component
joinList
(List<net.kyori.adventure.text.Component> components, net.kyori.adventure.text.Component delimiter) static net.kyori.adventure.text.Component
Converts legacy text to a componentstatic net.kyori.adventure.text.Component
miniMessage
(@NotNull String string) static String
plain
(@NotNull net.kyori.adventure.text.Component component) static String
stripClickTags
(@NotNull String input) static String
Strips all tags known to the default minimessage instance.static String
stripTags
(@NotNull String input, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolvers) Strips the specified tags from the inputstatic String
toLegacy
(@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)
-