package common.packet;

import java.io.IOException;

import common.network.PacketBuffer;

public class CPacketPlayerLook extends CPacketPlayer
{
    public CPacketPlayerLook()
    {
        this.rotating = true;
    }

    public CPacketPlayerLook(float playerYaw, float playerPitch, boolean isOnGround)
    {
        this.yaw = playerYaw;
        this.pitch = playerPitch;
        this.onGround = isOnGround;
        this.rotating = true;
    }

    public void readPacketData(PacketBuffer buf) throws IOException
    {
        this.yaw = buf.readFloat();
        this.pitch = buf.readFloat();
        super.readPacketData(buf);
    }

    public void writePacketData(PacketBuffer buf) throws IOException
    {
        buf.writeFloat(this.yaw);
        buf.writeFloat(this.pitch);
        super.writePacketData(buf);
    }
}