ServerboundPongPacket .java

net.minecraft.network.protocol.common.ServerboundPongPacket (class, 37 lines): members: getId, handle, STREAM_CODEC, type. imports: FriendlyByteBuf.

net.minecraft.network.protocol.commonclass37 linescommon1005 B

Implements

API Surface (3)

PacketType<ServerboundPongPacket> type()
void handle(final ServerCommonPacketListener listener)
int getId()

Fields & Constants (2)

STREAM_CODEC
id

Code Graph: Dependencies (5)

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

Full Source

ServerboundPongPacket.java37 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
8
public class ServerboundPongPacket implements Packet<ServerCommonPacketListener> {
9
	public static final StreamCodec<FriendlyByteBuf, ServerboundPongPacket> STREAM_CODEC = Packet.codec(ServerboundPongPacket::write, ServerboundPongPacket::new);
10
	private final int id;
11
12
	public ServerboundPongPacket(final int id) {
13
		this.id = id;
14
	}
15
16
	private ServerboundPongPacket(final FriendlyByteBuf input) {
17
		this.id = input.readInt();
18
	}
19
20
	private void write(final FriendlyByteBuf output) {
21
		output.writeInt(this.id);
22
	}
23
24
	@Override
25
	public PacketType<ServerboundPongPacket> type() {
26
		return CommonPacketTypes.SERVERBOUND_PONG;
27
	}
28
29
	public void handle(final ServerCommonPacketListener listener) {
30
		listener.handlePong(this);
31
	}
32
33
	public int getId() {
34
		return this.id;
35
	}
36
}
37

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