ServerboundClientInformationPacket .java

net.minecraft.network.protocol.common.ServerboundClientInformationPacket (record, 31 lines): members: information, write, handle, STREAM_CODEC, type.

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

Implements

API Surface (2)

PacketType<ServerboundClientInformationPacket> type()
void handle(final ServerCommonPacketListener listener)

Fields & Constants (1)

STREAM_CODEC

Full Source

ServerboundClientInformationPacket.java31 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.common;
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.server.level.ClientInformation;
8
9
public record ServerboundClientInformationPacket(ClientInformation information) implements Packet<ServerCommonPacketListener> {
10
	public static final StreamCodec<FriendlyByteBuf, ServerboundClientInformationPacket> STREAM_CODEC = Packet.codec(
11
		ServerboundClientInformationPacket::write, ServerboundClientInformationPacket::new
12
	);
13
14
	private ServerboundClientInformationPacket(final FriendlyByteBuf input) {
15
		this(new ClientInformation(input));
16
	}
17
18
	private void write(final FriendlyByteBuf output) {
19
		this.information.write(output);
20
	}
21
22
	@Override
23
	public PacketType<ServerboundClientInformationPacket> type() {
24
		return CommonPacketTypes.SERVERBOUND_CLIENT_INFORMATION;
25
	}
26
27
	public void handle(final ServerCommonPacketListener listener) {
28
		listener.handleClientInformation(this);
29
	}
30
}
31

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