Class MessageUtils

java.lang.Object
com.ultikits.ultitools.utils.MessageUtils

public class MessageUtils extends Object
Message utils.

消息工具类

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    coloredMsg(String message)
    Get a colored string, using & as color code.
    static String
    error(String message)
    Get error message (dark red).
    static String
    info(String message)
    Get info message (light blue).
    static String
    msg(org.bukkit.ChatColor chatColor, String message)
    Get a colored string.
    static void
    sendMessage(org.bukkit.entity.Player player, String msg)
    Send a colored message to player, using & as color code.
    static void
    sendMessage(org.bukkit.entity.Player player, String msg, char alternateColorCodes)
    Send a colored message to player, using custom color code.
    static void
    sendMessage(org.bukkit.entity.Player player, net.kyori.adventure.text.TextComponent textComponent)
    Send an Adventure component message to player.
    static String
    warning(String message)
    Get warning message (light red).

    Methods inherited from class java.lang.Object

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

    • MessageUtils

      public MessageUtils()
  • Method Details

    • msg

      public static String msg(org.bukkit.ChatColor chatColor, String message)
      Get a colored string.
      获取一个带有颜色的字符串
      Parameters:
      chatColor - the chat color
      颜色
      message - the message
      消息
      Returns:
      the string
      字符串
    • sendMessage

      public static void sendMessage(org.bukkit.entity.Player player, String msg)
      Send a colored message to player, using & as color code.
      给玩家发送一个带有颜色的消息,使用&作为颜色代码
      Parameters:
      player - the player
      玩家
      msg - the msg
      消息
    • sendMessage

      public static void sendMessage(org.bukkit.entity.Player player, String msg, char alternateColorCodes)
      Send a colored message to player, using custom color code.
      给玩家发送一个带有颜色的消息,使用自定义颜色代码
      Parameters:
      player - the player
      玩家
      msg - the msg
      消息
      alternateColorCodes - the alternate color codes
      自定义颜色代码
    • sendMessage

      public static void sendMessage(org.bukkit.entity.Player player, net.kyori.adventure.text.TextComponent textComponent)
      Send an Adventure component message to player.
      给玩家发送一个Adventure组件消息
      Parameters:
      player - the player
      玩家
      textComponent - the text component
      文本组件
    • coloredMsg

      public static String coloredMsg(String message)
      Get a colored string, using & as color code.
      获取一个带有颜色的字符串,使用&作为颜色代码
      Parameters:
      message - the message
      消息
      Returns:
      the string
      字符串
    • info

      public static String info(String message)
      Get info message (light blue).
      获取通知消息 (亮蓝色)
      Parameters:
      message - the message
      消息
      Returns:
      the string
      字符串
    • warning

      public static String warning(String message)
      Get warning message (light red).
      获取警告消息 (亮红色)
      Parameters:
      message - the message
      消息
      Returns:
      the string
      字符串
    • error

      public static String error(String message)
      Get error message (dark red).
      获取错误消息 (深红色)
      Parameters:
      message - the message
      消息
      Returns:
      the string
      字符串