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 NeoForge installer JAR to the specified installation directory.
Parameters:
- gameVersion: the Minecraft version string (e.g., "1.21.6", "25w14craftmine", "1.21").
- serverVersion: the NeoForge loader version.
- installDir: the directory where the installer 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 NeoForge server file for a given game version and loader version. It determines the correct URL format based on the game version.
Parameters:
- gameVersion: the Minecraft version string (e.g., "1.21.6", "25w14craftmine", "1.21").
- serverVersion: the NeoForge loader version string (e.g., "21.0.142-beta", "0.25w14craftmine.5-beta").
Returns:
- string: the direct download URL for the NeoForge server installer/archive file if the versions exist.
- error: an error if the game version or loader version is not found, or if any HTTP or XML decoding issues occur.
func (*Provider) GameVersions ¶
GameVersions fetches the list of all Minecraft NeoForge-supported game versions from the official NeoForged maven metadata.
Returns:
- []string: a slice of Minecraft versions supported by NeoForge (e.g., "1.21.6", "25w14craftmine", "1.21").
- error: an error if any HTTP or XML decoding issues occur.
func (*Provider) ServerVersions ¶
ServerVersions fetches a list of available NeoForge loader versions for a given Minecraft version. It retrieves the data from the official NeoForged maven metadata.
Parameters:
- gameVersion: the Minecraft version string (e.g., "1.21.6", "25w14craftmine", "1.21").
Returns:
- []string: a slice of NeoForge loader versions (e.g., "21.0.142-beta", "0.25w14craftmine.5-beta").
- error: an error if the game version is not supported or if any HTTP or XML decoding issues occur.
Click to show internal directories.
Click to hide internal directories.