fix mcjar

This commit is contained in:
Freya Murphy 2024-06-06 21:39:50 -04:00
parent 04b1b8d4fc
commit 1b2c9f973c
Signed by: freya
GPG key ID: 744AB800E383AE52

View file

@ -227,9 +227,11 @@ forge() {
log "Using forge promotions slim json" log "Using forge promotions slim json"
name=""
url="" url=""
get_forge_url() { get_forge_url() {
local url
url="https://maven.minecraftforge.net/net/minecraftforge/forge/$1/forge-$1-installer.jar" url="https://maven.minecraftforge.net/net/minecraftforge/forge/$1/forge-$1-installer.jar"
code=0 code=0
wget -q --spider "$url" || code=$? wget -q --spider "$url" || code=$?
@ -272,13 +274,16 @@ forge() {
search_for_url() { search_for_url() {
log "Searching for forge URL" log "Searching for forge URL"
log "Trying MC_VERSION-FORGE_VERSION" log "Trying MC_VERSION-FORGE_VERSION"
ver=$(get_forge_url "$MC_VERSION-$FORGE_VERSION") name="$MC_VERSION-$FORGE_VERSION"
ver=$(get_forge_url "$name")
if [ "$ver" != "" ]; then url="$ver"; return 0; fi if [ "$ver" != "" ]; then url="$ver"; return 0; fi
log "Trying MC_VERSION-FORGE_VERSION-MC_VERSION" log "Trying MC_VERSION-FORGE_VERSION-MC_VERSION"
ver=$(get_forge_url "$MC_VERSION-$FORGE_VERSION-$MC_VERSION") name="$MC_VERSION-$FORGE_VERSION-$MC_VERSION"
ver=$(get_forge_url "$name")
if [ "$ver" != "" ]; then url="$ver"; return 0; fi if [ "$ver" != "" ]; then url="$ver"; return 0; fi
log "Trying MC_VERSION-FORGE_VERSION-mc172" log "Trying MC_VERSION-FORGE_VERSION-mc172"
ver=$(get_forge_url "$MC_VERSION-$FORGE_VERSION-mc172") name="$MC_VERSION-$FORGE_VERSION-mc172"
ver=$(get_forge_url "$name")
if [ "$ver" != "" ]; then url="$ver"; return 0; fi if [ "$ver" != "" ]; then url="$ver"; return 0; fi
error "Invalid VERSION: $MC_VERSION-$FORGE_VERSION" error "Invalid VERSION: $MC_VERSION-$FORGE_VERSION"
} }
@ -288,7 +293,7 @@ forge() {
search_for_url search_for_url
if [ $ALL -eq 1 ]; then if [ $ALL -eq 1 ]; then
echo "JAR_NAME=forge-$MC_VERSION-$FORGE_VERSION-installer.jar" echo "JAR_NAME=forge-$name-installer.jar"
echo "JAR_URL=$url" echo "JAR_URL=$url"
echo "MC_TYPE=$MC_TYPE" echo "MC_TYPE=$MC_TYPE"
echo "MC_VERSION=$MC_VERSION" echo "MC_VERSION=$MC_VERSION"