Skip to content

Commit

Permalink
neoforged maven url structure changed #54
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Oct 10, 2024
1 parent b049d9e commit dde4f77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/neoforge.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package server

import (
"fmt"
"github.com/nothub/mrpack-install/web"
"log"
)
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions web/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dde4f77

Please sign in to comment.