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 aom, final int integer) {
        this.id = aom.getId();
        this.action = integer;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.id = mg.readVarInt();
        this.action = mg.readUnsignedByte();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeVarInt(this.id);
        mg.writeByte(this.action);
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleAnimate(this);
    }
    
    public int getId() {
        return this.id;
    }
    
    public int getAction() {
        return this.action;
    }
}
