launcher

package
v0.0.0-...-4a1ec1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2022 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVersionDoesntExist = errors.New("launcher: given version doesn't exist")
)

Functions

func CreateIconFromURL

func CreateIconFromURL(url string) (string, error)

CreateIconFromURL creates a string that can be used within a Profile as a profile icon, from a remote resource.

func GetLauncherDir

func GetLauncherDir() string

Gets the root directory of the Minecraft Launcher for the system minecraft is running on.

func InstallClientVersion

func InstallClientVersion(launcherDir string, versionName string) error

InstallClientVersion installs the given client version, to the given launcher directory.

func InstallProfile

func InstallProfile(id string, profile *Profile) error

Installs the given profile to the Minecraft launcher.

Types

type Profile

type Profile struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	GameDir string `json:"gameDir"`
	Icon    string `json:"icon"`
	Version string `json:"lastVersionId"`
}

Struct for quickly creating new profiles.

type Version

type Version struct {
	ID           string            `json:"id"`
	Type         string            `json:"type"`
	InheritsFrom string            `json:"inheritsFrom"`
	MainClass    string            `json:"mainClass,omitempty"`
	Libraries    []*VersionLibrary `json:"libraries,omitempty"`
	Downloads    struct {
	} `json:"downloads"`
}

Struct for creating simple version JSONs.

type VersionLibrary

type VersionLibrary struct {
	Name string `json:"name"`
	URL  string `json:"url,omitempty"`
}

func InstallLegacyLaunch

func InstallLegacyLaunch(launcherDir string) (*VersionLibrary, string, error)

Installs LegacyLaunch to the given launcher directory

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL