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