From 18f936842741ce1490a486f6028cd5f4b0f4e784 Mon Sep 17 00:00:00 2001 From: Gabik21 Date: Thu, 5 Nov 2020 12:32:35 +0100 Subject: [PATCH] Fix ping response being delayed on 1.7 --- .../velocitypowered/proxy/connection/MinecraftConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java index 191cb7ab1..acf7fe5cc 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java @@ -225,7 +225,7 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter { if (channel.isActive()) { boolean is17 = this.getProtocolVersion().compareTo(ProtocolVersion.MINECRAFT_1_8) < 0 && this.getProtocolVersion().compareTo(ProtocolVersion.MINECRAFT_1_7_2) >= 0; - if (is17) { + if (is17 && this.getState() != StateRegistry.STATUS) { channel.eventLoop().execute(() -> { // 1.7.x versions have a race condition with switching protocol states, so just explicitly // close the connection after a short while.