Class ColorHandler<T>

java.lang.Object
org.lushplugins.chatcolorhandler.common.ColorHandler<T>
Type Parameters:
T - Translation output type
Direct Known Subclasses:
PaperColor

public abstract class ColorHandler<T> extends Object
  • Constructor Details

    • ColorHandler

      public ColorHandler()
  • Method Details

    • settings

      public ColorHandlerSettings settings()
    • parsers

      public ParserRegistry parsers()
    • translate

      public abstract T translate(@Nullable @Nullable String string, @Nullable @Nullable org.bukkit.entity.Player player, Collection<Parser> parsers)
      Translates a string to allow for hex colours and placeholders
      Parameters:
      string - String to be translated
      player - Player to parse placeholders for
      parsers - Parsers which this message will be parsed through
    • translate

      public T translate(@Nullable @Nullable String string, @Nullable @Nullable org.bukkit.entity.Player player)
      Translates a string to allow for hex colours and placeholders
      Parameters:
      string - String to be translated
      player - Player to parse placeholders for
    • translate

      public T translate(@Nullable @Nullable String string, Collection<Parser> parsers)
      Translates a string to allow for hex colours and placeholders
      Parameters:
      string - String to be translated
      parsers - Parsers which this message won't be parsed through
    • translate

      public T translate(@Nullable @Nullable String string)
      Translates a string to allow for hex colours and placeholders
      Parameters:
      string - String to be translated
    • translate

      public List<T> translate(Collection<String> strings, org.bukkit.entity.Player player, List<Parser> parsers)
      Translates a collection of strings to allow for hex colours and placeholders
      Parameters:
      strings - Strings to be translated
      player - Player to parse placeholders for
      parsers - Parsers which this message will be parsed through
    • translate

      public List<T> translate(Collection<String> strings, org.bukkit.entity.Player player)
      Translates a collection of strings to allow for hex colours and placeholders
      Parameters:
      strings - Strings to be translated
      player - Player to parse placeholders for
    • translate

      public List<T> translate(Collection<String> strings, List<Parser> parsers)
      Translates a collection of strings to allow for hex colours and placeholders
      Parameters:
      strings - Strings to be translated
      parsers - Parsers which this message will be parsed through
    • translate

      public List<T> translate(Collection<String> strings)
      Translates a collection of strings to allow for hex colours and placeholders
      Parameters:
      strings - Strings to be translated
    • sendMessage

      public abstract void sendMessage(org.bukkit.command.CommandSender recipient, @Nullable @Nullable String message)
      Sends a recipient a message
      Parameters:
      recipient - Sender to receive this message
      message - Message to be displayed
    • sendMessage

      public void sendMessage(org.bukkit.command.CommandSender recipient, String... messages)
      Sends a recipient multiple messages
      Parameters:
      recipient - Sender to receive message
      messages - Messages to be displayed
    • sendMessage

      public void sendMessage(Collection<org.bukkit.command.CommandSender> recipients, @Nullable @Nullable String message)
      Sends multiple recipients a message
      Parameters:
      recipients - Senders to receive message
      message - Message to be displayed
    • sendMessage

      public void sendMessage(Collection<org.bukkit.command.CommandSender> recipients, String... messages)
      Sends multiple recipients, multiple messages
      Parameters:
      recipients - Senders to receive this message
      messages - Messages to be displayed
    • broadcastMessage

      public abstract void broadcastMessage(@Nullable @Nullable String message)
      Sends all online players a message
      Parameters:
      message - Message to be displayed
    • broadcastMessage

      public void broadcastMessage(String... messages)
      Sends all online players multiple messages
      Parameters:
      messages - Messages to be displayed
    • sendActionBarMessage

      public abstract void sendActionBarMessage(org.bukkit.entity.Player player, @Nullable @Nullable String message)
      Sends a player an action bar message
      Parameters:
      player - Player to receive this action bar message
      message - Message to be displayed
    • sendActionBarMessage

      public void sendActionBarMessage(Collection<org.bukkit.entity.Player> players, @Nullable @Nullable String message)
      Sends multiple players an action bar message
      Parameters:
      players - Players to receive this action bar message
      message - Message to be displayed
    • sendTitle

      public abstract void sendTitle(org.bukkit.entity.Player player, @Nullable @Nullable String title, @Nullable @Nullable String subtitle, int fadeIn, int stay, int fadeOut)
      Send a player a title message
      Parameters:
      player - Player to receive this title
      title - Title to be displayed
      subtitle - Subtitle to be displayed
      fadeIn - Duration for title to fade in
      stay - Duration for title to appear
      fadeOut - Duration for title to fade out
    • sendTitle

      public void sendTitle(org.bukkit.entity.Player player, @Nullable @Nullable String title, @Nullable @Nullable String subtitle, int fadeIn, int fadeOut)
      Send a player a title message
      Parameters:
      player - Player to receive this title
      title - Title to be displayed
      subtitle - Subtitle to be displayed
      fadeIn - Duration for title to fade in
      fadeOut - Duration for title to fade out
    • sendTitle

      public void sendTitle(org.bukkit.entity.Player player, @Nullable @Nullable String title, @Nullable @Nullable String subtitle)
      Send a player a title message
      Parameters:
      player - Player to receive this title
      title - Title to be displayed
      subtitle - Subtitle to be displayed
    • sendTitle

      public void sendTitle(org.bukkit.entity.Player player, @Nullable @Nullable String title)
      Send a player a title message
      Parameters:
      player - Player to receive this title
      title - Title to be displayed
    • sendTitle

      public void sendTitle(Collection<org.bukkit.entity.Player> players, @Nullable @Nullable String title, @Nullable @Nullable String subtitle, int fadeIn, int stay, int fadeOut)
      Send multiple players a title message
      Parameters:
      players - Player to receive this title
      title - Title to be displayed
      subtitle - Subtitle to be displayed
      fadeIn - Duration for title to fade in
      stay - Duration for title to appear
      fadeOut - Duration for title to fade out
    • sendTitle

      public void sendTitle(Collection<org.bukkit.entity.Player> players, @Nullable @Nullable String title, @Nullable @Nullable String subtitle, int fadeIn, int fadeOut)
      Send multiple players a title message
      Parameters:
      players - Player to receive this title
      title - Title to be displayed
      subtitle - Subtitle to be displayed
      fadeIn - Duration for title to fade in
      fadeOut - Duration for title to fade out
    • sendTitle

      public void sendTitle(Collection<org.bukkit.entity.Player> players, @Nullable @Nullable String title, @Nullable @Nullable String subtitle)
      Send multiple players a title message
      Parameters:
      players - Player to receive this title
      title - Title to be displayed
      subtitle - Subtitle to be displayed
    • sendTitle

      public void sendTitle(Collection<org.bukkit.entity.Player> players, @Nullable @Nullable String title)
      Send multiple players a title message
      Parameters:
      players - Player to receive this title
      title - Title to be displayed