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 ServerboundContainerButtonClickPacket implements Packet<ServerGamePacketListener> {
    private int containerId;
    private int buttonId;
    
    public ServerboundContainerButtonClickPacket() {
    }
    
    public ServerboundContainerButtonClickPacket(final int integer1, final int integer2) {
        this.containerId = integer1;
        this.buttonId = integer2;
    }
    
    @Override
    public void handle(final ServerGamePacketListener pl) {
        pl.handleContainerButtonClick(this);
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.containerId = kv.readByte();
        this.buttonId = kv.readByte();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeByte(this.containerId);
        kv.writeByte(this.buttonId);
    }
    
    public int getContainerId() {
        return this.containerId;
    }
    
    public int getButtonId() {
        return this.buttonId;
    }
}
