Skip to content

Commit 6bb2c3a

Browse files
authored
Feat: Disabling Mods in Generic Packs (#3281)
1 parent 0ff1e99 commit 6bb2c3a

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

docs/mods-and-plugins/index.md

+14
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,20 @@ If applying large generic packs, the update can be time-consuming. To skip the u
7878

7979
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".
8080

81+
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.
82+
83+
Disabling mods with docker run:
84+
```shell
85+
docker run -d -e GENERIC_PACKS_DISABLE_MODS="mod1.jar mod2.jar" ...
86+
```
87+
88+
Disabling mods within docker compose files:
89+
```yaml
90+
GENERIC_PACKS_DISABLE_MODS: |
91+
mod1.jar
92+
mod2.jar
93+
```
94+
8195
## Mods/plugins list
8296
8397
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

scripts/start-setupModpack

+7
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ function handleGenericPacks() {
155155
: "${GENERIC_PACKS:=${GENERIC_PACK}}"
156156
: "${GENERIC_PACKS_PREFIX:=}"
157157
: "${GENERIC_PACKS_SUFFIX:=}"
158+
: "${GENERIC_PACKS_DISABLE_MODS:=}"
158159

159160
if [[ "${GENERIC_PACKS}" ]]; then
160161
IFS=',' read -ra packs <<< "${GENERIC_PACKS}"
@@ -192,6 +193,12 @@ function handleGenericPacks() {
192193
extract "${pack}" "${base_dir}"
193194
done
194195

196+
# Disable mods
197+
for mod in ${GENERIC_PACKS_DISABLE_MODS}; do
198+
log Disabling $mod
199+
find "${base_dir}" -name "$mod" -exec mv {} {}.disabled -v \;
200+
done
201+
195202
# Remove any eula file since container manages it
196203
rm -f "${base_dir}/eula.txt"
197204

0 commit comments

Comments
 (0)