package common.packet;

import java.io.IOException;

import common.network.PacketBuffer;

public class SPacketEntityRelMove extends SPacketEntity
{
    public SPacketEntityRelMove()
    {
    }

    public SPacketEntityRelMove(int entityIdIn, byte x, byte y, byte z, boolean onGroundIn)
    {
        super(entityIdIn);
        this.posX = x;
        this.posY = y;
        this.posZ = z;
        this.onGround = onGroundIn;
    }

    public void readPacketData(PacketBuffer buf) throws IOException
    {
        super.readPacketData(buf);
        this.posX = buf.readByte();
        this.posY = buf.readByte();
        this.posZ = buf.readByte();
        this.onGround = buf.readBoolean();
    }

    public void writePacketData(PacketBuffer buf) throws IOException
    {
        super.writePacketData(buf);
        buf.writeByte(this.posX);
        buf.writeByte(this.posY);
        buf.writeByte(this.posZ);
        buf.writeBoolean(this.onGround);
    }
}