ClientboundCustomReportDetailsPacket .java

net.minecraft.network.protocol.common.ClientboundCustomReportDetailsPacket (record, 31 lines): members: details, MAX_DETAIL_VALUE_LENGTH, MAX_DETAIL_COUNT.

net.minecraft.network.protocol.commonrecord31 linescommon1.3 KB

Implements

API Surface (2)

PacketType<ClientboundCustomReportDetailsPacket> type()
void handle(final ClientCommonPacketListener listener)

Fields & Constants (5)

MAX_DETAIL_KEY_LENGTH
MAX_DETAIL_VALUE_LENGTH
MAX_DETAIL_COUNT
DETAILS_STREAM_CODEC
STREAM_CODEC

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ClientboundCustomReportDetailsPacket.java31 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.common;
2
3
import io.netty.buffer.ByteBuf;
4
import java.util.HashMap;
5
import java.util.Map;
6
import net.minecraft.network.codec.ByteBufCodecs;
7
import net.minecraft.network.codec.StreamCodec;
8
import net.minecraft.network.protocol.Packet;
9
import net.minecraft.network.protocol.PacketType;
10
11
public record ClientboundCustomReportDetailsPacket(Map<String, String> details) implements Packet<ClientCommonPacketListener> {
12
	private static final int MAX_DETAIL_KEY_LENGTH = 128;
13
	private static final int MAX_DETAIL_VALUE_LENGTH = 4096;
14
	private static final int MAX_DETAIL_COUNT = 32;
15
	private static final StreamCodec<ByteBuf, Map<String, String>> DETAILS_STREAM_CODEC = ByteBufCodecs.map(
16
		HashMap::new, ByteBufCodecs.stringUtf8(128), ByteBufCodecs.stringUtf8(4096), 32
17
	);
18
	public static final StreamCodec<ByteBuf, ClientboundCustomReportDetailsPacket> STREAM_CODEC = StreamCodec.composite(
19
		DETAILS_STREAM_CODEC, ClientboundCustomReportDetailsPacket::details, ClientboundCustomReportDetailsPacket::new
20
	);
21
22
	@Override
23
	public PacketType<ClientboundCustomReportDetailsPacket> type() {
24
		return CommonPacketTypes.CLIENTBOUND_CUSTOM_REPORT_DETAILS;
25
	}
26
27
	public void handle(final ClientCommonPacketListener listener) {
28
		listener.handleCustomReportDetails(this);
29
	}
30
}
31

Decompiled Minecraft 26.3 source of ClientboundCustomReportDetailsPacket (net/minecraft/network/protocol/common/ClientboundCustomReportDetailsPacket.java) with Mojang official mappings, stored verbatim on the site.