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 aom) {
        this.x = aom.getX();
        this.y = aom.getY();
        this.z = aom.getZ();
        this.yRot = aom.yRot;
        this.xRot = aom.xRot;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.x = mg.readDouble();
        this.y = mg.readDouble();
        this.z = mg.readDouble();
        this.yRot = mg.readFloat();
        this.xRot = mg.readFloat();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeDouble(this.x);
        mg.writeDouble(this.y);
        mg.writeDouble(this.z);
        mg.writeFloat(this.yRot);
        mg.writeFloat(this.xRot);
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.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;
    }
}
