public synchronized Location toLocation(World world) {
        if (this.bukkitLocation == null || !this.bukkitLocation.getWorld().equals(world)) {
            this.bukkitLocation = new Location(world, this.position.getX(), this.position.getY(), this.position.getZ(), this.direction.getYaw(), this.direction.getPitch());
        }

        return this.bukkitLocation.clone();
    }
An immutable and serializable vector + direction object
helper/src/main/java/me/lucko/helper/serialize/VectorPoint.java