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 mg) throws IOException {
        this.slot = mg.readShort();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeShort(this.slot);
    }
    
    @Override
    public void handle(final ServerGamePacketListener qz) {
        qz.handleSetCarriedItem(this);
    }
    
    public int getSlot() {
        return this.slot;
    }
}
