mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-13 00:37:52 +00:00
Fix network disconnect with message on the client side in NetworkDispatcher.
This commit is contained in:
1 parent
6b82a4fed8
commit
123f5919ba
1 file changed
+13
-6
@@ -229,14 +229,21 @@ public class NetworkDispatcher extends SimpleChannelInboundHandler<Packet> imple
|
||||
private void kickWithMessage(String message)
|
||||
{
|
||||
final ChatComponentText chatcomponenttext = new ChatComponentText(message);
|
||||
manager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>()
|
||||
if (side == Side.CLIENT)
|
||||
{
|
||||
@Override
|
||||
public void operationComplete(Future<?> result)
|
||||
manager.closeChannel(chatcomponenttext);
|
||||
}
|
||||
else
|
||||
{
|
||||
manager.scheduleOutboundPacket(new S40PacketDisconnect(chatcomponenttext), new GenericFutureListener<Future<?>>()
|
||||
{
|
||||
manager.closeChannel(chatcomponenttext);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void operationComplete(Future<?> result)
|
||||
{
|
||||
manager.closeChannel(chatcomponenttext);
|
||||
}
|
||||
});
|
||||
}
|
||||
manager.channel().config().setAutoRead(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user