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 ClientboundRemoveEntitiesPacket implements Packet<ClientGamePacketListener> {
    private int[] entityIds;
    
    public ClientboundRemoveEntitiesPacket() {
    }
    
    public ClientboundRemoveEntitiesPacket(final int... arr) {
        this.entityIds = arr;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.entityIds = new int[kv.readVarInt()];
        for (int integer3 = 0; integer3 < this.entityIds.length; ++integer3) {
            this.entityIds[integer3] = kv.readVarInt();
        }
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeVarInt(this.entityIds.length);
        for (final int integer6 : this.entityIds) {
            kv.writeVarInt(integer6);
        }
    }
    
    @Override
    public void handle(final ClientGamePacketListener lw) {
        lw.handleRemoveEntity(this);
    }
    
    public int[] getEntityIds() {
        return this.entityIds;
    }
}
