Package com.ultikits.ultitools.utils
Class MessageUtils
java.lang.Object
com.ultikits.ultitools.utils.MessageUtils
Message utils.
消息工具类
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcoloredMsg(String message) Get a colored string, using & as color code.static StringGet error message (dark red).static StringGet info message (light blue).static StringGet a colored string.static voidsendMessage(org.bukkit.entity.Player player, String msg) Send a colored message to player, using & as color code.static voidsendMessage(org.bukkit.entity.Player player, String msg, char alternateColorCodes) Send a colored message to player, using custom color code.static voidsendMessage(org.bukkit.entity.Player player, net.kyori.adventure.text.TextComponent textComponent) Send an Adventure component message to player.static StringGet warning message (light red).
-
Constructor Details
-
MessageUtils
public MessageUtils()
-
-
Method Details
-
msg
Get a colored string.
获取一个带有颜色的字符串- Parameters:
chatColor- the chat color
颜色message- the message
消息- Returns:
- the string
字符串
-
sendMessage
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
Get a colored string, using & as color code.
获取一个带有颜色的字符串,使用&作为颜色代码- Parameters:
message- the message
消息- Returns:
- the string
字符串
-
info
Get info message (light blue).
获取通知消息 (亮蓝色)- Parameters:
message- the message
消息- Returns:
- the string
字符串
-
warning
Get warning message (light red).
获取警告消息 (亮红色)- Parameters:
message- the message
消息- Returns:
- the string
字符串
-
error
Get error message (dark red).
获取错误消息 (深红色)- Parameters:
message- the message
消息- Returns:
- the string
字符串
-