From c8e3e7ff941c94e06a53d5e97d0254e7461d2be9 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Wed, 20 Feb 2019 21:19:04 -0500 Subject: [PATCH] Initializing the handshake registry explicitly is redundant. --- .../proxy/connection/backend/VelocityServerConnection.java | 1 - .../proxy/network/ServerChannelInitializer.java | 1 - .../proxy/server/VelocityRegisteredServer.java | 4 +--- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java index c7fc697d8..0eae3f0c8 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java @@ -93,7 +93,6 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation, .addListener((ChannelFutureListener) future -> { if (future.isSuccess()) { connection = new MinecraftConnection(future.channel(), server); - connection.setState(StateRegistry.HANDSHAKE); connection.setAssociation(VelocityServerConnection.this); future.channel().pipeline().addLast(HANDLER, connection); diff --git a/proxy/src/main/java/com/velocitypowered/proxy/network/ServerChannelInitializer.java b/proxy/src/main/java/com/velocitypowered/proxy/network/ServerChannelInitializer.java index f4083e311..b71aa01e2 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/network/ServerChannelInitializer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/network/ServerChannelInitializer.java @@ -48,7 +48,6 @@ public class ServerChannelInitializer extends ChannelInitializer { .addLast(MINECRAFT_ENCODER, new MinecraftEncoder(ProtocolUtils.Direction.CLIENTBOUND)); final MinecraftConnection connection = new MinecraftConnection(ch, this.server); - connection.setState(StateRegistry.HANDSHAKE); connection.setSessionHandler(new HandshakeSessionHandler(connection, this.server)); ch.pipeline().addLast(Connections.HANDLER, connection); diff --git a/proxy/src/main/java/com/velocitypowered/proxy/server/VelocityRegisteredServer.java b/proxy/src/main/java/com/velocitypowered/proxy/server/VelocityRegisteredServer.java index 431c6e742..c0109467e 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/server/VelocityRegisteredServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/server/VelocityRegisteredServer.java @@ -78,9 +78,7 @@ public class VelocityRegisteredServer implements RegisteredServer { .addLast(MINECRAFT_ENCODER, new MinecraftEncoder(ProtocolUtils.Direction.SERVERBOUND)); - MinecraftConnection connection = new MinecraftConnection(ch, server); - connection.setState(StateRegistry.HANDSHAKE); - ch.pipeline().addLast(HANDLER, connection); + ch.pipeline().addLast(HANDLER, new MinecraftConnection(ch, server)); } }) .connect(serverInfo.getAddress())