ClientboundOpenBookPacket .java

net.minecraft.network.protocol.game.ClientboundOpenBookPacket (record, 23 lines): members: hand, handle, STREAM_CODEC, type. imports: InteractionHand.

net.minecraft.network.protocol.gamerecord23 linescommon824 B

Implements

API Surface (2)

PacketType<ClientboundOpenBookPacket> 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

ClientboundOpenBookPacket.java23 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.world.InteractionHand;
8
9
public record ClientboundOpenBookPacket(InteractionHand hand) implements Packet<ClientGamePacketListener> {
10
	public static final StreamCodec<FriendlyByteBuf, ClientboundOpenBookPacket> STREAM_CODEC = StreamCodec.composite(
11
		InteractionHand.STREAM_CODEC, ClientboundOpenBookPacket::hand, ClientboundOpenBookPacket::new
12
	);
13
14
	@Override
15
	public PacketType<ClientboundOpenBookPacket> type() {
16
		return GamePacketTypes.CLIENTBOUND_OPEN_BOOK;
17
	}
18
19
	public void handle(final ClientGamePacketListener listener) {
20
		listener.handleOpenBook(this);
21
	}
22
}
23

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