List of usage examples for net.minecraftforge.event ServerChatEvent getUsername
public String getUsername()
From source file:com.cnaude.purpleirc.GameListeners.GamePlayerChatListener.java
License:Open Source License
@SubscribeEvent(receiveCanceled = true) public void onServerChat(ServerChatEvent event) { plugin.logDebug("[onServerChat]: " + event.getUsername() + ": " + event.getMessage()); if (event.isCanceled() && !plugin.ignoreChatCancel) { plugin.logDebug(/*from w w w . ja va2 s. co m*/ "Chat canceled! Accepting cancellation due to ignore-chat-cancel = " + plugin.ignoreChatCancel); return; } EntityPlayerMP player = (EntityPlayerMP) event.getPlayer(); for (PurpleBot ircBot : plugin.ircBots.values()) { plugin.logDebug("[onServerChat]: Calling gameChat()..."); ircBot.gameChat(player, event.getMessage()); } }