diff --git a/server/quilt.go b/server/quilt.go index 7605677..688aa49 100644 --- a/server/quilt.go +++ b/server/quilt.go @@ -3,6 +3,7 @@ package server import ( "errors" "fmt" + "github.com/nothub/mrpack-install/maven" "github.com/nothub/mrpack-install/requester" "github.com/nothub/mrpack-install/util" "os" @@ -10,14 +11,18 @@ import ( "path" ) -const quiltInstallerUrl = "https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/0.5.0/quilt-installer-0.5.0.jar" - type Quilt struct { MinecraftVersion string QuiltVersion string } func (provider *Quilt) Provide(serverDir string, serverFile string) error { + meta, err := maven.FetchMetadata("https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/maven-metadata.xml") + if err != nil { + return err + } + quiltInstallerUrl := "https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-installer/" + meta.Versioning.Release + "/quilt-installer-" + meta.Versioning.Release + ".jar" + installer, err := requester.DefaultHttpClient.DownloadFile(quiltInstallerUrl, ".", "") if err != nil { return err