ClientboundChunkBatchFinishedPacket 0x0B

ClientboundChunkBatchFinishedPacket: Minecraft 26.3 packet (0x0B Play clientbound). Wire name 'chunk_batch_finished', fields: batchSize, handled

Minecraft 26.3PlayClientboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x0B11PLAYClientboundGamePacketTypes.CLIENTBOUND_CHUNK_BATCH_FINISHED: "chunk_batch_finished"

Packet ids are positional: the id is the index of the addPacket call in the protocol builder (see ProtocolInfoBuilder.listPackets). Ids change between game versions.

Wire fields (1)

FieldType
batchSizeint

Fields are the components of the packet record.

Stream codec

static final StreamCodec<FriendlyByteBuf, ClientboundChunkBatchFinishedPacket> STREAM_CODEC = Packet.codec( ClientboundChunkBatchFinishedPacket::write, ClientboundChunkBatchFinishedPacket::new );

Modern packets serialize through StreamCodecs instead of read/write methods.

Handling

Resolved on the ClientGamePacketListener packet-listener interface by void handleChunkBatchFinished(ClientboundChunkBatchFinishedPacket clientboundchunkbatchfinishedpacket). The implementation in the game is ClientPacketListener.

Full Source

ClientboundChunkBatchFinishedPacket.java30 lines · Minecraft 26.3 · verbatimSource page ↗
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 record ClientboundChunkBatchFinishedPacket(int batchSize) implements Packet<ClientGamePacketListener> {
9
	public static final StreamCodec<FriendlyByteBuf, ClientboundChunkBatchFinishedPacket> STREAM_CODEC = Packet.codec(
10
		ClientboundChunkBatchFinishedPacket::write, ClientboundChunkBatchFinishedPacket::new
11
	);
12
13
	private ClientboundChunkBatchFinishedPacket(final FriendlyByteBuf input) {
14
		this(input.readVarInt());
15
	}
16
17
	private void write(final FriendlyByteBuf output) {
18
		output.writeVarInt(this.batchSize);
19
	}
20
21
	@Override
22
	public PacketType<ClientboundChunkBatchFinishedPacket> type() {
23
		return GamePacketTypes.CLIENTBOUND_CHUNK_BATCH_FINISHED;
24
	}
25
26
	public void handle(final ClientGamePacketListener listener) {
27
		listener.handleChunkBatchFinished(this);
28
	}
29
}
30