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 fu) {
        this.transactionId = integer;
        this.pos = fu;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.transactionId = mg.readVarInt();
        this.pos = mg.readBlockPos();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeVarInt(this.transactionId);
        mg.writeBlockPos(this.pos);
    }
    
    @Override
    public void handle(final ServerGamePacketListener qz) {
        qz.handleBlockEntityTagQuery(this);
    }
    
    public int getTransactionId() {
        return this.transactionId;
    }
    
    public BlockPos getPos() {
        return this.pos;
    }
}
