public class ChatUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ChatUtil.PacketNoSpamChat |
| Constructor and Description |
|---|
ChatUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
sendChat(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.IChatComponent... lines)
Sends all passed chat components to the player.
|
static void |
sendChat(net.minecraft.entity.player.EntityPlayer player,
java.lang.String... lines)
Simply sends the passed lines to the player in a chat message.
|
static void |
sendChatUnloc(net.minecraft.entity.player.EntityPlayer player,
java.lang.String... unlocLines)
Localizes the lines before sending them.
|
static void |
sendNoSpam(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.IChatComponent... lines)
First checks if the player is instanceof
EntityPlayerMP before
casting. |
static void |
sendNoSpam(net.minecraft.entity.player.EntityPlayerMP player,
net.minecraft.util.IChatComponent... lines)
Sends a chat message to the client, deleting past messages also sent via
this method.
|
static void |
sendNoSpam(net.minecraft.entity.player.EntityPlayerMP player,
java.lang.String... lines) |
static void |
sendNoSpam(net.minecraft.entity.player.EntityPlayer player,
java.lang.String... lines) |
static void |
sendNoSpamClient(net.minecraft.util.IChatComponent... lines)
Skips the packet sending, unsafe to call on servers.
|
static void |
sendNoSpamClient(java.lang.String... lines)
Same as
sendNoSpamClient(IChatComponent...), but wraps the Strings
automatically. |
static void |
sendNoSpamClientUnloc(java.lang.String... unlocLines)
Localizes the strings before sending them.
|
static void |
sendNoSpamUnloc(net.minecraft.entity.player.EntityPlayerMP player,
java.lang.String... unlocLines)
Localizes the strings before sending them.
|
static net.minecraft.util.IChatComponent[] |
wrap(java.lang.String... s) |
static net.minecraft.util.IChatComponent |
wrap(java.lang.String s)
Returns a standard
ChatComponentText for the given String. |
static net.minecraft.util.IChatComponent |
wrapFormatted(java.lang.String s,
java.lang.Object... args)
Returns a translatable chat component for the given string and format args.
|
public static net.minecraft.util.IChatComponent wrap(java.lang.String s)
ChatComponentText for the given String.s - The string to wrap.IChatComponent containing the string.public static net.minecraft.util.IChatComponent[] wrap(java.lang.String... s)
wrap(String)public static net.minecraft.util.IChatComponent wrapFormatted(java.lang.String s,
java.lang.Object... args)
s - The string to formatargs - The args to apply to the formatpublic static void sendChat(net.minecraft.entity.player.EntityPlayer player,
java.lang.String... lines)
player - The player to send the chat tolines - The lines to sendpublic static void sendChatUnloc(net.minecraft.entity.player.EntityPlayer player,
java.lang.String... unlocLines)
sendChat(EntityPlayer, String...)public static void sendChat(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.IChatComponent... lines)
player - The player to send the chat lines to.lines - The chat components to send.yespublic static void sendNoSpamClientUnloc(java.lang.String... unlocLines)
sendNoSpamClient(String...)public static void sendNoSpamClient(java.lang.String... lines)
sendNoSpamClient(IChatComponent...), but wraps the Strings
automatically.lines - The chat lines to sendwrap(String)public static void sendNoSpamClient(net.minecraft.util.IChatComponent... lines)
public static void sendNoSpamUnloc(net.minecraft.entity.player.EntityPlayerMP player,
java.lang.String... unlocLines)
sendNoSpam(EntityPlayer, String...)public static void sendNoSpam(net.minecraft.entity.player.EntityPlayer player,
java.lang.String... lines)
public static void sendNoSpam(net.minecraft.entity.player.EntityPlayer player,
net.minecraft.util.IChatComponent... lines)
EntityPlayerMP before
casting.public static void sendNoSpam(net.minecraft.entity.player.EntityPlayerMP player,
java.lang.String... lines)
public static void sendNoSpam(net.minecraft.entity.player.EntityPlayerMP player,
net.minecraft.util.IChatComponent... lines)
Credit to RWTema for the idea
player - The player to send the chat message tolines - The chat lines to send.