geforkt von Mirrors/Velocity
Suppress some really annoying spam
Dieser Commit ist enthalten in:
Ursprung
9dda0ba9dd
Commit
df82c0b566
@ -205,19 +205,32 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
|
||||
*/
|
||||
public void closeWith(Object msg) {
|
||||
if (channel.isActive()) {
|
||||
if (channel.eventLoop().inEventLoop()) {
|
||||
knownDisconnect = true;
|
||||
channel.writeAndFlush(msg).addListener(ChannelFutureListener.CLOSE);
|
||||
} else {
|
||||
channel.eventLoop().execute(() -> {
|
||||
knownDisconnect = true;
|
||||
channel.writeAndFlush(msg).addListener(ChannelFutureListener.CLOSE);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediately closes the connection.
|
||||
*/
|
||||
public void close() {
|
||||
if (channel.isActive()) {
|
||||
if (channel.eventLoop().inEventLoop()) {
|
||||
knownDisconnect = true;
|
||||
channel.close();
|
||||
} else {
|
||||
channel.eventLoop().execute(() -> {
|
||||
knownDisconnect = true;
|
||||
channel.close();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren