classLoader#
- class Loader( )#
A specific mod loader version. Subclass it to support another loader.
- abstractmethod version_id( ) str#
Return the id this loader installs under in the
versionsdirectory.
- abstractmethod install(
- game: GameDir,
- *,
- java: Path | None = None,
- cache_dir: Path | None = None,
- session: Session | None = None,
- progress: Callable[[Progress], None] | None = None,
- cancel: CancelToken | None = None,
Install into
gameif needed and return the version id.- Parameters:
game (GameDir) – The game directory.
java (Path | None) – The Java binary to use, if the loader needs one.
cache_dir (Path | None) – The cache directory. Defaults to the per-user cache.
session (Session | None) – The session to use. A temporary one is created if omitted.
progress (Callable[[Progress], None] | None) – Receives updates for each stage.
cancel (CancelToken | None) – Stops the install.
- Returns:
The installed version id.
- Return type:
- expected_id() str | None#
Return the version id this loader should have, without any network use.
- Returns:
The version id, or None if it cannot be known in advance. That is the default, and
version_idis used instead.- Return type:
str | None