45 lines
1.4 KiB
Java
45 lines
1.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.network.protocol.game;
|
|
|
|
import net.minecraft.network.FriendlyByteBuf;
|
|
import net.minecraft.network.codec.StreamCodec;
|
|
import net.minecraft.network.protocol.Packet;
|
|
import net.minecraft.network.protocol.PacketType;
|
|
import net.minecraft.network.protocol.game.ClientGamePacketListener;
|
|
import net.minecraft.network.protocol.game.GamePacketTypes;
|
|
|
|
public class ClientboundContainerClosePacket
|
|
implements Packet<ClientGamePacketListener> {
|
|
public static final StreamCodec<FriendlyByteBuf, ClientboundContainerClosePacket> STREAM_CODEC = Packet.codec(ClientboundContainerClosePacket::write, ClientboundContainerClosePacket::new);
|
|
private final int containerId;
|
|
|
|
public ClientboundContainerClosePacket(int containerId) {
|
|
this.containerId = containerId;
|
|
}
|
|
|
|
private ClientboundContainerClosePacket(FriendlyByteBuf input) {
|
|
this.containerId = input.readContainerId();
|
|
}
|
|
|
|
private void write(FriendlyByteBuf output) {
|
|
output.writeContainerId(this.containerId);
|
|
}
|
|
|
|
@Override
|
|
public PacketType<ClientboundContainerClosePacket> type() {
|
|
return GamePacketTypes.CLIENTBOUND_CONTAINER_CLOSE;
|
|
}
|
|
|
|
@Override
|
|
public void handle(ClientGamePacketListener listener) {
|
|
listener.handleContainerClose(this);
|
|
}
|
|
|
|
public int getContainerId() {
|
|
return this.containerId;
|
|
}
|
|
}
|
|
|