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 e6fbeefb..2fefc266 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)