public class ChatFormatter
extends java.lang.Object
Constructor and Description |
---|
ChatFormatter() |
Modifier and Type | Method and Description |
---|---|
static void |
discord(java.lang.String message,
java.lang.String user)
Sends a received message from Discord to the global chat.
|
static java.lang.String |
getGamemodeSuffix(org.bukkit.entity.Player player)
Gets the gamemode suffix of a player.
|
static java.lang.String |
getRankPrefix(org.bukkit.entity.Player player)
Gets the rank prefix of a player.
|
static void |
global(io.papermc.paper.event.player.AsyncChatEvent event)
Formats and sends a message from an chat event to the global chat.
|
static void |
group(org.bukkit.entity.Player player,
java.lang.String message)
Formats and sends a message from a player to their group.
|
static void |
guild(org.bukkit.entity.Player player,
java.lang.String message)
Formats and sends a message from a player to their guild.
|
static void |
share(org.bukkit.entity.Player player,
org.bukkit.inventory.ItemStack itemStack)
Formats and sends an item stack message from a player to the global chat.
|
static boolean |
validateGroupMessage(org.bukkit.entity.Player player,
java.lang.Object groupObject,
java.lang.String message,
boolean isGuild)
Checks if a group message can be sent.
|
public static void global(io.papermc.paper.event.player.AsyncChatEvent event)
event
- The received PlayerChatEvent.public static void share(org.bukkit.entity.Player player, org.bukkit.inventory.ItemStack itemStack)
player
- The player who sent the item stack message.itemStack
- The item stack to show in the message.UnicodeUtils.shareChatItem(ItemStack, String)
public static void group(org.bukkit.entity.Player player, java.lang.String message)
player
- The player who sent the message.message
- The message they sent.public static void guild(org.bukkit.entity.Player player, java.lang.String message)
player
- The player who sent the message.message
- The message they sent.public static void discord(java.lang.String message, java.lang.String user)
message
- The message from Discord.user
- The name of the Discord user.public static java.lang.String getRankPrefix(org.bukkit.entity.Player player)
player
- The player to get the prefix for.public static java.lang.String getGamemodeSuffix(org.bukkit.entity.Player player)
player
- The player to get the suffix for.public static boolean validateGroupMessage(org.bukkit.entity.Player player, java.lang.Object groupObject, java.lang.String message, boolean isGuild)
player
- The player who sent the message.groupObject
- The group or guild that should receive the message.message
- The message they sent.isGuild
- If it is sent to guild (used for error message).