Little nitpicks

This commit is contained in:
themode 2024-03-18 00:02:54 +01:00
parent 007be52c93
commit 6758737b80
2 changed files with 5 additions and 1 deletions

View File

@ -227,7 +227,7 @@ public final class PacketUtils {
try {
payloadConsumer.accept(packetId, payload);
} catch (Exception e) {
// Empty
throw new RuntimeException(e);
}
// Position buffer to read the next packet
readBuffer.readerOffset(readerStart + packetLength);

View File

@ -113,6 +113,10 @@ public final class BinaryBuffer {
return writerOffset;
}
public void writerOffset(int offset) {
this.writerOffset = offset;
}
public int readableBytes() {
return writerOffset - readerOffset;
}