MinecraftForge/MinecraftForge — pull request #1579 by DysLabs (2014-12-16 05:30:00+00:00)
Title: Add an event to catch players sending a hat message

This adds a hook to EntityPlayerSP#sendChatMessage which allows mods to cancel a chat message message from being sent, modifying, or just inspecting it. I'm 99% sure I edited the base class incorrectly, my apologizes.

I also just realized that line 32 of EntityPlayerSP should be
this.sendQueue.addToSendQueue(new C01PacketChatMessage(evt.message));

Again, my apologizes.
http://pastebin.com/TSrnueuQ