I have written a mod for Minecraft using the Forge API which worked with Forge 6.4.0, but not with 6.4.2.
The problem is that the onConnectionClosed event of my IConnectionHandler implementation is not called when the client disconnects in 6.4.2.
Looking at NetClientHandler.java:
public void handleChat(Packet3Chat par1Packet3Chat)
ClientChatReceivedEvent event = new ClientChatReceivedEvent(par1Packet3Chat.message);
if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null)
It appears that the onConnectionClosed hook has been patched into the handleChat method.
Looking at the 'fml\patches\minecraft\net\minecraft\client\multiplayer\NetClientHandler.java.patch' file included with the Forge 22.214.171.1245:
@@ -754,6 +762,7 @@
public void func_72481_a(Packet3Chat p_72481_1_)
+ FMLNetworkHandler.onConnectionClosed(this.field_72555_g, this.getPlayer());
I may be mistaken, but I think onConnectionClosed is being patched into the wrong method.
Also, I did check the latest version 126.96.36.1993 and onConnectionClosed is still in handleChat.
My mod works correctly with Forge 188.8.131.526. In that version the onConnectionClosed hook is in NetClientHandler.quitWithPacket() rather than NetClientHandler.handleChat().