ClientboundSetChunkCacheCenterPacket .java

net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket (class, 47 lines): members: getZ, getX, handle, STREAM_CODEC, type.

net.minecraft.network.protocol.gameclass47 linescommon1.3 KB

Implements

API Surface (4)

PacketType<ClientboundSetChunkCacheCenterPacket> type()
void handle(final ClientGamePacketListener listener)
int getX()
int getZ()

Fields & Constants (3)

STREAM_CODEC
x
z

Same Package (197)

Code Graph: Dependencies (5)

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

Full Source

ClientboundSetChunkCacheCenterPacket.java47 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
8
public class ClientboundSetChunkCacheCenterPacket implements Packet<ClientGamePacketListener> {
9
	public static final StreamCodec<FriendlyByteBuf, ClientboundSetChunkCacheCenterPacket> STREAM_CODEC = Packet.codec(
10
		ClientboundSetChunkCacheCenterPacket::write, ClientboundSetChunkCacheCenterPacket::new
11
	);
12
	private final int x;
13
	private final int z;
14
15
	public ClientboundSetChunkCacheCenterPacket(final int x, final int z) {
16
		this.x = x;
17
		this.z = z;
18
	}
19
20
	private ClientboundSetChunkCacheCenterPacket(final FriendlyByteBuf input) {
21
		this.x = input.readVarInt();
22
		this.z = input.readVarInt();
23
	}
24
25
	private void write(final FriendlyByteBuf output) {
26
		output.writeVarInt(this.x);
27
		output.writeVarInt(this.z);
28
	}
29
30
	@Override
31
	public PacketType<ClientboundSetChunkCacheCenterPacket> type() {
32
		return GamePacketTypes.CLIENTBOUND_SET_CHUNK_CACHE_CENTER;
33
	}
34
35
	public void handle(final ClientGamePacketListener listener) {
36
		listener.handleSetChunkCacheCenter(this);
37
	}
38
39
	public int getX() {
40
		return this.x;
41
	}
42
43
	public int getZ() {
44
		return this.z;
45
	}
46
}
47

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