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 fu, final int integer3) {
        this.id = integer1;
        this.pos = fu;
        this.progress = integer3;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.id = mg.readVarInt();
        this.pos = mg.readBlockPos();
        this.progress = mg.readUnsignedByte();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeVarInt(this.id);
        mg.writeBlockPos(this.pos);
        mg.writeByte(this.progress);
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleBlockDestruction(this);
    }
    
    public int getId() {
        return this.id;
    }
    
    public BlockPos getPos() {
        return this.pos;
    }
    
    public int getProgress() {
        return this.progress;
    }
}
