ClientboundDebugSamplePacket .java

net.minecraft.network.protocol.game.ClientboundDebugSamplePacket (record, 32 lines): members: sample, debugSampleType, write, handle, STREAM_CODEC, type.

net.minecraft.network.protocol.gamerecord32 linescommon1.1 KB

Implements

API Surface (2)

PacketType<ClientboundDebugSamplePacket> type()
void handle(final ClientGamePacketListener listener)

Fields & Constants (1)

STREAM_CODEC

Same Package (197)

Full Source

ClientboundDebugSamplePacket.java32 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.game;
2
3
import net.minecraft.network.FriendlyByteBuf;
4
import net.minecraft.network.codec.StreamCodec;
5
import net.minecraft.network.protocol.Packet;
6
import net.minecraft.network.protocol.PacketType;
7
import net.minecraft.util.debugchart.RemoteDebugSampleType;
8
9
public record ClientboundDebugSamplePacket(long[] sample, RemoteDebugSampleType debugSampleType) implements Packet<ClientGamePacketListener> {
10
	public static final StreamCodec<FriendlyByteBuf, ClientboundDebugSamplePacket> STREAM_CODEC = Packet.codec(
11
		ClientboundDebugSamplePacket::write, ClientboundDebugSamplePacket::new
12
	);
13
14
	private ClientboundDebugSamplePacket(final FriendlyByteBuf input) {
15
		this(input.readLongArray(), input.readEnum(RemoteDebugSampleType.class));
16
	}
17
18
	private void write(final FriendlyByteBuf output) {
19
		output.writeLongArray(this.sample);
20
		output.writeEnum(this.debugSampleType);
21
	}
22
23
	@Override
24
	public PacketType<ClientboundDebugSamplePacket> type() {
25
		return GamePacketTypes.CLIENTBOUND_DEBUG_SAMPLE;
26
	}
27
28
	public void handle(final ClientGamePacketListener listener) {
29
		listener.handleDebugSample(this);
30
	}
31
}
32

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