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 ClientboundSetCarriedItemPacket implements Packet<ClientGamePacketListener> {
    private int slot;
    
    public ClientboundSetCarriedItemPacket() {
    }
    
    public ClientboundSetCarriedItemPacket(final int integer) {
        this.slot = integer;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.slot = mg.readByte();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeByte(this.slot);
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleSetCarriedItem(this);
    }
    
    public int getSlot() {
        return this.slot;
    }
}
