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 ClientboundSetDefaultSpawnPositionPacket implements Packet<ClientGamePacketListener> {
    private BlockPos pos;
    
    public ClientboundSetDefaultSpawnPositionPacket() {
    }
    
    public ClientboundSetDefaultSpawnPositionPacket(final BlockPos fu) {
        this.pos = fu;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.pos = mg.readBlockPos();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeBlockPos(this.pos);
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleSetSpawn(this);
    }
    
    public BlockPos getPos() {
        return this.pos;
    }
}
