Fix incorrect end length calculation. Closes #161 Thanks BStramke!
This commit is contained in:
parent
79c7933b5e
commit
8edde44161
1 changed files with 1 additions and 1 deletions
|
@ -110,7 +110,7 @@ public abstract class FMLPacket
|
|||
for (int i = 0; i < packetData.length / 32000 + 1; i++)
|
||||
{
|
||||
int len = Math.min(32000, packetData.length - i* 32000);
|
||||
chunks[i] = Bytes.concat(new byte[] { UnsignedBytes.checkedCast(type.ordinal()), UnsignedBytes.checkedCast(i), UnsignedBytes.checkedCast(chunks.length)}, Ints.toByteArray(len), Arrays.copyOfRange(packetData, i * 32000, len));
|
||||
chunks[i] = Bytes.concat(new byte[] { UnsignedBytes.checkedCast(type.ordinal()), UnsignedBytes.checkedCast(i), UnsignedBytes.checkedCast(chunks.length)}, Ints.toByteArray(len), Arrays.copyOfRange(packetData, i * 32000, len + i * 32000));
|
||||
}
|
||||
return chunks;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue