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 ServerboundBlockEntityTagQuery implements Packet<ServerGamePacketListener> {
    private int transactionId;
    private BlockPos pos;
    
    public ServerboundBlockEntityTagQuery() {
    }
    
    public ServerboundBlockEntityTagQuery(final int integer, final BlockPos fk) {
        this.transactionId = integer;
        this.pos = fk;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.transactionId = kv.readVarInt();
        this.pos = kv.readBlockPos();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeVarInt(this.transactionId);
        kv.writeBlockPos(this.pos);
    }
    
    @Override
    public void handle(final ServerGamePacketListener pl) {
        pl.handleBlockEntityTagQuery(this);
    }
    
    public int getTransactionId() {
        return this.transactionId;
    }
    
    public BlockPos getPos() {
        return this.pos;
    }
}
