Package net.lucypoulton.squirtgun.format
Interface FormatProvider
public interface FormatProvider
Provides formatting info to a command.
-
Method Summary
Modifier and TypeMethodDescriptiondefault net.kyori.adventure.text.ComponentformatAccent(@NotNull String input)Formats text using the accent colour.net.kyori.adventure.text.ComponentformatAccent(@NotNull String input, @NotNull net.kyori.adventure.text.format.TextDecoration[] formatters)Formats text using the accent colour.default net.kyori.adventure.text.ComponentformatFooter(String input)Formats text into a footer, intended to be shown as the last line of a message.default net.kyori.adventure.text.ComponentformatMain(@NotNull String input)Formats text using the main colour.net.kyori.adventure.text.ComponentformatMain(@NotNull String input, @NotNull net.kyori.adventure.text.format.TextDecoration[] formatters)Formats text using the main colour.default net.kyori.adventure.text.ComponentformatTitle(String input)Formats title text.net.kyori.adventure.text.ComponentGet a prefix, which is put before most command messages.
-
Method Details
-
formatMain
Formats text using the main colour.- Parameters:
input- the text to format- Returns:
- the formatted text
-
formatMain
net.kyori.adventure.text.Component formatMain(@NotNull @NotNull String input, @NotNull @NotNull net.kyori.adventure.text.format.TextDecoration[] formatters)Formats text using the main colour.- Parameters:
input- the text to formatformatters- a string of vanilla formatter codes to apply, for example "lo" for bold and italic- Returns:
- the formatted text
-
formatAccent
Formats text using the accent colour.- Parameters:
input- the text to format- Returns:
- the formatted text
-
formatAccent
net.kyori.adventure.text.Component formatAccent(@NotNull @NotNull String input, @NotNull @NotNull net.kyori.adventure.text.format.TextDecoration[] formatters)Formats text using the accent colour.- Parameters:
input- the text to formatformatters- a string of vanilla formatter codes to apply, for example "lo" for bold and italic- Returns:
- the formatted text
-
formatTitle
Formats title text. This defaults to the old TextFormatter#formatTitle behaviour (centre-aligned title text with solid accent-coloured bars either side). This should be overridden for the Discord platform as centre-alignment does not work there due to a different font.- Parameters:
input- the text to act as the title- Returns:
- the formatted text
- Since:
- 2.0.0
-
getPrefix
net.kyori.adventure.text.Component getPrefix()Get a prefix, which is put before most command messages.- Returns:
- a preformatted colour sequence
-