2025-08-20 17:01:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2025-08-27 16:59:50 +00:00
|
|
|
# Main modpack project directory
|
2025-08-20 17:01:34 +00:00
|
|
|
cd "$(dirname "$0")"
|
2025-08-27 16:59:50 +00:00
|
|
|
basedir="$PWD"
|
2025-08-20 17:01:34 +00:00
|
|
|
|
2025-08-27 16:59:50 +00:00
|
|
|
# Location for downloading/updating the mc_rebalance mod
|
|
|
|
|
if [ ! -d deps ]; then
|
|
|
|
|
mkdir deps
|
|
|
|
|
fi;
|
|
|
|
|
|
2025-08-28 20:57:31 +00:00
|
|
|
# If the user provides input e.g. `./export-pack.sh 1`, clone the repository using https
|
|
|
|
|
if [ -n "$1" ]; then
|
|
|
|
|
repo_prefix="https://patience.nearmisses.xyz/"
|
|
|
|
|
else
|
|
|
|
|
repo_prefix="forgejo@patience.nearmisses.xyz:"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
mod_repo="$repo_prefix/patience/mc_rebalance.git"
|
|
|
|
|
pack_repo="$repo_prefix/SergeantAcoustic/mc_rebalance_datapack.git"
|
|
|
|
|
|
|
|
|
|
# Clone the repos if they exist, otherwise, update them
|
|
|
|
|
git clone "$mod_repo" "$basedir/deps/mc_rebalance" || (cd "$basedir/deps/mc_rebalance"; git pull) || exit 1
|
|
|
|
|
git clone "$pack_repo" "$basedir/overrides/global_packs/required_data/mc_rebalance_datapack/" || (cd "$basedir/overrides/global_packs/required_data/mc_rebalance_datapack/"; git pull) || exit 1
|
2025-08-27 16:59:50 +00:00
|
|
|
|
|
|
|
|
(cd "$basedir"/deps/mc_rebalance/ && ./gradlew build)
|
|
|
|
|
|
2025-09-01 04:33:44 +00:00
|
|
|
(cd "$basedir/overrides/global_packs/required_data/mc_rebalance_datapack/assets/minecraft/lang/" && ./gen-langs.sh)
|
|
|
|
|
|
2025-09-08 14:17:06 +00:00
|
|
|
cp "$basedir/deps/mc_rebalance/build/libs/mc_rebalance-1.20.1-"*".jar" "$basedir/overrides/mods"
|
2025-08-27 16:59:50 +00:00
|
|
|
|
|
|
|
|
# Final path for the modpack
|
2025-08-20 17:01:34 +00:00
|
|
|
if [ ! -d release ]; then
|
|
|
|
|
mkdir release
|
|
|
|
|
fi;
|
|
|
|
|
|
2025-11-26 16:24:37 +00:00
|
|
|
# Get version from the mrpack file
|
|
|
|
|
version="$(jq -r ".versionId" modrinth.index.json)"
|
|
|
|
|
|
|
|
|
|
# Export release to file
|
|
|
|
|
zip -FSr "$basedir/release/MC_Rebalance_${version}.mrpack" overrides modrinth.index.json -x "*.git*"
|