13
0
geforkt von Mirrors/Velocity

Run closeWith() logic in the event loop

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-06-04 01:35:32 -04:00
Ursprung ee4bae60a9
Commit 456b4b217f

Datei anzeigen

@ -205,8 +205,10 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
*/ */
public void closeWith(Object msg) { public void closeWith(Object msg) {
if (channel.isActive()) { if (channel.isActive()) {
channel.eventLoop().execute(() -> {
knownDisconnect = true; knownDisconnect = true;
channel.writeAndFlush(msg).addListener(ChannelFutureListener.CLOSE); channel.writeAndFlush(msg).addListener(ChannelFutureListener.CLOSE);
});
} }
} }