public class MessageTranslator extends Object
| Constructor and Description |
|---|
MessageTranslator() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertMessage(String message) |
static String |
convertMessage(String message,
String locale)
Convert a Java message to the legacy format ready for bedrock
|
static String |
convertMessageLenient(String message) |
static String |
convertMessageLenient(String message,
String locale)
Verifies the message is valid JSON in case it's plaintext.
|
static String |
convertToJavaMessage(String message)
Convert a Bedrock message string back to a format Java can understand
|
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)
Convert a team color to a chat color
|
public static String convertMessage(String message, String locale)
message - Java messagelocale - Locale to use for translation stringspublic static String convertMessageLenient(String message, String locale)
message - Potentially lenient JSON messagelocale - Locale to use for translation stringspublic static String convertToJavaMessage(String message)
message - Message to convertpublic static boolean isMessage(String text)
text - String to testpublic static String toChatColor(com.github.steveice10.mc.protocol.data.game.scoreboard.TeamColor teamColor)
teamColor - public static boolean isTooLong(String message, GeyserSession session)
message - Message to checksession - GeyserSession for the userCopyright © 2020 GeyserMC. All rights reserved.