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 ClientboundContainerAckPacket implements Packet<ClientGamePacketListener> {
    private int containerId;
    private short uid;
    private boolean accepted;
    
    public ClientboundContainerAckPacket() {
    }
    
    public ClientboundContainerAckPacket(final int integer, final short short2, final boolean boolean3) {
        this.containerId = integer;
        this.uid = short2;
        this.accepted = boolean3;
    }
    
    @Override
    public void handle(final ClientGamePacketListener lw) {
        lw.handleContainerAck(this);
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.containerId = kv.readUnsignedByte();
        this.uid = kv.readShort();
        this.accepted = kv.readBoolean();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeByte(this.containerId);
        kv.writeShort(this.uid);
        kv.writeBoolean(this.accepted);
    }
    
    public int getContainerId() {
        return this.containerId;
    }
    
    public short getUid() {
        return this.uid;
    }
    
    public boolean isAccepted() {
        return this.accepted;
    }
}
