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 ServerboundPickItemPacket implements Packet<ServerGamePacketListener> {
    private int slot;
    
    public ServerboundPickItemPacket() {
    }
    
    public ServerboundPickItemPacket(final int integer) {
        this.slot = integer;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.slot = kv.readVarInt();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeVarInt(this.slot);
    }
    
    @Override
    public void handle(final ServerGamePacketListener pl) {
        pl.handlePickItem(this);
    }
    
    public int getSlot() {
        return this.slot;
    }
}
