Fix viewable packet when a connection has multiple pairs

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2021-09-07 04:47:33 +02:00
parent adf1023e35
commit 1c76fd152e

View File

@ -290,11 +290,11 @@ public final class PacketUtils {
int lastWrite = 0;
final List<IntIntPair> pairs = entityIdMap.get(connection);
if (pairs != null && !pairs.isEmpty()) {
if (pairs != null) {
for (IntIntPair pair : pairs) {
final int start = pair.leftInt();
if (start != lastWrite) {
ByteBuffer slice = buffer.asByteBuffer(lastWrite, start);
ByteBuffer slice = buffer.asByteBuffer(lastWrite, start - lastWrite);
writer.accept(slice);
}
lastWrite = pair.rightInt();