Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadURL ¶
DownloadURL returns the download URL for the Forge 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", "1.7.10-pre4", "1.4").
- loaderVersion: the Forge loader version string (e.g., "14.23.4.2720").
Returns:
- string: the direct download URL for the Forge 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 JSON decoding issues occur.
func Loaders ¶
Loaders fetches a list of available Forge loader versions for a given Minecraft version. It retrieves the data from the official Forge maven metadata.
Parameters:
- gameVersion: the Minecraft version string (e.g., "1.21.6", "1.7.10-pre4", "1.4").
- latestFirst: if true, returns the loader versions with higher versions first. If false, returns the loader versions with lower versions first.
Returns:
- []string: a slice of Forge loader versions (e.g., "56.0.3", "14.23.4.2720").
- error: an error if the game version is not supported or if any HTTP or JSON decoding issues occur.
func Versions ¶
Versions fetches the list of all Minecraft Forge-supported game versions from the official Forge maven metadata.
Parameters:
- latestFirst: if true, returns the versions with higher versions first. If false, returns the versions with lower versions first.
Returns:
- []string: a slice of Minecraft versions supported by Forge (e.g., "1.21.6", "1.7.10-pre4", "1.4").
- error: an error if any HTTP or JSON decoding issues occur.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.