launcher

package
v0.0.0-...-080ad10 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2022 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrSystemUnsupported  javaUnavailableErrno = iota
	ErrVersionUnavailable                      = iota
)
View Source
const (
	LatestSnapshotID = "latest-snapshot"
	LatestReleaseID  = "latest-release"
)
View Source
const DefaultJVMArgs = "" /* 149-byte string literal not displayed */

Variables

View Source
var LauncherIcons = []string{
	"Bedrock",
	"Bookshelf",
	"Brick",
	"Cake",
	"Carved_Pumpkin",
	"Chest",
	"Clay",
	"Coal_Block",
	"Coal_Ore",
	"Cobblestone",
	"Crafting_Table",
	"Creeper_Head",
	"Diamond_Block",
	"Diamond_Ore",
	"Dirt",
	"Dirt_Podzol",
	"Dirt_Snow",
	"Emerald_Block",
	"Emerald_Ore",
	"Enchanting_Table",
	"End_Stone",
	"Farmland",
	"Furnace",
	"Furnace_On",
	"Glass",
	"Glazed_Terracotta_Light_Blue",
	"Glazed_Terracotta_Orange",
	"Glazed_Terracotta_White",
	"Glowstone",
	"Gold_Block",
	"Gold_Ore",
	"Grass",
	"Gravel",
	"Hardened_Clay",
	"Ice_Packed",
	"Iron_Block",
	"Iron_Ore",
	"Lapis_Ore",
	"Leaves_Birch",
	"Leaves_Jungle",
	"Leaves_Oak",
	"Leaves_Spruce",
	"Lectern_Book",
	"Log_Acacia",
	"Log_Birch",
	"Log_DarkOak",
	"Log_Jungle",
	"Log_Oak",
	"Log_Spruce",
	"Mycelium",
	"Nether_Brick",
	"Netherrack",
	"Obsidian",
	"Planks_Acacia",
	"Planks_Birch",
	"Planks_DarkOak",
	"Planks_Jungle",
	"Planks_Oak",
	"Planks_Spruce",
	"Quartz_Ore",
	"Red_Sand",
	"Red_Sandstone",
	"Redstone_Block",
	"Redstone_Ore",
	"Sand",
	"Sandstone",
	"Skeleton_Skull",
	"Snow",
	"Soul_Sand",
	"Stone",
	"Stone_Andesite",
	"Stone_Diorite",
	"Stone_Granite",
	"TNT",
	"Water",
	"Wool",
}

Functions

func GetJRESelector

func GetJRESelector() (selector string)

GetJRESelector returns a selector, representing operating system and architecture to select the most appropriate JRE version in JavaRuntimesMap. It is used internally by GetMatching function.

func SelectKeyringBackend

func SelectKeyringBackend(selectFunc SelectBackendFunc) (keyring.BackendType, error)

Types

type Argument

type Argument struct {
	Rules Rules    `mapstructure:"rules"`
	Value []string `mapstructure:"value"`
}

func (Argument) MarshalJSON

func (a Argument) MarshalJSON() ([]byte, error)

func (*Argument) UnmarshalJSON

func (a *Argument) UnmarshalJSON(data []byte) error

type Arguments

type Arguments struct {
	Game []Argument `json:"game"`
	JVM  []Argument `json:"jvm"`
}

type Artifact

type Artifact struct {
	Download
	Path string `json:"path" validate:"required"`
}

type AspectRatio

type AspectRatio struct {
	Width  int
	Height int
}

type Asset

type Asset struct {
	Hash string `json:"hash"`
	Size int    `json:"size"`
}

func (*Asset) Path

func (a *Asset) Path() string

func (*Asset) URL

func (a *Asset) URL() string

type AssetIndex

type AssetIndex struct {
	MapToResources *bool            `json:"map_to_resources,omitempty"` // Whether the assets should be virtualized into the ${game_dir}/resources directory.
	Objects        map[string]Asset `json:"objects"`                    // All asset objects mapped under their file paths.
	Virtual        *bool            `json:"virtual,omitempty"`          // Whether the assets should be virtualized into the ${root}/assets/virtual directory.
}

func (*AssetIndex) GetMappingMethod

func (i *AssetIndex) GetMappingMethod() AssetsMappingMethod

func (*AssetIndex) Virtualize

func (i *AssetIndex) Virtualize(pr AssetPathResolver, virtualPath string, method AssetsMappingMethod) error

type AssetIndexDescriptor

type AssetIndexDescriptor struct {
	Download
	TotalSize uint64 `json:"totalSize" validate:"required"`
	ID        string `json:"id" validate:"required"`
}

type AssetPathResolver

type AssetPathResolver func(asset Asset) string

type AssetsMappingMethod

type AssetsMappingMethod byte
const (
	NoMapping AssetsMappingMethod = iota // Assets should not be mapped, game reads assets manually.
	AsCopies                             // Assets should be mapped in game directory, in resources folder.
	AsLinks                              // Assets should be mapped to virtual assets directory.
)

type CleanError

type CleanError struct {
	Suppressed []error
}

func (*CleanError) Error

func (e *CleanError) Error() string

type Download

type Download struct {
	SHA1 string `json:"sha1" validate:"required"`
	Size uint64 `json:"size" validate:"required"`
	URL  string `json:"url" validate:"required"`
}

type DownloadUnavailableError

type DownloadUnavailableError struct {
	Download string
}

func (*DownloadUnavailableError) Error

func (d *DownloadUnavailableError) Error() string

func (*DownloadUnavailableError) Is

func (d *DownloadUnavailableError) Is(target error) bool

type ExtractOptions

type ExtractOptions struct {
	Exclude []string `json:"exclude,omitempty"`
}

func (*ExtractOptions) Include

func (e *ExtractOptions) Include(name string) bool

type Feature

type Feature string
const (
	FeatDemoUser         Feature = "is_demo_user"
	FeatCustomResolution Feature = "has_custom_resolution"
)

type FileDownload

type FileDownload struct {
	ID string `json:"id"`
	// contains filtered or unexported fields
}

type FileState

type FileState int

FileState represents the state of a file.

const (
	FileStateUnknown       FileState = iota // File has not yet been checked.
	FileStateNotDownloaded                  // File has not yet been downloaded.
	FileStateCorrupted                      // File is corrupted and must be deleted.
	FileStateDownloaded                     // File is downloaded and ready to be mapped.
	FileStateReady                          // File is mapped and ready.
)

type IllegalDimensionValueError

type IllegalDimensionValueError struct {
	Value     string // Value that cannot be processed
	Dimension string // Either "width" or "height"
	Err       error  // Parsing error, if any
}

IllegalDimensionValueError is an error that is reported when value for specific dimension is incorrect.

func (*IllegalDimensionValueError) Error

func (*IllegalDimensionValueError) Is

func (e *IllegalDimensionValueError) Is(target error) bool

func (*IllegalDimensionValueError) Unwrap

func (e *IllegalDimensionValueError) Unwrap() error

type IllegalDimensionsNumberError

type IllegalDimensionsNumberError struct {
	Count int // The number of dimensions found, or -1 if none
}

IllegalDimensionsNumberError is an error that is reported when the dimensions number does not meet or exceeds allowed range (that is 2 dimensions - width and height).

func (*IllegalDimensionsNumberError) Error

func (*IllegalDimensionsNumberError) Is

func (e *IllegalDimensionsNumberError) Is(target error) bool

type Instance

type Instance struct {
	// Path to the instance directory
	Path string

	TemporalData map[any]any
	// contains filtered or unexported fields
}

func OpenInstance

func OpenInstance(name string) (*Instance, error)

func (*Instance) AssetIndexPath

func (w *Instance) AssetIndexPath(id string) string

func (*Instance) AssetsObjectsPath

func (w *Instance) AssetsObjectsPath() string

func (*Instance) AssetsVirtualPath

func (w *Instance) AssetsVirtualPath(id string) string

func (*Instance) Close

func (w *Instance) Close() error

func (*Instance) DefaultAssetsObjectResolver

func (w *Instance) DefaultAssetsObjectResolver() AssetPathResolver

func (*Instance) DownloadAssetIndex

func (w *Instance) DownloadAssetIndex(descriptor AssetIndexDescriptor) error

func (*Instance) DownloadAssets

func (w *Instance) DownloadAssets(index AssetIndex) error

func (*Instance) DownloadLibraries

func (w *Instance) DownloadLibraries(libraries []Library) error

func (*Instance) DownloadLibrary

func (w *Instance) DownloadLibrary(library *Library) error

func (*Instance) DownloadLogConfig

func (w *Instance) DownloadLogConfig(logConfig LoggingConfiguration) error

func (*Instance) DownloadVersion

func (w *Instance) DownloadVersion(versionFile Version) error

func (*Instance) DownloadVersionFile

func (w *Instance) DownloadVersionFile(descriptor VersionDescriptor) error

func (*Instance) ExtractNatives

func (w *Instance) ExtractNatives(v Version) (string, error)

func (*Instance) FetchJREs

func (w *Instance) FetchJREs(force bool) (runtimes *JavaRuntimesMap, err error)

FetchJREs checks whether existing Java Runtimes manifest file is not too old, then, if it is old, fetches anew, or otherwise, re-uses existing file, unless force argument is set to true.

func (*Instance) FetchVersions

func (w *Instance) FetchVersions(force bool) (manifest *VersionsManifest, err error)

func (*Instance) GetTempValue

func (w *Instance) GetTempValue(key any) any

func (*Instance) IndexVersions

func (w *Instance) IndexVersions() VersionRepository

IndexVersions tries to read all the versions in the versions' directory.

func (*Instance) InstallJRE

func (w *Instance) InstallJRE(runtimes JavaRuntimesMap, version string) error

func (*Instance) JREPath

func (w *Instance) JREPath(version string, selector string) string

func (*Instance) Launch

func (w *Instance) Launch(version Version, options LaunchOptions) (*LaunchResult, error)

func (*Instance) LibrariesPath

func (w *Instance) LibrariesPath() string

LibrariesPath returns expected path for the libraries to be placed in.

func (*Instance) LibraryPath

func (w *Instance) LibraryPath(coords maven.Coordinates) string

LibraryPath returns expected path for the library to be placed in.

func (*Instance) LogConfigPath

func (w *Instance) LogConfigPath(logConfig LoggingConfiguration) string

func (*Instance) OpenAccountsStore

func (w *Instance) OpenAccountsStore() (*accounts.StoreFile, error)

func (*Instance) OpenKeyring

func (w *Instance) OpenKeyring(opts KeyringOpenOptions) (keyring.Keyring, error)

func (*Instance) OpenSettings

func (w *Instance) OpenSettings() (*SettingsFile, error)

func (*Instance) ReadAssetIndex

func (w *Instance) ReadAssetIndex(id string) (i *AssetIndex, err error)

func (*Instance) ReadJREs

func (w *Instance) ReadJREs() (runtimes *JavaRuntimesMap, err error)

ReadJREs tries to read existing Java Runtimes manifest file

func (*Instance) ReadOrCreateProfiles

func (w *Instance) ReadOrCreateProfiles() (profiles *Profiles, err error)

func (*Instance) ReadProfiles

func (w *Instance) ReadProfiles() (profiles *Profiles, err error)

func (*Instance) ReadVersionFile

func (w *Instance) ReadVersionFile(id string) (v *Version, err error)

func (*Instance) ReadVersionWithInherits

func (w *Instance) ReadVersionWithInherits(id string) (*Version, error)

func (*Instance) ReadVersions

func (w *Instance) ReadVersions() (manifest *VersionsManifest, err error)

func (*Instance) SetTempValue

func (w *Instance) SetTempValue(key any, v any)

func (*Instance) VersionFilePath

func (w *Instance) VersionFilePath(id string, ext string) (string, error)

func (*Instance) VersionFolderPath

func (w *Instance) VersionFolderPath(id string) (string, error)

func (*Instance) WriteProfiles

func (w *Instance) WriteProfiles(profiles *Profiles) (err error)

type JREInstallation

type JREInstallation struct {
	Classifier string
	Selector   string
	Descriptor *JavaVersionDescriptor
	Manifest   *JavaManifest
	Path       string // Root path of the installation
	// contains filtered or unexported fields
}

func NewInstallation

func NewInstallation(classifier string, selector string, descriptor *JavaVersionDescriptor, path string) *JREInstallation

func (*JREInstallation) Install

func (i *JREInstallation) Install() error

type JREObject

type JREObject struct {
	JavaFile                    // File to download.
	Destination       string    // Where the object is stored.
	ObjectDestination string    // Where the unmapped object is stored.
	State             FileState // State of the file.
	IsRaw             bool      // Whether the file stores is raw or compressed.
}

type JavaFile

type JavaFile struct {
	Downloads  map[string]Download `json:"downloads"`  // Map of downloads per type (lzma, raw)
	Executable bool                `json:"executable"` // Whether this file must be granted executable permission on Linux
	Type       java.FileType       `json:"type"`       // File type
	Target     string              `json:"target"`     // If file is a link, target to where it links to
}

type JavaManifest

type JavaManifest struct {
	Files map[string]JavaFile `json:"files"` // All files to be extracted
}

type JavaRuntimesMap

type JavaRuntimesMap map[string]JavaVersionsMap

JavaRuntimesMap acts just like a normal map, fetched manifest from Mojang site is unmarshalled into this type. It contains maps of JRE versions mapped under the keys for different operating systems. For easy access method GetMatching method is provided, that will return needed map for current operating system.

func (JavaRuntimesMap) GetMatching

func (m JavaRuntimesMap) GetMatching() (versions JavaVersionsMap, selector string)

GetMatching returns a map of versions matching the current operating system (if any), as well as the selector reported by GetJRESelector function for when there's a need in those (e.g. logging or debugging).

type JavaUnavailableError

type JavaUnavailableError struct {
	System  string
	Version string
	Errno   javaUnavailableErrno
}

func (*JavaUnavailableError) Error

func (j *JavaUnavailableError) Error() (text string)

func (*JavaUnavailableError) Is

func (j *JavaUnavailableError) Is(target error) bool

type JavaVersion

type JavaVersion struct {
	Name     string              `json:"name"`     // Full version of the JRE
	Released sdtypes.RFC3339Time `json:"released"` // Time when the version was released
}

type JavaVersionDescriptor

type JavaVersionDescriptor struct {
	Manifest Download    `json:"manifest"` // Download for the JavaManifest file
	Version  JavaVersion `json:"version"`  // Represents Java version and release time
}

type JavaVersionDescriptors

type JavaVersionDescriptors []*JavaVersionDescriptor

JavaVersionDescriptors acts like a normal array of Java versions, but provides helpful method MostRecent to retrieve the most recent version from the array (if more than one).

func (JavaVersionDescriptors) Get

func (JavaVersionDescriptors) MostRecent

func (a JavaVersionDescriptors) MostRecent() (newest *JavaVersionDescriptor)

MostRecent returns most recently released Java version from the JavaVersionDescriptors array

type JavaVersionRecommendation

type JavaVersionRecommendation struct {
	Component    string `json:"component" validate:"required"`
	MajorVersion int    `json:"majorVersion" validate:"required"`
}

type JavaVersionsMap

type JavaVersionsMap map[string]JavaVersionDescriptors

JavaVersionsMap acts like a normal map of Java versions arrays, under the Mojang's identifiers.

type KeyringOpenOptions

type KeyringOpenOptions struct {
	Backend    keyring.BackendType // Keyring backend to use.
	PromptFunc keyring.PromptFunc  // PromptFunc is a function that is called when the keyring needs a password to unlock.
	PassCmd    string
	PassDir    string
}

type LatestVersions

type LatestVersions struct {
	Release  string `json:"release"`
	Snapshot string `json:"snapshot"`
}

type LaunchOptions

type LaunchOptions struct {
	Background    bool                   // Whether to launch the game in background with attacking it a child.
	JavaPath      string                 // Path to javaw executable.
	JavaArgs      *string                // User JVM arguments.
	Resolution    *Resolution            // Custom resolution.
	Authorization accounts.Authorization // Authorization.
	GameDirectory string                 // Directory where game stores its files like resource packs.
}

type LaunchResult

type LaunchResult struct {
	Command          *exec.Cmd
	NativesDirectory string
}

func (*LaunchResult) Clean

func (r *LaunchResult) Clean() error

type Library

type Library struct {
	Downloads   *LibraryDownloads `json:"downloads,omitempty"`
	Coordinates maven.Coordinates `json:"name"`
	URL         *string           `json:"url,omitempty"`
	Rules       Rules             `json:"rules,omitempty"`
	Extract     *ExtractOptions   `json:"extract,omitempty"`
	Natives     map[string]string `json:"natives,omitempty"`
}

func (*Library) GetMatchingNatives

func (l *Library) GetMatchingNatives() *Artifact

GetMatchingNatives returns the natives matching the current running OS and arch.

type LibraryDownloads

type LibraryDownloads struct {
	Artifact    *Artifact            `json:"artifact,omitempty"`
	Classifiers map[string]*Artifact `json:"classifiers,omitempty"`
}

type Log4JEvent

type Log4JEvent struct {
	XMLName   xml.Name                `xml:"Event"`
	Logger    string                  `xml:"logger,attr"`
	Timestamp sdtypes.EpochTimeMillis `xml:"timestamp,attr"`
	Level     string                  `xml:"level,attr"`
	Thread    string                  `xml:"thread,attr"`
	Message   Log4JMessage            `xml:"Message"`
}

type Log4JEventConsumer

type Log4JEventConsumer func(event Log4JEvent)

type Log4JMessage

type Log4JMessage struct {
	XMLName xml.Name `xml:"Message"`
	Content string   `xml:",cdata"`
}

type Log4JWriter

type Log4JWriter struct {
	Consumer Log4JEventConsumer
}

func (*Log4JWriter) Write

func (w *Log4JWriter) Write(data []byte) (n int, err error)

Log4JWriter implements io.Writer interface where each write is parsed as XML of Log4JEvent and transformed using the provided Formatter.

type LoggingConfiguration

type LoggingConfiguration struct {
	Argument string       `json:"argument"`
	File     FileDownload `json:"file"`
	Type     string       `json:"type"`
}

type ManifestCache

type ManifestCache struct {
	CachedManifest VersionsManifest
	CachedAt       time.Time
}

type OS

type OS struct {
	Name    *string `json:"name,omitempty"`
	Version *string `json:"version,omitempty"`
	Arch    *string `json:"arch,omitempty"`
}

func (*OS) Matches

func (o *OS) Matches() bool

type PostValidationError

type PostValidationError struct {
	BadObjects []JREObject
}

func (*PostValidationError) Error

func (p *PostValidationError) Error() string

type Profile

type Profile struct {
	// Date and time when the profile is created
	//
	// MCL compatibility: MCL does not care if this field is absent or null
	Created *sdtypes.ISOTime `json:"created,omitempty"`
	// Icon used for the profile: either launcher asset name or data:// URI
	//
	// MCL compatibility: MCL does not care if this field is absent or null (uses Furnace instead)
	Icon *string `json:"icon,omitempty"`
	// Date and time when this profile was last used
	//
	// MCL compatibility: MCL will reset this field if absent or null
	LastUsed sdtypes.ISOTime `json:"lastUsed"`
	// Version used by this profile
	//
	// MCL compatibility: MCL will ignore and delete profile if this field is absent or null
	LastVersionID string `json:"lastVersionId,omitempty"`
	// Profile name
	//
	// MCL compatibility: if this field is empty, MCL will just display "<unnamed installation>"
	Name string `json:"name"`
	// Profile type
	//
	// MCL compatibility: MCL does not care if this field is absent or null. It, however, does care if this is set to
	// "latest-release" or "latest-snapshot" in which case it will prevent user from changing the version and icon,
	// which will be set to grass block or crafting table depending on the type. Attempting to launch such version
	// also results in launching the latest release/snapshot, not the version specified in profile.
	Type string `json:"type"`
	// Arguments passed to JVM when launching this profile
	JavaArgs *string `json:"javaArgs,omitempty"`
	// Path to JavaW executable
	//
	// By unknown reason this is called JavaDir in JSON, but it expects path to JavaW executable. If this field is
	// omitted, the bundled version will be used instead.
	JavaPath *string `json:"javaDir,omitempty"`
	// Minecraft's resolution (size of the window) when launching this profile
	Resolution *Resolution `json:"resolution,omitempty"`
	// Directory where game files like resource packs and mods are stored.
	GameDir string `json:"gameDir,omitempty"`
}

type Profiles

type Profiles struct {
	Profiles        map[string]Profile `json:"profiles"`                  // All profiles saved in launcher
	Version         *int               `json:"version"`                   // Version of the file
	SelectedProfile *string            `json:"selectedProfile,omitempty"` // Selected profile.
	Unknown         j2n.UnknownFields  `json:"-"`                         // Support fields from Minecraft Launcher
}

type Resolution

type Resolution struct {
	Width  int `json:"width,omitempty"`
	Height int `json:"height,omitempty"`
}

func ParseResolution

func ParseResolution(v string) (*Resolution, error)

ParseResolution parses resolution in format WIDTHxHEIGHT or HEIGHTp, which returns LauncherProfileResolution with width and height fields set accordingly. Height is optional and can be omitted.

For value "auto" this function will return nothing (neither resolution, nor error).

func (*Resolution) CalculateMissingSides

func (r *Resolution) CalculateMissingSides(ratio AspectRatio) (res Resolution)

CalculateMissingSides calculates sizes for missing sides of resolution given the aspect ratio. If both sides are missing, then returns the initial value.

func (*Resolution) MarshalJSON

func (r *Resolution) MarshalJSON() ([]byte, error)

func (*Resolution) Max

func (r *Resolution) Max(c Resolution) (res Resolution)

func (*Resolution) Min

func (r *Resolution) Min(c Resolution) (res Resolution)

func (*Resolution) UnmarshalJSON

func (r *Resolution) UnmarshalJSON(data []byte) error

type ResolutionParseError

type ResolutionParseError struct {
	Input string
	Err   error
}

ResolutionParseError is an error that is reported when resolution cannot be parsed from string

func (*ResolutionParseError) Error

func (e *ResolutionParseError) Error() string

func (*ResolutionParseError) Is

func (e *ResolutionParseError) Is(target error) bool

func (*ResolutionParseError) Unwrap

func (e *ResolutionParseError) Unwrap() error

type Rule

type Rule struct {
	Action   RuleAction        `json:"action"`
	OS       *OS               `json:"os,omitempty"`
	Features *map[Feature]bool `json:"features,omitempty"`
}

func (*Rule) Decide

func (r *Rule) Decide() RuleAction

Decide decides the action to take based on basic rules. It does not take features into account, for this DecideExtensively must be used.

func (*Rule) DecideExtensively

func (r *Rule) DecideExtensively(featSet map[Feature]bool) RuleAction

DecideExtensively decides the action to take based on the rules. It does check basic rules, so it is pointless to call Decide together with it.

type RuleAction

type RuleAction string
const (
	Allow    RuleAction = "allow"
	Disallow RuleAction = "disallow"
)

func (*RuleAction) Invert

func (r *RuleAction) Invert() RuleAction

func (*RuleAction) IsValid

func (r *RuleAction) IsValid() error

func (*RuleAction) MarshalJSON

func (r *RuleAction) MarshalJSON() ([]byte, error)

func (*RuleAction) String

func (r *RuleAction) String() (string, error)

func (*RuleAction) UnmarshalJSON

func (r *RuleAction) UnmarshalJSON(i []byte) error

type Rules

type Rules []Rule

func (*Rules) Matches

func (r *Rules) Matches() bool

func (*Rules) MatchesExtensively

func (r *Rules) MatchesExtensively(featSet map[Feature]bool) bool

type SelectBackendFunc

type SelectBackendFunc func(backends []keyring.BackendType) (keyring.BackendType, error)

type Settings

type Settings struct {
	Versioned `mapstructure:",squash"`
	Keyring   struct {
		Backend *keyring.BackendType `mapstructure:"backend"`
		PassCmd string               `mapstructure:"pass-cmd"`
		PassDir string               `mapstructure:"pass-dir"`
	} `mapstructure:"keyring"`
}

type SettingsFile

type SettingsFile struct {
	Settings // Actual settings.
	// contains filtered or unexported fields
}

func NewSettings

func NewSettings(name string) *SettingsFile

func (*SettingsFile) Read

func (s *SettingsFile) Read() (err error)

func (*SettingsFile) Save

func (s *SettingsFile) Save() error

type Version

type Version struct {
	Arguments              *Arguments                      `json:"arguments,omitempty"`
	AssetIndex             *AssetIndexDescriptor           `json:"assetIndex,omitempty"`
	Assets                 *string                         `json:"assets,omitempty"`
	ComplianceLevel        *int                            `json:"complianceLevel,omitempty"`
	Downloads              map[string]Download             `json:"downloads,omitempty"`
	ID                     string                          `json:"id"`
	JavaVersion            *JavaVersionRecommendation      `json:"javaVersion,omitempty"`
	Libraries              []Library                       `json:"libraries"`
	Logging                map[string]LoggingConfiguration `json:"logging,omitempty"`
	MainClass              string                          `json:"mainClass"`
	MinimumLauncherVersion int                             `json:"minimumLauncherVersion"`
	ReleaseTime            *sdtypes.ISOTime                `json:"releaseTime"`
	Time                   *sdtypes.ISOTime                `json:"time"`
	Type                   *string                         `json:"type"`
	InheritsFrom           *string                         `json:"inheritsFrom,omitempty"`
	MinecraftArguments     *string                         `json:"minecraftArguments,omitempty"`
}

func MergeVersions

func MergeVersions(a, b Version) (res Version, err error)

type VersionDescriptor

type VersionDescriptor struct {
	ID              string              `json:"id"`
	Type            string              `json:"type"`
	URL             string              `json:"url"`
	Time            sdtypes.RFC3339Time `json:"time"`
	ReleaseTime     sdtypes.RFC3339Time `json:"releaseTime"`
	SHA1            string              `json:"sha1"`
	ComplianceLevel int                 `json:"complianceLevel"`
}

type VersionRepository

type VersionRepository map[string]*Version

type Versioned

type Versioned struct {
	Version int `mapstructure:"version"`
}

type VersionsManifest

type VersionsManifest struct {
	Latest   LatestVersions      `json:"latest"`
	Versions []VersionDescriptor `json:"versions"`
}

func (*VersionsManifest) GetVersion

func (v *VersionsManifest) GetVersion(id string) *VersionDescriptor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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