public class MessageUtils extends Object
| Constructor and Description |
|---|
MessageUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.gson.JsonObject |
formatJson(com.google.gson.JsonObject object) |
static String |
getBedrockMessage(com.github.steveice10.mc.protocol.data.message.Message message) |
static String |
getTranslatedBedrockMessage(com.github.steveice10.mc.protocol.data.message.Message message,
String locale) |
static String |
getTranslatedBedrockMessage(com.github.steveice10.mc.protocol.data.message.Message message,
String locale,
boolean shouldTranslate) |
static List<String> |
getTranslationParams(com.github.steveice10.mc.protocol.data.message.Message[] messages) |
static List<String> |
getTranslationParams(com.github.steveice10.mc.protocol.data.message.Message[] messages,
String locale) |
static String |
getTranslationText(com.github.steveice10.mc.protocol.data.message.TranslationMessage message) |
static String |
insertParams(String message,
List<String> params)
Inserts the given parameters into the given message both in sequence and as requested
|
static boolean |
isMessage(String text)
Checks if the given text string is a json message
|
static boolean |
isTooLong(String message,
GeyserSession session)
Checks if the given message is over 256 characters (Java edition server chat limit) and sends a message to the user if it is
|
static String |
toChatColor(com.github.steveice10.mc.protocol.data.game.scoreboard.TeamColor teamColor) |
public static List<String> getTranslationParams(com.github.steveice10.mc.protocol.data.message.Message[] messages, String locale)
public static List<String> getTranslationParams(com.github.steveice10.mc.protocol.data.message.Message[] messages)
public static String getTranslationText(com.github.steveice10.mc.protocol.data.message.TranslationMessage message)
public static String getTranslatedBedrockMessage(com.github.steveice10.mc.protocol.data.message.Message message, String locale, boolean shouldTranslate)
public static String getTranslatedBedrockMessage(com.github.steveice10.mc.protocol.data.message.Message message, String locale)
public static String getBedrockMessage(com.github.steveice10.mc.protocol.data.message.Message message)
public static String insertParams(String message, List<String> params)
message - Message containing possible parameter replacement stringsparams - A list of parameter stringspublic static boolean isMessage(String text)
text - String to testpublic static com.google.gson.JsonObject formatJson(com.google.gson.JsonObject object)
public static String toChatColor(com.github.steveice10.mc.protocol.data.game.scoreboard.TeamColor teamColor)
public static boolean isTooLong(String message, GeyserSession session)
message - Message to checksession - GeyserSession for the userCopyright © 2020 GeyserMC. All rights reserved.