mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-02-22 09:06:23 +00:00
When using a custom server, allow specifying MODRINTH_LOADER with MODRINTH_PROJECTS (#3527)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}" \
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user