ClientboundCodeOfConductPacket .java

net.minecraft.network.protocol.configuration.ClientboundCodeOfConductPacket (record): members: codeOfConduct, handle, STREAM_CODEC, type. imports: ByteBuf.

net.minecraft.network.protocol.configurationrecord23 linescommon886 B

Implements

API Surface (2)

PacketType<ClientboundCodeOfConductPacket> type()
void handle(final ClientConfigurationPacketListener listener)

Fields & Constants (1)

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

ClientboundCodeOfConductPacket.java23 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.configuration;
2
3
import io.netty.buffer.ByteBuf;
4
import net.minecraft.network.codec.ByteBufCodecs;
5
import net.minecraft.network.codec.StreamCodec;
6
import net.minecraft.network.protocol.Packet;
7
import net.minecraft.network.protocol.PacketType;
8
9
public record ClientboundCodeOfConductPacket(String codeOfConduct) implements Packet<ClientConfigurationPacketListener> {
10
	public static final StreamCodec<ByteBuf, ClientboundCodeOfConductPacket> STREAM_CODEC = StreamCodec.composite(
11
		ByteBufCodecs.STRING_UTF8, ClientboundCodeOfConductPacket::codeOfConduct, ClientboundCodeOfConductPacket::new
12
	);
13
14
	@Override
15
	public PacketType<ClientboundCodeOfConductPacket> type() {
16
		return ConfigurationPacketTypes.CLIENTBOUND_CODE_OF_CONDUCT;
17
	}
18
19
	public void handle(final ClientConfigurationPacketListener listener) {
20
		listener.handleCodeOfConduct(this);
21
	}
22
}
23

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