def METHOD_NAME(
    self,
    world: Optional[FileSystemPath] = None,
    minecraft: Optional[FileSystemPath] = None,
    data_pack: Optional[FileSystemPath] = None,
    resource_pack: Optional[FileSystemPath] = None,
):
    """Associate minecraft directories to the project."""
    if minecraft:
        minecraft = Path(minecraft).resolve()
        if not minecraft.is_dir():
            raise ErrorMessage(f"The specified Minecraft folder does not exist.")
    else:
        self.locate_minecraft()
        minecraft = Path(self.minecraft) if self.minecraft else None
    if world:
        world_name = world
        world = Path(world).resolve()
        if not (world / "level.dat").is_file():
            if minecraft and Path(world_name).parts == (world_name,):
                world = minecraft / "saves" / world_name
                if not world.is_dir():
                    raise ErrorMessage(
                        f"Couldn't find {str(world_name)!r} in the Minecraft save folder."
                    )
            else:
                raise ErrorMessage(f"The specified world folder is invalid.")
    else:
        world = None
    if data_pack:
        data_pack = Path(data_pack).resolve()
        if not data_pack.is_dir():
            raise ErrorMessage(
                f"The specified data packs directory does not exist."
            )
    elif world:
        data_pack = world / "datapacks"
    else:
        data_pack = None
    if data_pack and not world:
        world = data_pack.parent
    if world and not minecraft:
        minecraft = world.parent.parent
    if resource_pack:
        resource_pack = Path(resource_pack).resolve()
        if not resource_pack.is_dir():
            raise ErrorMessage(
                f"The specified resource packs directory does not exist."
            )
    elif minecraft:
        resource_pack = minecraft / "resourcepacks"
    else:
        resource_pack = None
    if resource_pack and not minecraft:
        minecraft = resource_pack.parent
    if world:
        self.world = str(world)
    if minecraft:
        self.minecraft = str(minecraft)
    if data_pack:
        self.data_pack = str(data_pack)
    if resource_pack:
        self.resource_pack = str(resource_pack)