From dde4f7741ff83386f66792596ab058da388c263e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20H=C3=BCbner?= Date: Thu, 10 Oct 2024 21:35:10 +0200 Subject: [PATCH] neoforged maven url structure changed #54 --- server/neoforge.go | 3 ++- web/features.go | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/neoforge.go b/server/neoforge.go index 5d22e62..df8f608 100644 --- a/server/neoforge.go +++ b/server/neoforge.go @@ -1,6 +1,7 @@ package server import ( + "fmt" "github.com/nothub/mrpack-install/web" "log" ) @@ -17,7 +18,7 @@ func (inst *NeoForgeInstaller) Install(serverDir string, serverFile string) erro if inst.NeoForgeVersion == "" || inst.NeoForgeVersion == "latest" { log.Fatalln("automatic NeoForge version lookup not implemented\nplease set server version with --flavor-version flag") } - u := "https://maven.neoforged.net/net/neoforged/forge/" + inst.MinecraftVersion + "-" + inst.NeoForgeVersion + "/forge-" + inst.MinecraftVersion + "-" + inst.NeoForgeVersion + "-installer.jar" + u := fmt.Sprintf("https://maven.neoforged.net/releases/net/neoforged/neoforge/%s/neoforge-%s-installer.jar", inst.NeoForgeVersion, inst.NeoForgeVersion) file, err := web.DefaultClient.DownloadFile(u, serverDir, serverFile) if err != nil { return err diff --git a/web/features.go b/web/features.go index c1ba7f3..5bb7e92 100644 --- a/web/features.go +++ b/web/features.go @@ -68,6 +68,8 @@ func (c *Client) DownloadFile(url string, downloadDir string, fileName string) ( // TODO: this needs to (silently?) overwrite existing files! + log.Printf("downloading: %s", url) + request, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return "", err