diff --git a/src/main/java/ca/teamdman/sfm/common/net/ClientboundManagerLogsPacket.java b/src/main/java/ca/teamdman/sfm/common/net/ClientboundManagerLogsPacket.java index 7528777b5..3066d2a8b 100644 --- a/src/main/java/ca/teamdman/sfm/common/net/ClientboundManagerLogsPacket.java +++ b/src/main/java/ca/teamdman/sfm/common/net/ClientboundManagerLogsPacket.java @@ -42,7 +42,9 @@ public static void encode( ) { friendlyByteBuf.writeVarInt(msg.windowId()); friendlyByteBuf.writeVarInt(msg.logsBuf.readableBytes()); - friendlyByteBuf.writeBytes(msg.logsBuf); + friendlyByteBuf.writeBytes(msg.logsBuf, 0, msg.logsBuf.readableBytes()); // !!!IMPORTANT!!! + // We use this write method specifically to NOT modify the reader index. + // The encode method may be called multiple times, so we want to ensure it is idempotent. } public static ClientboundManagerLogsPacket decode(FriendlyByteBuf friendlyByteBuf) {