Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by mapwriter

  1. Hello, 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) { FMLNetworkHandler.onConnectionClosed(this.netManager, this.getPlayer()); ClientChatReceivedEvent event = new ClientChatReceivedEvent(par1Packet3Chat.message); if (!MinecraftForge.EVENT_BUS.post(event) && event.message != null) { this.mc.ingameGUI.getChatGUI().printChatMessage(par1Packet3Chat.message); } } 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 @@ -754,6 +762,7 @@ public void func_72481_a(Packet3Chat p_72481_1_) { + FMLNetworkHandler.onConnectionClosed(this.field_72555_g, this.getPlayer()); this.field_72563_h.field_71456_v.func_73827_b().func_73765_a(p_72481_1_.field_73476_b); } I may be mistaken, but I think onConnectionClosed is being patched into the wrong method. Also, I did check the latest version and onConnectionClosed is still in handleChat. Edit: My mod works correctly with Forge In that version the onConnectionClosed hook is in NetClientHandler.quitWithPacket() rather than NetClientHandler.handleChat(). Regards
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.