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 nl) {
        nl.handleContainerAck(this);
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.containerId = mg.readUnsignedByte();
        this.uid = mg.readShort();
        this.accepted = mg.readBoolean();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeByte(this.containerId);
        mg.writeShort(this.uid);
        mg.writeBoolean(this.accepted);
    }
    
    public int getContainerId() {
        return this.containerId;
    }
    
    public short getUid() {
        return this.uid;
    }
    
    public boolean isAccepted() {
        return this.accepted;
    }
}
