mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +01:00
Fix viewable packet when a connection has multiple pairs
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
adf1023e35
commit
1c76fd152e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user