lcgo

package module
v0.0.0-...-69dc789 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeVersion

func ChangeVersion(config string, version string)

func DownloadTextures

func DownloadTextures(platform string, arch string, version string, path string, debug bool, module string)

func Launch

func Launch(config string, debug bool)

Launches LunarClient.

@param {string} config - Path to config file

@param {bool} debug - Toggles debug output

func Platform

func Platform() (platform string, arch string)

Returns the current Platform and architecture. Panics when LunarClient doesn't support the Platform and/or the architecture.

@returns {string} Platform - Current Platform (win32, linux, darwin)

@returns {string} arch - Current Platform architecture (amd64, amd64p32)

Types

type Artifacts

type Artifacts struct {
	Name string `json:"name"`
	Sha1 string `json:"sha1"`
	Url  string `json:"url"`
	Type string `json:"type"`
}

func DownloadArtifacts

func DownloadArtifacts(platform string, arch string, version string, path string, module string) (artifacts []Artifacts)

Download artifacts from LunarClient's API.

@param {string} platform - Current platform (win32, linux, darwin)

@param {string} arch - Current platform architecture (amd64, amd64p32)

@param {string} version - Minecraft version to download for (1.7, 1.8.9, ..., 1.19.4)

@param {string} path - Download path (~/.lunarclient/offline)

@returns {[]Artifacts} - Array of Artifacts

type LaunchArgs

type LaunchArgs struct {
	Env []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"env"`
	Module  string `json:"module"`
	PreJava string `json:"preJava"`
	Version string `json:"version"`
	Width   int    `json:"width"`
	Height  int    `json:"height"`
	JRE     string `json:"jre"`
	Memory  struct {
		Xms string `json:"Xms"`
		Xmx string `json:"Xmx"`
		Xss string `json:"Xss"`
		Xmn string `json:"Xmn"`
	}
	DownloadPath string   `json:"downloadPath"`
	Assets       string   `json:"assets"`
	Textures     string   `json:"textures"`
	Natives      string   `json:"natives"`
	MCDir        string   `json:"mcdir"`
	Agents       []string `json:"agents"`
	JVMArgs      []string `json:"JVM Args"`
}

type LaunchMeta

type LaunchMeta struct {
	Success        bool `json:"success"`
	LaunchTypeData struct {
		Artifacts []Artifacts `json:"artifacts"`
		MainClass string      `json:"mainClass"`
	} `json:"launchTypeData"`
	Licenses []struct {
		File string `json:"file"`
		URL  string `json:"url"`
		Sha1 string `json:"sha1"`
	} `json:"licenses"`
	Textures struct {
		IndexURL  string `json:"indexUrl"`
		IndexSha1 string `json:"indexSha1"`
		BaseURL   string `json:"baseUrl"`
	} `json:"textures"`
	Jre struct {
		Download struct {
			URL       string `json:"url"`
			Extension string `json:"extension"`
		} `json:"download"`
		ExecutablePathInArchive []string    `json:"executablePathInArchive"`
		CheckFiles              [][]string  `json:"checkFiles"`
		ExtraArguments          []string    `json:"extraArguments"`
		JavawDownload           interface{} `json:"javawDownload"`
		JavawExeChecksum        interface{} `json:"javawExeChecksum"`
		JavaExeChecksum         string      `json:"javaExeChecksum"`
	} `json:"jre"`
}

func FetchAPI

func FetchAPI(platform string, arch string, version string, module string) (response LaunchMeta, err error)

Fetch the LunarClient launch API endpoint.

@param {string} platform - Current platform (win32, linux, darwin)

@param {string} arch - Current platform architecture (amd64, amd64p32)

@param {string} version - Minecraft version to download for (1.7, 1.8.9, ..., 1.19.4)

@returns {LaunchMeta} response - API response Unmarshalled into a struct

@returns {error} err - Any errors that occured

Jump to

Keyboard shortcuts

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