From 8edde44161275daf882588c6d271365b78959ec5 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 11 Jan 2013 09:41:47 -0500 Subject: [PATCH] Fix incorrect end length calculation. Closes #161 Thanks BStramke! --- fml/common/cpw/mods/fml/common/network/FMLPacket.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fml/common/cpw/mods/fml/common/network/FMLPacket.java b/fml/common/cpw/mods/fml/common/network/FMLPacket.java index f1207fd1a..b54c9a0ef 100644 --- a/fml/common/cpw/mods/fml/common/network/FMLPacket.java +++ b/fml/common/cpw/mods/fml/common/network/FMLPacket.java @@ -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; }