ClientboundBlockDestructionPacket .java

net.minecraft.network.protocol.game.ClientboundBlockDestructionPacket (class, 56 lines): members: getProgress, progress, getPos, getId, handle, pos, type.

net.minecraft.network.protocol.gameclass56 linescommon1.5 KB

Implements

API Surface (5)

PacketType<ClientboundBlockDestructionPacket> type()
void handle(final ClientGamePacketListener listener)
int getId()
BlockPos getPos()
int getProgress()

Fields & Constants (4)

STREAM_CODEC
id
pos
progress

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

ClientboundBlockDestructionPacket.java56 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.game;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.network.FriendlyByteBuf;
5
import net.minecraft.network.codec.StreamCodec;
6
import net.minecraft.network.protocol.Packet;
7
import net.minecraft.network.protocol.PacketType;
8
9
public class ClientboundBlockDestructionPacket implements Packet<ClientGamePacketListener> {
10
	public static final StreamCodec<FriendlyByteBuf, ClientboundBlockDestructionPacket> STREAM_CODEC = Packet.codec(
11
		ClientboundBlockDestructionPacket::write, ClientboundBlockDestructionPacket::new
12
	);
13
	private final int id;
14
	private final BlockPos pos;
15
	private final int progress;
16
17
	public ClientboundBlockDestructionPacket(final int id, final BlockPos pos, final int progress) {
18
		this.id = id;
19
		this.pos = pos;
20
		this.progress = progress;
21
	}
22
23
	private ClientboundBlockDestructionPacket(final FriendlyByteBuf input) {
24
		this.id = input.readVarInt();
25
		this.pos = input.readBlockPos();
26
		this.progress = input.readUnsignedByte();
27
	}
28
29
	private void write(final FriendlyByteBuf output) {
30
		output.writeVarInt(this.id);
31
		output.writeBlockPos(this.pos);
32
		output.writeByte(this.progress);
33
	}
34
35
	@Override
36
	public PacketType<ClientboundBlockDestructionPacket> type() {
37
		return GamePacketTypes.CLIENTBOUND_BLOCK_DESTRUCTION;
38
	}
39
40
	public void handle(final ClientGamePacketListener listener) {
41
		listener.handleBlockDestruction(this);
42
	}
43
44
	public int getId() {
45
		return this.id;
46
	}
47
48
	public BlockPos getPos() {
49
		return this.pos;
50
	}
51
52
	public int getProgress() {
53
		return this.progress;
54
	}
55
}
56

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