Class Text

java.lang.Object
com.marcusslover.plus.lib.text.Text
All Implemented Interfaces:
ISendable<Text>

public class Text extends Object implements ISendable<Text>
  • Field Details

    • text

      @NotNull protected @NotNull String text
    • component

      @NotNull protected @NotNull net.kyori.adventure.text.Component component
  • Method Details

    • of

      @NotNull public static @NotNull Text of(@NotNull @NotNull String text)
    • of

      @NotNull public static @NotNull Text of(@NotNull @NotNull net.kyori.adventure.text.Component component)
    • mini

      @NotNull public static @NotNull Text mini(String text)
      Deserializes text using MiniMessage formatting.
      Returns:
      MiniMessage formatted text.
    • list

      @Deprecated @NotNull public static @NotNull List<@NotNull Text> list(@NotNull @NotNull List<@NotNull net.kyori.adventure.text.Component> lore)
      Deprecated.
    • gradient

      @NotNull public static @NotNull String gradient(@NotNull @NotNull String text, @NotNull @NotNull ColorGradient gradient)
      Creates a gradient text.
      Parameters:
      text - the text to be colored.
      gradient - the gradient to be used.
      Returns:
      the gradient text.
    • legacy

      @NotNull public static @NotNull String legacy(@NotNull @NotNull String text)
    • empty

      @NotNull public static @NotNull Text empty()
    • reset

      @NotNull public static @NotNull Text reset()
    • hover

      @NotNull public @NotNull Text hover(@Nullable @Nullable Text hover)
    • click

      @NotNull public @NotNull Text click(@Nullable @Nullable net.kyori.adventure.text.event.ClickEvent click)
    • append

      @NotNull public @NotNull Text append(@NotNull @NotNull String text)
    • append

      @NotNull public @NotNull Text append(@NotNull @NotNull net.kyori.adventure.text.Component component)
    • append

      @NotNull public @NotNull Text append(@NotNull @NotNull Text text)
    • font

      @NotNull public @NotNull Text font(@NotNull @NotNull net.kyori.adventure.key.Key font)
    • raw

      @NotNull public @NotNull String raw()
    • stripped

      @NotNull public @NotNull String stripped()
    • legacy

      @NotNull public @NotNull String legacy()
    • shadowColor

      @NotNull public @NotNull Text shadowColor(@NotNull @NotNull String hexColor)
      Attempt to parse a shadow color from a #-prefixed hex string. This string must be in the format #RRGGBBAA
    • shadowColor

      @NotNull public @NotNull Text shadowColor(@NotNull @NotNull net.kyori.adventure.text.format.ShadowColor color)
    • isEmpty

      public boolean isEmpty()
      Checks if the text is empty. (Does not remove spaces) If the text has spaces, it will not be considered empty.
      Returns:
      true if the text is empty.
    • isEmpty

      public boolean isEmpty(boolean strip)
      Checks if the text is empty.
      Parameters:
      strip - if the spaces should be removed.
      Returns:
      true if the text is empty.
    • isCompEmpty

      public boolean isCompEmpty()
      Checks if the component is empty.
      Returns:
      true if the component is empty.
    • comp

      @NotNull public @NotNull net.kyori.adventure.text.Component comp()
    • copy

      @NotNull public @NotNull Text copy()
    • send

      @NotNull public <T extends org.bukkit.command.CommandSender> @NotNull Text send(@NotNull T target)
      Specified by:
      send in interface ISendable<Text>
    • send

      @NotNull public @NotNull Text send(net.kyori.adventure.audience.Audience audience)
      Specified by:
      send in interface ISendable<Text>
    • sendActionBar

      @NotNull public @NotNull Text sendActionBar(@NotNull @NotNull net.kyori.adventure.audience.Audience audience)
    • sendActionBar

      @NotNull public <T extends org.bukkit.command.CommandSender> @NotNull Text sendActionBar(@NotNull T target)
    • sendActionBar

      @NotNull public <T extends org.bukkit.command.CommandSender> @NotNull Text sendActionBar(@NotNull @NotNull Collection<T> targets)
    • sendActionBar

      @NotNull public <T extends org.bukkit.command.CommandSender> @NotNull Text sendActionBar(@NotNull T... targets)
    • toString

      public String toString()
      Overrides:
      toString in class Object