From 6bb2c3a8c428f59dae174bfa8bec5fe30ca46b18 Mon Sep 17 00:00:00 2001 From: Azuna Date: Sun, 26 Jan 2025 21:50:59 -0500 Subject: [PATCH] Feat: Disabling Mods in Generic Packs (#3281) --- docs/mods-and-plugins/index.md | 14 ++++++++++++++ scripts/start-setupModpack | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/docs/mods-and-plugins/index.md b/docs/mods-and-plugins/index.md index 058778fa..50d0f3cc 100644 --- a/docs/mods-and-plugins/index.md +++ b/docs/mods-and-plugins/index.md @@ -78,6 +78,20 @@ If applying large generic packs, the update can be time-consuming. To skip the u The most time-consuming portion of the generic pack update is generating and comparing the SHA1 checksum. To skip the checksum generation, set `SKIP_GENERIC_PACK_CHECKSUM` to "true". +To disable specific mods, which can be useful for conflicts between multiple generic packs, you can use the `GENERIC_PACKS_DISABLE_MODS` variable to specify mods to disable. + +Disabling mods with docker run: +```shell +docker run -d -e GENERIC_PACKS_DISABLE_MODS="mod1.jar mod2.jar" ... +``` + +Disabling mods within docker compose files: +```yaml + GENERIC_PACKS_DISABLE_MODS: | + mod1.jar + mod2.jar +``` + ## Mods/plugins list You may also download or copy over individual mods/plugins using the `MODS` or `PLUGINS` environment variables. Both are a comma or newline delimited list of diff --git a/scripts/start-setupModpack b/scripts/start-setupModpack index 89b276e0..7109330b 100755 --- a/scripts/start-setupModpack +++ b/scripts/start-setupModpack @@ -155,6 +155,7 @@ function handleGenericPacks() { : "${GENERIC_PACKS:=${GENERIC_PACK}}" : "${GENERIC_PACKS_PREFIX:=}" : "${GENERIC_PACKS_SUFFIX:=}" + : "${GENERIC_PACKS_DISABLE_MODS:=}" if [[ "${GENERIC_PACKS}" ]]; then IFS=',' read -ra packs <<< "${GENERIC_PACKS}" @@ -192,6 +193,12 @@ function handleGenericPacks() { extract "${pack}" "${base_dir}" done + # Disable mods + for mod in ${GENERIC_PACKS_DISABLE_MODS}; do + log Disabling $mod + find "${base_dir}" -name "$mod" -exec mv {} {}.disabled -v \; + done + # Remove any eula file since container manages it rm -f "${base_dir}/eula.txt"