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