package common.packet;

import java.io.IOException;

import common.network.PacketBuffer;

public class CPacketPlayerPosition extends CPacketPlayer
{
    public CPacketPlayerPosition()
    {
        this.moving = true;
    }

    public CPacketPlayerPosition(double posX, double posY, double posZ, boolean isOnGround)
    {
        this.x = posX;
        this.y = posY;
        this.z = posZ;
        this.onGround = isOnGround;
        this.moving = true;
    }

    public void readPacketData(PacketBuffer buf) throws IOException
    {
        this.x = buf.readDouble();
        this.y = buf.readDouble();
        this.z = buf.readDouble();
        super.readPacketData(buf);
    }

    public void writePacketData(PacketBuffer buf) throws IOException
    {
        buf.writeDouble(this.x);
        buf.writeDouble(this.y);
        buf.writeDouble(this.z);
        super.writePacketData(buf);
    }
}