From c11e1663604cfa152b61bf061d6af9bf8d255f83 Mon Sep 17 00:00:00 2001 From: Sergeant Acoustic Date: Wed, 27 Aug 2025 17:59:50 +0100 Subject: [PATCH] Switch mc_rebalance from datapack to mod * Delete mc_rebalace submodule * Update export-pack.sh to clone the mod fork * Update README instructions --- .gitignore | 2 ++ .gitmodules | 4 ---- README.md | 22 ++++++++----------- export-pack.sh | 20 ++++++++++++++++- .../global_packs/required_data/mc_rebalance | 1 - 5 files changed, 30 insertions(+), 19 deletions(-) delete mode 160000 overrides/global_packs/required_data/mc_rebalance diff --git a/.gitignore b/.gitignore index d702569..6f03a90 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ release +deps +overrides/mods/0.0.1.jar diff --git a/.gitmodules b/.gitmodules index bdebc8b..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "overrides/global_packs/required_data/mc_rebalance"] - path = overrides/global_packs/required_data/mc_rebalance - url = https://patience.nearmisses.xyz/patience/mc_rebalance - branch = main diff --git a/README.md b/README.md index d9dfff1..0ba61a3 100644 --- a/README.md +++ b/README.md @@ -9,20 +9,16 @@ Packed in modrith format, for hosting make sure to add [for-host-put-these-in-wo 2. Drag into your mod loader of choice # Development -This repository imports mc_rebalance as a submodule +This repository no longer imports mc_rebalance as a submodule -Clone this repo with `git clone --recurse-submodules https://patience.nearmisses.xyz/SergeantAcoustic/tinkers_tinkering.git` - -When pulling, include the submodule with `git pull --recurse-submodules` - -## Updating submodule upstream -To update the embedded submodule to the latest available version: -1. If you cloned without `--recurse-submodules` run `git submodule update --init` -2. Run `git submodule update --remote` to update it -3. Stage the submodule's new pointer (e.g. `git add overrides/global_packs/required_data/mc_rebalance`) -4. Commit as usual (e.g. `git commit -m "Updated submodule"`) -5. `git push` +You can now pull/push as expected ## Exporting -To create a release, run [export-pack.sh](export-pack.sh). It will be generated in [release/Tinker's tinkering.mrpack](Tinker's%20tinkering.mrpack) +To create a release, run [./export-pack.sh](export-pack.sh) +* It will be generated in [release/Tinker's tinkering.mrpack](Tinker's%20tinkering.mrpack) + +* This script clones the [mc_rebalace](https://patience.nearmisses.xyz/patience/mc_rebalance) repo, so you will need to provide login credentials to git + +* Running `git config --global credential.helper store` will save these credentials to your global git config directory, saving having to input them again for nearmisses.xyz + * **Beware that this is stored in plaintext, so only do it on a private device** diff --git a/export-pack.sh b/export-pack.sh index 964ccbf..171b28f 100755 --- a/export-pack.sh +++ b/export-pack.sh @@ -1,9 +1,27 @@ #!/bin/bash +# Main modpack project directory cd "$(dirname "$0")" +basedir="$PWD" +# Location for downloading/updating the mc_rebalance mod +if [ ! -d deps ]; then + mkdir deps +fi; + +# Clone repo if it exists, otherwise, update it +# You may need to input login credentials due to the repo being private +# If you do, consider running `git config --global credential.helper store` + # Warning: saves as plaintext on your disk in your global git directory +git clone https://patience.nearmisses.xyz/patience/mc_rebalance -b mod $basedir/deps/mc_rebalance || (cd $basedir/deps/mc_rebalance; git pull) || exit 1 + +(cd "$basedir"/deps/mc_rebalance/ && ./gradlew build) + +cp "$basedir/deps/mc_rebalance/build/libs/mc_rebalance-1.20.1/0.0.1.jar" "$basedir/overrides/mods" + +# Final path for the modpack if [ ! -d release ]; then mkdir release fi; -zip -FSr "release/Tinker's tinkering.mrpack" overrides modrinth.index.json +zip -FSr "$basedir/release/Tinker's tinkering.mrpack" overrides modrinth.index.json diff --git a/overrides/global_packs/required_data/mc_rebalance b/overrides/global_packs/required_data/mc_rebalance deleted file mode 160000 index 8019df4..0000000 --- a/overrides/global_packs/required_data/mc_rebalance +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8019df46e0498adf683a914e7181d69cb01104aa