package net.minecraft.network.protocol.game;

import net.minecraft.network.PacketListener;
import java.io.IOException;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.Packet;

public class ClientboundContainerClosePacket implements Packet<ClientGamePacketListener> {
    private int containerId;
    
    public ClientboundContainerClosePacket() {
    }
    
    public ClientboundContainerClosePacket(final int integer) {
        this.containerId = integer;
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleContainerClose(this);
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.containerId = mg.readUnsignedByte();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeByte(this.containerId);
    }
}
