java.lang.Object
net.guizhanss.guizhanlib.minecraft.utils.ChatUtil

public final class ChatUtil extends Object
Utility methods about chatting.
Author:
ybw0014
  • Constructor Details

    • ChatUtil

      public ChatUtil()
  • Method Details

    • color

      @Nonnull public static String color(@Nonnull String str)
      Translate color code of a String.
      Parameters:
      str - The String to be translated.
      Returns:
      String with color code translated.
    • color

      @Nonnull public static List<String> color(@Nonnull List<String> strList)
      Translate color code of a String List.
      Parameters:
      strList - The String List to be translated.
      Returns:
      String List with color code translated.
    • send

      @ParametersAreNonnullByDefault public static void send(CommandSender sender, String message, Object... args)
      Send message to CommandSender, the color codes in the message will be translated.

      Will use MessageFormat.format() to format the message.

      Parameters:
      sender - CommandSender
      message - Message
      args - Arguments
    • sendActionBar

      @ParametersAreNonnullByDefault public static void sendActionBar(Player player, String message, Object... args)
      Send action bar message to Player, the color codes in the message will be translated.

      Will use MessageFormat.format() to format the message.

      Parameters:
      player - Player
      message - Message
      args - Arguments