Skip to content

Commit

Permalink
Don't forward chat acknowledgement if the client didn't acknowledge a…
Browse files Browse the repository at this point in the history
…ny chat
  • Loading branch information
Gegy authored and kashike committed Jul 5, 2024
1 parent c6bb15c commit 4eae510
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ public void encode(ByteBuf buf) {
buf.writeBytes(Arrays.copyOf(acknowledged.toByteArray(), DIV_FLOOR));
}

public boolean isEmpty() {
return acknowledged.isEmpty();
}

public int getOffset() {
return this.offset;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ private MinecraftPacket consumeCommand(SessionPlayerCommandPacket packet) {
}
// An unsigned command with a 'last seen' update will not happen as of 1.20.5+, but for earlier versions - we still
// need to pass through the acknowledgement
return new ChatAcknowledgementPacket(packet.lastSeenMessages.getOffset());
final int offset = packet.lastSeenMessages.getOffset();
if (offset != 0) {
return new ChatAcknowledgementPacket(offset);
}
return null;
}

@Nullable
Expand Down

0 comments on commit 4eae510

Please sign in to comment.