use of net.minecraft.client.gui.GuiNewChat in project ImmersiveEngineering by BluSunrize.
the class ChatUtils method sendClientNoSpamMessages.
//Credit goes to WayOfFlowingTime
@SideOnly(Side.CLIENT)
public static void sendClientNoSpamMessages(ITextComponent[] messages) {
GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
for (int i = DELETION_ID + messages.length - 1; i <= lastAdded; i++) chat.deleteChatLine(i);
for (int i = 0; i < messages.length; i++) chat.printChatMessageWithOptionalDeletion(messages[i], DELETION_ID + i);
lastAdded = DELETION_ID + messages.length - 1;
}
use of net.minecraft.client.gui.GuiNewChat in project Bookshelf by Darkhax-Minecraft.
the class PlayerUtils method sendSpamlessMessage.
/**
* Sends a spamless message to the chat. A spamless message is one that only shows up in
* the chat once. If another version of the message were to be added to chat, the earlier
* one would be removed.
*
* @param messageID A unique message ID used to separate your message from the others. It
* is highly recommended to use a random number to prevent conflicts with other mods
* doing similar things. Each message type should have it's own ID.
* @param message The message to send to chat, this message will replace earlier messages
* in the gui that use the same ID.
*/
@SideOnly(Side.CLIENT)
public static void sendSpamlessMessage(int messageID, ITextComponent message) {
final GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
chat.printChatMessageWithOptionalDeletion(message, messageID);
}
Aggregations