from pathlib import Path


def get_world_paths() -> list:
    """
    Returns a list of paths to the worlds on the server.
    """
    server_dir = Path(__file__).resolve().parents[1]
    world_paths = []
    for p in server_dir.iterdir():
        if p.is_dir and (p / "level.dat").is_file():
            world_paths.append(p.absolute())
    return world_paths