Class MessageUtility

java.lang.Object
org.woftnw.eof.MessageUtility

public class MessageUtility extends Object
A utility class for creating messages.
  • Field Details

    • INFO_TEXT_COLOR

      public static final net.kyori.adventure.text.format.TextColor INFO_TEXT_COLOR
  • Constructor Details

    • MessageUtility

      public MessageUtility()
  • Method Details

    • buildMessage

      public static @NonNull net.kyori.adventure.text.Component buildMessage(String message)
      Build a formatted chat message.
      Parameters:
      message - The string to turn into a message.
      Returns:
      A formatted Component.
    • buildMessage

      public static @NonNull net.kyori.adventure.text.Component buildMessage(net.kyori.adventure.text.Component message)
      Build a formatted chat message.
      Parameters:
      message - The message to format.
      Returns:
      A formatted Component.
    • buildErrorMessage

      public static @NonNull net.kyori.adventure.text.Component buildErrorMessage(String message)
      Build an error-formatted chat message.
      Parameters:
      message - The string to turn into a message.
      Returns:
      A formatted Component.
    • singularOrPlural

      public static String singularOrPlural(int number, String singular, String plural)
      Choose a singular or plural form depending on a number.
      Parameters:
      number - The number to compare.
      singular - The singular form to use if the number is 1.
      plural - The plural form to use otherwise.
      Returns:
      The resulting form choice.