classLoader#
- class Loader( )#
A specific mod loader version. Subclass it to support another loader.
- classmethod available( ) list[LoaderVersion]#
List this loader’s versions for a Minecraft version, newest first.
Override it so
versionsandrecommendedcan offer the loader.- Parameters:
- Returns:
The versions, empty if the loader does not support that Minecraft version. At most one is marked recommended.
- Raises:
UnsupportedError – The loader cannot list its versions. That is the default.
NetworkError – The loader’s version list could not be fetched.
- Return type:
- classmethod from_version( ) Self | None#
Recognise this loader in an installed version JSON.
Override it so
detectcan find the loader in game directories.
- 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