diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java index e6fbeefb0..2fefc266f 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/DefinedPacket.java @@ -42,7 +42,7 @@ public abstract class DefinedPacket public static byte[] readArray(ByteBuf buf) { - return readArray( buf, Short.MAX_VALUE ); + return readArray( buf, buf.readableBytes() ); } public static byte[] readArray(ByteBuf buf, int limit)