diff --git a/docs/mods-and-plugins/modrinth.md b/docs/mods-and-plugins/modrinth.md index 648f3e1e..d34acfbf 100644 --- a/docs/mods-and-plugins/modrinth.md +++ b/docs/mods-and-plugins/modrinth.md @@ -50,3 +50,5 @@ `MODRINTH_ALLOWED_VERSION_TYPE` : The version type is used to determine the newest version to use from each project. The allowed values are `release` (default), `beta`, `alpha`. Setting to `beta` will pick up both release and beta versions. Setting to `alpha` will pick up release, beta, and alpha versions. +`MODRINTH_LOADER` +: When using a custom server, set this to specify which loader type will be requested during lookups diff --git a/scripts/start-setupModpack b/scripts/start-setupModpack index a9a982c3..fc29330b 100755 --- a/scripts/start-setupModpack +++ b/scripts/start-setupModpack @@ -12,6 +12,7 @@ set -e -o pipefail : "${REMOVE_OLD_MODS_DEPTH:=1} " : "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}" : "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key +: "${MODRINTH_LOADER:=}" sum_file=/data/.generic_pack.sum if [[ -n ${CF_API_KEY_FILE} ]]; then @@ -263,13 +264,21 @@ function handleModrinthProjects() { fi if [[ $MODRINTH_PROJECTS ]]; then - if isFamily HYBRID; then + + if isType CUSTOM; then + if ! [[ $MODRINTH_LOADER ]]; then + logError "MODRINTH_LOADER must be set when using TYPE=CUSTOM and MODRINTH_PROJECTS" + exit 1 + fi + loader="${MODRINTH_LOADER,,}" + elif isFamily HYBRID; then loader=${HYBRIDTYPE} elif isFamily VANILLA; then loader=datapack else loader="${TYPE,,}" fi + mc-image-helper modrinth \ --output-directory=/data \ --world-directory="${LEVEL:-world}" \ diff --git a/scripts/start-utils b/scripts/start-utils index a3bc0bbc..00d13156 100755 --- a/scripts/start-utils +++ b/scripts/start-utils @@ -411,7 +411,7 @@ function isFamily() { function isType() { for t in "${@}"; do # shellcheck disable=SC2153 - if [[ $TYPE == "$t" ]]; then + if [[ ${TYPE^^} == "${t^^}" ]]; then return 0 fi done