diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java index 8cc1bf8c..904e848f 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java @@ -277,7 +277,6 @@ public class ConfigSessionHandler implements MinecraftSessionHandler { PluginMessageUtil.rewriteMinecraftBrand(packet, server.getVersion(), serverConn.getPlayer().getProtocolVersion())); } else { - byte[] bytes = ByteBufUtil.getBytes(packet.content()); ChannelIdentifier id = this.server.getChannelRegistrar().getFromId(packet.getChannel()); if (id == null) { @@ -287,6 +286,7 @@ public class ConfigSessionHandler implements MinecraftSessionHandler { // Handling this stuff async means that we should probably pause // the connection while we toss this off into another pool + byte[] bytes = ByteBufUtil.getBytes(packet.content()); this.serverConn.getConnection().setAutoReading(false); this.server.getEventManager() .fire(new PluginMessageEvent(serverConn, serverConn.getPlayer(), id, bytes)) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java index e4c754f9..5cb7188e 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientConfigSessionHandler.java @@ -135,7 +135,6 @@ public class ClientConfigSessionHandler implements MinecraftSessionHandler { } else if (BungeeCordMessageResponder.isBungeeCordMessage(packet)) { return true; } else if (serverConn != null) { - byte[] bytes = ByteBufUtil.getBytes(packet.content()); ChannelIdentifier id = this.server.getChannelRegistrar().getFromId(packet.getChannel()); if (id == null) { @@ -145,6 +144,7 @@ public class ClientConfigSessionHandler implements MinecraftSessionHandler { // Handling this stuff async means that we should probably pause // the connection while we toss this off into another pool + byte[] bytes = ByteBufUtil.getBytes(packet.content()); serverConn.getPlayer().getConnection().setAutoReading(false); this.server.getEventManager() .fire(new PluginMessageEvent(serverConn.getPlayer(), serverConn, id, bytes))