package net.minecraft.network.protocol.game;

import net.minecraft.network.PacketListener;
import java.io.IOException;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity;
import net.minecraft.network.protocol.Packet;

public class ClientboundAnimatePacket implements Packet<ClientGamePacketListener> {
    private int id;
    private int action;
    
    public ClientboundAnimatePacket() {
    }
    
    public ClientboundAnimatePacket(final Entity akq, final int integer) {
        this.id = akq.getId();
        this.action = integer;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.id = kv.readVarInt();
        this.action = kv.readUnsignedByte();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeVarInt(this.id);
        kv.writeByte(this.action);
    }
    
    @Override
    public void handle(final ClientGamePacketListener lw) {
        lw.handleAnimate(this);
    }
    
    public int getId() {
        return this.id;
    }
    
    public int getAction() {
        return this.action;
    }
}
