package net.minecraft.network.protocol.game;

import net.minecraft.network.PacketListener;
import java.io.IOException;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.core.BlockPos;
import net.minecraft.network.protocol.Packet;

public class ClientboundBlockDestructionPacket implements Packet<ClientGamePacketListener> {
    private int id;
    private BlockPos pos;
    private int progress;
    
    public ClientboundBlockDestructionPacket() {
    }
    
    public ClientboundBlockDestructionPacket(final int integer1, final BlockPos fk, final int integer3) {
        this.id = integer1;
        this.pos = fk;
        this.progress = integer3;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.id = kv.readVarInt();
        this.pos = kv.readBlockPos();
        this.progress = kv.readUnsignedByte();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeVarInt(this.id);
        kv.writeBlockPos(this.pos);
        kv.writeByte(this.progress);
    }
    
    @Override
    public void handle(final ClientGamePacketListener lw) {
        lw.handleBlockDestruction(this);
    }
    
    public int getId() {
        return this.id;
    }
    
    public BlockPos getPos() {
        return this.pos;
    }
    
    public int getProgress() {
        return this.progress;
    }
}
