Companion

object Companion

Defines utilities for general purposes across multiple platforms.

Functions

Link copied to clipboard

Builds a Regex with the given String, that matches the given String in multiple permutations, that may be possible when wanting to block specific words. BLocked permutations include:

Link copied to clipboard
fun chatButton(hover: String, text: String, click: String, action: ClickEvent.Action): String

Creates a chat button String in MiniMessage formatting. Can be used to create interactable text in chat.

Link copied to clipboard

Creates a chat button String in MiniMessage formatting, with the text "ACCEPT" in bold green, that when clicked, executes the given command.

Link copied to clipboard

Creates a chat button String in MiniMessage formatting, that when clicked, executes the given command.

Link copied to clipboard

Creates a chat button String in MiniMessage formatting, with a checkmark, that when clicked, executed the given command.

Link copied to clipboard

Creates a chat button String in MiniMessage formatting, with the text "DECLINE" in bold red, that when clicked, executes the given command.

Link copied to clipboard

Creates a chat button String in MiniMessage formatting, with the text "NO" in bold red, that when clicked, executes the given command.

Link copied to clipboard

Creates a chat button String in MiniMessage formatting, with the text "OK" in bold green, that when clicked, executes the given command.

Link copied to clipboard

Creates a chat button String in MiniMessage formatting, with the text "x" in bold red, that when clicked, executes the given command.

Link copied to clipboard

Creates a chat button String in MiniMessage formatting, with the text "YES" in bold green, that when clicked, executes the given command.

Link copied to clipboard

Creates a chat button String in MiniMessage formatting, that when clicked, inserts the given command into the player's chat.

Link copied to clipboard
fun getCensoredText(text: String, blacklistedWords: List<String>): String

Converts the given String into its censored version, where each blacklisted word in blacklistedWords is replaced by its censored version. E. G. "fuck" -> "f***".

Link copied to clipboard

Converts the given String into a Regex, that matches the given String in multiple permutations, that may be possible when wanting to block specific words. Blocked permutations include:

Link copied to clipboard
fun Component.toBungeeComponent(): @NotNull Array<out @NotNull BaseComponent>

Converts the given Component into an Array of BaseComponent, usable on BungeeCord systems.

Link copied to clipboard
fun String.toCensoredText(blacklistedWords: List<String>): String

Converts the given String into its censored version, where each blacklisted word in blacklistedWords is replaced by its censored version. E. G. "fuck" -> "f***".

Link copied to clipboard
fun Component.toLegacyAmpersandString(): @NotNull String

Converts the given Component into a String with legacy ampersand (&) formatting.

Link copied to clipboard
fun Component.toLegacySectionString(): @NotNull String

Converts the given Component into a String with legacy section (§) formatting.

Link copied to clipboard
fun String.toMiniMessageComponent(): @NotNull Component

Converts the given String into a Component using MiniMessage.deserialize.

Link copied to clipboard
fun Component.toMiniMessageString(): @NotNull String

Converts the given Component into a String with MiniMessage formatting.

Link copied to clipboard
fun Component.toPlainTextString(): @NotNull String

Converts the given Component into a plain text String with no formatting.