Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
provider.BaseProvider
}
func (*Provider) Download ¶
func (p *Provider) Download(gameVersion, serverVersion, installDir string, onProgress func(current, total int64)) error
Download downloads the vanilla server JAR to the specified installation directory.
Parameters:
- gameVersion: the Minecraft version string (e.g., "1.16.5", "15w14a", "1.18-pre2").
- serverVersion: ignored for vanilla.
- installDir: the directory where the server JAR will be saved.
- onProgress: a callback function to report download progress.
Returns:
- error: an error if the download fails.
func (*Provider) DownloadURL ¶
DownloadURL returns the download URL for the Minecraft vanilla server JAR for a given game version.
Parameters:
- gameVersion: the Minecraft version string (e.g., "1.16.5", "15w14a", "1.18-pre2").
- serverVersion: ignored for vanilla as it doesn't have separate server versions.
Returns:
- string: the direct download URL for the server JAR file.
- error: an error if the version is not found or if any HTTP or JSON decoding issues occur.
func (*Provider) GameVersions ¶
GameVersions fetches the list of all Minecraft vanilla versions from the official Mojang API version manifest.
Returns:
- []string: a slice of Minecraft versions (e.g., "1.16.5", "15w14a", "1.18-pre2").
- error: an error if any HTTP or JSON decoding issues occur.
Click to show internal directories.
Click to hide internal directories.