Skip to content

Commit

Permalink
be smarter about mod downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Nov 9, 2024
1 parent a7e9c54 commit 61d0432
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
12 changes: 0 additions & 12 deletions mods.json

This file was deleted.

25 changes: 12 additions & 13 deletions scripts/bot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ prop() {
| sed -E 's/^\w+\s*=\s*//'
}

hmc_version="$(prop 'headlessmc_version')"
mc_version="$(prop 'minecraft_version')"
hmc_version="$(prop 'headlessmc_version')"
fabric_api_version="$(prop 'fabric_api_version')"

# go to project root
cd "$(dirname "$(realpath "$0")")/.."
Expand Down Expand Up @@ -57,18 +58,16 @@ if test -z "$(find './mc/versions/' -maxdepth 1 -name "fabric-loader-*-${mc_vers
fi

# download mods
mkdir -p "mc/mods"
mods=$(jq -r '.mods' "../mods.json")
for mod in $(echo "$mods" | jq -c '.[]'); do
file=$(basename "$(echo "$mod" | jq -r '.url')")
url=$(echo "$mod" | jq -r '.url')
sha256=$(echo "$mod" | jq -r '.sha256')
if test ! -e "mc/mods/${file}"; then
echo "fetching ${file} from ${url}"
curl -sSL -o "mc/mods/${file}" "${url}"
echo "${sha256} mc/mods/${file}" | sha256sum -c -
fi
done
(
mkdir -p "mc/mods"
cd "mc/mods"

curl -fsSL -o 'fabric-api.jar' \
"https://github.com/FabricMC/fabric/releases/download/${fabric_api_version}/fabric-api-${fabric_api_version}.jar"

curl -fsSL -o 'baritone-api-fabric.jar' \
"https://github.com/nothub/baritone-mirror/raw/refs/heads/main/${mc_version}/baritone-api-fabric-${mc_version}.jar"
)

(
# go to project root
Expand Down

0 comments on commit 61d0432

Please sign in to comment.