mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-08-21 06:23:18 +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`
|
`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.
|
: 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_DEPTH:=1} "
|
||||||
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
|
: "${REMOVE_OLD_MODS_INCLUDE:=*.jar,*-version.json}"
|
||||||
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
|
: "${CF_API_KEY_FILE:=}" # Path to file containing CurseForge API key
|
||||||
|
: "${MODRINTH_LOADER:=}"
|
||||||
sum_file=/data/.generic_pack.sum
|
sum_file=/data/.generic_pack.sum
|
||||||
|
|
||||||
if [[ -n ${CF_API_KEY_FILE} ]]; then
|
if [[ -n ${CF_API_KEY_FILE} ]]; then
|
||||||
@@ -263,13 +264,21 @@ function handleModrinthProjects() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $MODRINTH_PROJECTS ]]; then
|
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}
|
loader=${HYBRIDTYPE}
|
||||||
elif isFamily VANILLA; then
|
elif isFamily VANILLA; then
|
||||||
loader=datapack
|
loader=datapack
|
||||||
else
|
else
|
||||||
loader="${TYPE,,}"
|
loader="${TYPE,,}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mc-image-helper modrinth \
|
mc-image-helper modrinth \
|
||||||
--output-directory=/data \
|
--output-directory=/data \
|
||||||
--world-directory="${LEVEL:-world}" \
|
--world-directory="${LEVEL:-world}" \
|
||||||
|
|||||||
+1
-1
@@ -411,7 +411,7 @@ function isFamily() {
|
|||||||
function isType() {
|
function isType() {
|
||||||
for t in "${@}"; do
|
for t in "${@}"; do
|
||||||
# shellcheck disable=SC2153
|
# shellcheck disable=SC2153
|
||||||
if [[ $TYPE == "$t" ]]; then
|
if [[ ${TYPE^^} == "${t^^}" ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user