From 651b7bb1503391259e1fd5cebbd828292d04bfb5 Mon Sep 17 00:00:00 2001 From: Sergeant Acoustic Date: Thu, 28 Aug 2025 21:57:31 +0100 Subject: [PATCH] Change how mc_rebalance_datapack is fetched * Delete submodule * Add old submodule's repo to export-pack.sh script * Update README accordingly --- .gitignore | 1 + .gitmodules | 3 -- README.md | 30 ++++++++----------- export-pack.sh | 18 +++++++---- .../required_data/mc_rebalance_datapack | 1 - 5 files changed, 26 insertions(+), 27 deletions(-) delete mode 160000 overrides/global_packs/required_data/mc_rebalance_datapack diff --git a/.gitignore b/.gitignore index 6f03a90..e0667d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ release deps overrides/mods/0.0.1.jar +overrides/global_packs/required_data/mc_rebalance_datapack/ diff --git a/.gitmodules b/.gitmodules index 9c51bb7..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "overrides/global_packs/required_data/mc_rebalance_datapack"] - path = overrides/global_packs/required_data/mc_rebalance_datapack - url = https://patience.nearmisses.xyz/SergeantAcoustic/mc_rebalance_datapack diff --git a/README.md b/README.md index 8bd5caa..015e235 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Tinker's Tinkering -First modpack variant for [mc_rebalance](https://patience.nearmisses.xyz/patience/mc_rebalance) +First modpack variant for [Minecraft Rebalance](https://patience.nearmisses.xyz/patience/mc_rebalance) Packed in modrith format, for hosting make sure to add [for-host-put-these-in-world](overrides/for-host-put-these-in-world) to your world file @@ -9,26 +9,20 @@ 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_datapack 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` - -## Exporting +## Export script 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 +### Saving login details +This script clones the [mc_rebalace](https://patience.nearmisses.xyz/patience/mc_rebalance) and [mc_rebalance_datapack](https://patience.nearmisses.xyz/SergeantAcoustic/mc_rebalance_datapack) repos, so you will need to provide login credentials to git twice every time you run the script. -* 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 +To solve this, consider one of the following: + +#### SSH mode +Refer to [this guide](https://docs.codeberg.org/security/ssh-key/) on how to set up SSH key authentication + +#### HTTPS mode +* To clone the repositories in HTTPS mode, run the script with any data at the end i.e. `./export-pack.sh 1` +* Running `git config --global credential.helper store` will save your credentials to your global git config directory * **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 de30a7c..9a96aac 100755 --- a/export-pack.sh +++ b/export-pack.sh @@ -9,11 +9,19 @@ 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 $basedir/deps/mc_rebalance || (cd $basedir/deps/mc_rebalance; git pull) || exit 1 +# 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 (cd "$basedir"/deps/mc_rebalance/ && ./gradlew build) diff --git a/overrides/global_packs/required_data/mc_rebalance_datapack b/overrides/global_packs/required_data/mc_rebalance_datapack deleted file mode 160000 index 931fef2..0000000 --- a/overrides/global_packs/required_data/mc_rebalance_datapack +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 931fef22686591dcc619e1d800b02cd63c1be352