VersionLoader
Get version metadata list
All VersionLoader should inherit IVersionLoader
.
There are 3 version loaders, and you can make your own version loader.
VersionLoader return version metadata list as MVersionCollection
type.
LocalVersionLoader
: Get version metadata list from MinecraftPath.Versions
directory.
MojangVersionLoader
: Get version metadata list from mojang metadata server.
DefaultVersionLoader
: Get version metadatas using LocalVersionLoader
and MojangVersionLoader
, and merge two lists.
Example
IVersionLoader interface
Task GetVersionMetadatasAsync();
Get version metadata list.
MVersionCollection GetVersionMetadatas();
Get version metadata list.
LocalVersionLoader class
Get version metadata list from MinecraftPath.Versions
directory.
Inherit IVersionLoader
.
Constructors
public LocalVersionLoader(MinecraftPath path)
Set path to load versions.
MojangVersionLoader class
Get version metadata list from mojang version metadata server.
Inherit IVersionLoader
.
DefaultVersionLoader class
Get version metadata list using LocalVersionLoader
and MojangVersionLoader
, and merge two lists.
Constructors
public DefaultVersionLoader(MinecraftPath path)
Set path to load local versions.
MVersionCollection class
Manage MVersionMetadata lists.
Properties
LatestReleaseVersion
Type: MVersionMetadata
LatestSnapshotVersion
Type: MVersionMetadata
Methods
public MVersion GetVersion(string name)
Find MVersionMetadata named name
, parse that version metadata to MVersion
, and return it.
public MVersion GetVersion(MVersionMetadata versionMetadata)
Find versionMetadata
, parse that version metadata to MVersion
, and return it.
public void Merge(MVersionCollection from)
Merge two version collections.
Remove duplications, change LatestReleaseVersion
, LatestSnapshotVersion
properties.
Last updated