Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly calculate the size of INewChunk#getIntBiomeArray
This array is written to the PacketBuffer using PacketBuffer#writeVarIntArray, which writes both the array size and individual array elements as VarInts. However, JEID's calculation of the array size was leaving out the array length prefix, and assuming that each array element was exactly four bytes. Since a VarInt-encoded integer can range from 1 to 5 bytes, the calculation of the array size could end up being smaller than the actual number of bytes written, causing a crash. This commit makes JEID properly calculate the size of getIntBiomeArray, ensuring that the allocated buffer size always matches the number of bytes written.
- Loading branch information