MinecraftForge/FML — pull request #231 by TomyLobo (2013-05-18 00:51:14+00:00)
Title: Add a packet listener system

(This is my first FML patch, so I hope I put everything in the right place.)

This patch adds a system to listen for, analyse, modify and cancel any incoming or outgoing packet.

````java
public class MyPacketListener extends PacketListener {
@Override
public boolean onOutgoingPacket(Packet packet, INetworkManager networkManager, NetHandler netHandler) {
if (packet instanceof Packet3Chat)
return false; // block all outgoing chat

return true;
}

@Override
public boolean onIncomingPacket(Packet packet, INetworkManager networkManager, NetHandler netHandler) {
if (packet instanceof Packet3Chat)
return false; // block all incoming chat

return true;
}
}
````
I'm willing to make changes in order to make it fit with the rest of FML or increase usability