diff --git a/fclauncher/InstanceManager.go b/fclauncher/InstanceManager.go index bbb4ea0..c3645cc 100644 --- a/fclauncher/InstanceManager.go +++ b/fclauncher/InstanceManager.go @@ -11,6 +11,7 @@ import ( "runtime" "strconv" "strings" + "time" ) type Instance struct { @@ -146,6 +147,17 @@ func (i *InstanceManager)InstallModpack(modpack Modpack, instanceName string){ } +func (i *InstanceManager)InstallVanilla(version string, instanceName string) { + metadata, err := GetVersionMetadata(version) + if err != nil { + fmt.Printf("Unable to obtain metadata: %s\n", err) + } else { + fmt.Printf("Version Metadata: %+v", metadata) + } + time.Sleep(time.Second * 1) + return +} + func (i *InstanceManager)GetInstances() []Instance{ return i.instances } diff --git a/fclauncher/app.go b/fclauncher/app.go index 240b903..8d77820 100644 --- a/fclauncher/app.go +++ b/fclauncher/app.go @@ -61,6 +61,21 @@ func (a *App) CheckPrerequisites() { a.Java.InstallJavaVer(21) a.Status("Java 21 Installed") } + +} + +func (App) GetVersions() ([]string, error) { + manifest, err := GetVersionManifest() + if err != nil { + fmt.Printf("Manifest Error: %s\n", err) + return []string{}, err + } + versions := []string{} + for _, version := range manifest.Versions { + versions = append(versions, version.Id) + } + return versions, nil + } func (a *App) Status(status string) { diff --git a/fclauncher/frontend/src/Instances.svelte b/fclauncher/frontend/src/Instances.svelte index 4f75c5e..5ff508b 100644 --- a/fclauncher/frontend/src/Instances.svelte +++ b/fclauncher/frontend/src/Instances.svelte @@ -1,12 +1,13 @@