ClientboundPlayerRotationPacket .java

net.minecraft.network.protocol.game.ClientboundPlayerRotationPacket (record): members: yRot, relativeY, xRot, relativeX, handle, STREAM_CODEC, type.

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

Implements

API Surface (2)

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

Fields & Constants (1)

STREAM_CODEC

Same Package (197)

Code Graph: Dependencies (6)

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

Full Source

ClientboundPlayerRotationPacket.java31 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.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 ClientboundPlayerRotationPacket(float yRot, boolean relativeY, float xRot, boolean relativeX) implements Packet<ClientGamePacketListener> {
10
	public static final StreamCodec<FriendlyByteBuf, ClientboundPlayerRotationPacket> STREAM_CODEC = StreamCodec.composite(
11
		ByteBufCodecs.FLOAT,
12
		ClientboundPlayerRotationPacket::yRot,
13
		ByteBufCodecs.BOOL,
14
		ClientboundPlayerRotationPacket::relativeY,
15
		ByteBufCodecs.FLOAT,
16
		ClientboundPlayerRotationPacket::xRot,
17
		ByteBufCodecs.BOOL,
18
		ClientboundPlayerRotationPacket::relativeX,
19
		ClientboundPlayerRotationPacket::new
20
	);
21
22
	@Override
23
	public PacketType<ClientboundPlayerRotationPacket> type() {
24
		return GamePacketTypes.CLIENTBOUND_PLAYER_ROTATION;
25
	}
26
27
	public void handle(final ClientGamePacketListener listener) {
28
		listener.handleRotatePlayer(this);
29
	}
30
}
31

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