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 ClientboundTakeItemEntityPacket implements Packet<ClientGamePacketListener> {
    private int itemId;
    private int playerId;
    private int amount;
    
    public ClientboundTakeItemEntityPacket() {
    }
    
    public ClientboundTakeItemEntityPacket(final int integer1, final int integer2, final int integer3) {
        this.itemId = integer1;
        this.playerId = integer2;
        this.amount = integer3;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.itemId = kv.readVarInt();
        this.playerId = kv.readVarInt();
        this.amount = kv.readVarInt();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeVarInt(this.itemId);
        kv.writeVarInt(this.playerId);
        kv.writeVarInt(this.amount);
    }
    
    @Override
    public void handle(final ClientGamePacketListener lw) {
        lw.handleTakeItemEntity(this);
    }
    
    public int getItemId() {
        return this.itemId;
    }
    
    public int getPlayerId() {
        return this.playerId;
    }
    
    public int getAmount() {
        return this.amount;
    }
}
