ClientboundContainerSetDataPacket .java

net.minecraft.network.protocol.game.ClientboundContainerSetDataPacket (class): members: getContainerId, containerId, getValue, getId, value, handle, type.

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

Implements

API Surface (5)

PacketType<ClientboundContainerSetDataPacket> type()
void handle(final ClientGamePacketListener listener)
int getContainerId()
int getId()
int getValue()

Fields & Constants (4)

STREAM_CODEC
containerId
id
value

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

ClientboundContainerSetDataPacket.java55 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 ClientboundContainerSetDataPacket implements Packet<ClientGamePacketListener> {
9
	public static final StreamCodec<FriendlyByteBuf, ClientboundContainerSetDataPacket> STREAM_CODEC = Packet.codec(
10
		ClientboundContainerSetDataPacket::write, ClientboundContainerSetDataPacket::new
11
	);
12
	private final int containerId;
13
	private final int id;
14
	private final int value;
15
16
	public ClientboundContainerSetDataPacket(final int containerId, final int id, final int value) {
17
		this.containerId = containerId;
18
		this.id = id;
19
		this.value = value;
20
	}
21
22
	private ClientboundContainerSetDataPacket(final FriendlyByteBuf input) {
23
		this.containerId = input.readContainerId();
24
		this.id = input.readShort();
25
		this.value = input.readShort();
26
	}
27
28
	private void write(final FriendlyByteBuf output) {
29
		output.writeContainerId(this.containerId);
30
		output.writeShort(this.id);
31
		output.writeShort(this.value);
32
	}
33
34
	@Override
35
	public PacketType<ClientboundContainerSetDataPacket> type() {
36
		return GamePacketTypes.CLIENTBOUND_CONTAINER_SET_DATA;
37
	}
38
39
	public void handle(final ClientGamePacketListener listener) {
40
		listener.handleContainerSetData(this);
41
	}
42
43
	public int getContainerId() {
44
		return this.containerId;
45
	}
46
47
	public int getId() {
48
		return this.id;
49
	}
50
51
	public int getValue() {
52
		return this.value;
53
	}
54
}
55

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