Class BungeeComponentUtil
java.lang.Object
eu.cloudnetservice.ext.bungee.BungeeComponentUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull net.md_5.bungee.api.chat.BaseComponentreplaceText(@NonNull net.md_5.bungee.api.chat.BaseComponent component, @NonNull Pattern pattern, @NonNull net.md_5.bungee.api.chat.BaseComponent replacement) Replaces all occurrences of the given pattern in the given component and its children with the given replacement.
-
Constructor Details
-
BungeeComponentUtil
private BungeeComponentUtil()
-
-
Method Details
-
replaceText
@NonNull public static @NonNull net.md_5.bungee.api.chat.BaseComponent replaceText(@NonNull @NonNull net.md_5.bungee.api.chat.BaseComponent component, @NonNull @NonNull Pattern pattern, @NonNull @NonNull net.md_5.bungee.api.chat.BaseComponent replacement) Replaces all occurrences of the given pattern in the given component and its children with the given replacement.- Parameters:
component- the component to replace the occurrences of the given pattern in.pattern- the pattern to find and replace in the given component.replacement- the replacement to use for the pattern in the component.- Returns:
- a component with all occurrences of the given pattern replaced.
- Throws:
NullPointerException- if the given component, matcher or replacement is null.
-