mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +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;
|
int lastWrite = 0;
|
||||||
final List<IntIntPair> pairs = entityIdMap.get(connection);
|
final List<IntIntPair> pairs = entityIdMap.get(connection);
|
||||||
if (pairs != null && !pairs.isEmpty()) {
|
if (pairs != null) {
|
||||||
for (IntIntPair pair : pairs) {
|
for (IntIntPair pair : pairs) {
|
||||||
final int start = pair.leftInt();
|
final int start = pair.leftInt();
|
||||||
if (start != lastWrite) {
|
if (start != lastWrite) {
|
||||||
ByteBuffer slice = buffer.asByteBuffer(lastWrite, start);
|
ByteBuffer slice = buffer.asByteBuffer(lastWrite, start - lastWrite);
|
||||||
writer.accept(slice);
|
writer.accept(slice);
|
||||||
}
|
}
|
||||||
lastWrite = pair.rightInt();
|
lastWrite = pair.rightInt();
|
||||||
|
Loading…
Reference in New Issue
Block a user