Class ChatHelper

java.lang.Object
dev.boze.api.utility.ChatHelper

public final class ChatHelper extends Object
A helper for sending messages to the client chat
This only sends messages client-side, it does not send messages to the server!
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Gets the client command prefix
    static void
    Sends an error to the chat
    static void
    sendError(String brand, ClientColor brandColor, String error)
    Sends an error to the chat with a custom brand prefix and color, without a title
    static void
    sendError(String brand, ClientColor brandColor, String title, String error)
    Sends an error to the chat with a custom brand prefix and color in place of the default [Boze]
    static void
    sendError(String title, String error)
    Sends an error to the chat with a title
    It's recommended to use this method when sending errors from a command/module
    static void
    sendError(String brand, String title, String error)
    Sends an error to the chat with a custom brand prefix in place of the default [Boze]
    static void
    sendMsg(String message)
    Sends a message to the chat
    static void
    sendMsg(String brand, ClientColor brandColor, String message)
    Sends a message to the chat with a custom brand prefix and color, without a title
    Output is [brand] message
    static void
    sendMsg(String brand, ClientColor brandColor, String title, String message)
    Sends a message to the chat with a custom brand prefix and color in place of the default [Boze]
    Output is [brand] [title] message with the brand shown in the given color
    static void
    sendMsg(String title, String message)
    Sends a message to the chat with a title
    It's recommended to use this method when sending messages from a command/module
    static void
    sendMsg(String brand, String title, String message)
    Sends a message to the chat with a custom brand prefix in place of the default [Boze]
    Output is [brand] [title] message with the brand shown in the boze color
    static void
    Sends a warning to the chat
    static void
    sendWarning(String brand, ClientColor brandColor, String warning)
    Sends a warning to the chat with a custom brand prefix and color, without a title
    static void
    sendWarning(String brand, ClientColor brandColor, String title, String warning)
    Sends a warning to the chat with a custom brand prefix and color in place of the default [Boze]
    static void
    sendWarning(String title, String warning)
    Sends a warning to the chat with a title
    It's recommended to use this method when sending warnings from a command/module
    static void
    sendWarning(String brand, String title, String warning)
    Sends a warning to the chat with a custom brand prefix in place of the default [Boze]

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ChatHelper

      public ChatHelper()
  • Method Details

    • sendMsg

      public static void sendMsg(String message)
      Sends a message to the chat
      Parameters:
      message - The message
    • sendMsg

      public static void sendMsg(String title, String message)
      Sends a message to the chat with a title
      It's recommended to use this method when sending messages from a command/module
      Parameters:
      title - The title of the message/the command/module name
      message - The message
    • sendMsg

      public static void sendMsg(String brand, String title, String message)
      Sends a message to the chat with a custom brand prefix in place of the default [Boze]
      Output is [brand] [title] message with the brand shown in the boze color
      Parameters:
      brand - The brand prefix text (shown in place of [Boze])
      title - The title of the message/the command/module name
      message - The message
    • sendMsg

      public static void sendMsg(String brand, ClientColor brandColor, String title, String message)
      Sends a message to the chat with a custom brand prefix and color in place of the default [Boze]
      Output is [brand] [title] message with the brand shown in the given color
      Parameters:
      brand - The brand prefix text (shown in place of [Boze])
      brandColor - The color of the brand prefix (null = boze color). Gradient colors are NOT supported here and will render incorrectly; use a static or changing color.
      title - The title of the message/the command/module name
      message - The message
    • sendMsg

      public static void sendMsg(String brand, ClientColor brandColor, String message)
      Sends a message to the chat with a custom brand prefix and color, without a title
      Output is [brand] message
      Parameters:
      brand - The brand prefix text (shown in place of [Boze])
      brandColor - The color of the brand prefix (null = boze color). Gradient colors are NOT supported here and will render incorrectly; use a static or changing color.
      message - The message
    • sendWarning

      public static void sendWarning(String warning)
      Sends a warning to the chat
      Parameters:
      warning - The warning
    • sendWarning

      public static void sendWarning(String title, String warning)
      Sends a warning to the chat with a title
      It's recommended to use this method when sending warnings from a command/module
      Parameters:
      title - The title of the warning/the command/module name
      warning - The warning
    • sendWarning

      public static void sendWarning(String brand, String title, String warning)
      Sends a warning to the chat with a custom brand prefix in place of the default [Boze]
      Parameters:
      brand - The brand prefix text (shown in place of [Boze])
      title - The title of the warning/the command/module name
      warning - The warning
    • sendWarning

      public static void sendWarning(String brand, ClientColor brandColor, String title, String warning)
      Sends a warning to the chat with a custom brand prefix and color in place of the default [Boze]
      Parameters:
      brand - The brand prefix text (shown in place of [Boze])
      brandColor - The color of the brand prefix (null = boze color). Gradient colors are NOT supported here and will render incorrectly; use a static or changing color.
      title - The title of the warning/the command/module name
      warning - The warning
    • sendWarning

      public static void sendWarning(String brand, ClientColor brandColor, String warning)
      Sends a warning to the chat with a custom brand prefix and color, without a title
      Parameters:
      brand - The brand prefix text (shown in place of [Boze])
      brandColor - The color of the brand prefix (null = boze color). Gradient colors are NOT supported here and will render incorrectly; use a static or changing color.
      warning - The warning
    • sendError

      public static void sendError(String error)
      Sends an error to the chat
      Parameters:
      error - The error
    • sendError

      public static void sendError(String title, String error)
      Sends an error to the chat with a title
      It's recommended to use this method when sending errors from a command/module
      Parameters:
      title - The title of the error/the command/module name
      error - The error
    • sendError

      public static void sendError(String brand, String title, String error)
      Sends an error to the chat with a custom brand prefix in place of the default [Boze]
      Parameters:
      brand - The brand prefix text (shown in place of [Boze])
      title - The title of the error/the command/module name
      error - The error
    • sendError

      public static void sendError(String brand, ClientColor brandColor, String title, String error)
      Sends an error to the chat with a custom brand prefix and color in place of the default [Boze]
      Parameters:
      brand - The brand prefix text (shown in place of [Boze])
      brandColor - The color of the brand prefix (null = boze color). Gradient colors are NOT supported here and will render incorrectly; use a static or changing color.
      title - The title of the error/the command/module name
      error - The error
    • sendError

      public static void sendError(String brand, ClientColor brandColor, String error)
      Sends an error to the chat with a custom brand prefix and color, without a title
      Parameters:
      brand - The brand prefix text (shown in place of [Boze])
      brandColor - The color of the brand prefix (null = boze color). Gradient colors are NOT supported here and will render incorrectly; use a static or changing color.
      error - The error
    • getCommandPrefix

      public static String getCommandPrefix()
      Gets the client command prefix
      Returns:
      command prefix string