package net.minecraft.network.protocol.game;

import net.minecraft.network.PacketListener;
import java.io.IOException;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.world.entity.Entity;
import net.minecraft.network.protocol.Packet;

public class ClientboundMoveVehiclePacket implements Packet<ClientGamePacketListener> {
    private double x;
    private double y;
    private double z;
    private float yRot;
    private float xRot;
    
    public ClientboundMoveVehiclePacket() {
    }
    
    public ClientboundMoveVehiclePacket(final Entity akq) {
        this.x = akq.getX();
        this.y = akq.getY();
        this.z = akq.getZ();
        this.yRot = akq.yRot;
        this.xRot = akq.xRot;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.x = kv.readDouble();
        this.y = kv.readDouble();
        this.z = kv.readDouble();
        this.yRot = kv.readFloat();
        this.xRot = kv.readFloat();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeDouble(this.x);
        kv.writeDouble(this.y);
        kv.writeDouble(this.z);
        kv.writeFloat(this.yRot);
        kv.writeFloat(this.xRot);
    }
    
    @Override
    public void handle(final ClientGamePacketListener lw) {
        lw.handleMoveVehicle(this);
    }
    
    public double getX() {
        return this.x;
    }
    
    public double getY() {
        return this.y;
    }
    
    public double getZ() {
        return this.z;
    }
    
    public float getYRot() {
        return this.yRot;
    }
    
    public float getXRot() {
        return this.xRot;
    }
}
