13
0
geforkt von Mirrors/Velocity

Suppress some really annoying spam

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-06-23 07:56:19 -04:00
Ursprung 9dda0ba9dd
Commit df82c0b566

Datei anzeigen

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