From 2f53388b9f819cc6074428ebcf0759c41703e84f Mon Sep 17 00:00:00 2001 From: TheMode Date: Sun, 11 Apr 2021 05:46:52 +0200 Subject: [PATCH] Fix velocity IP forwarding --- .../packet/client/login/LoginPluginResponsePacket.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minestom/server/network/packet/client/login/LoginPluginResponsePacket.java b/src/main/java/net/minestom/server/network/packet/client/login/LoginPluginResponsePacket.java index 17b40448c..6b8b93875 100644 --- a/src/main/java/net/minestom/server/network/packet/client/login/LoginPluginResponsePacket.java +++ b/src/main/java/net/minestom/server/network/packet/client/login/LoginPluginResponsePacket.java @@ -48,7 +48,7 @@ public class LoginPluginResponsePacket implements ClientPreplayPacket { // Velocity if (VelocityProxy.isEnabled() && channel.equals(VelocityProxy.PLAYER_INFO_CHANNEL)) { - if (data != null) { + if (data != null && data.length > 0) { BinaryReader reader = new BinaryReader(data); success = VelocityProxy.checkIntegrity(reader); if (success) { @@ -103,7 +103,7 @@ public class LoginPluginResponsePacket implements ClientPreplayPacket { writer.writeVarInt(messageId); writer.writeBoolean(successful); - if(successful) { + if (successful) { writer.writeBytes(data); } }