Skip to content

Commit

Permalink
modrinth: provide dependencies download options (#2375)
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg authored Sep 9, 2023
1 parent ec7bd14 commit d8ad2e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=1.9.0 --var app=mc-server-runner --file {{.app}} \
--from https://github.com/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz

ARG MC_HELPER_VERSION=1.35.1
ARG MC_HELPER_VERSION=1.35.2
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
# used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1
Expand Down
2 changes: 2 additions & 0 deletions docs/misc/contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ cd build/distributions
jwebserver -b 0.0.0.0 -p 8008
```

If `jwebserver` is not available, try `java -m jdk.httpserver`

```shell
--build-arg MC_HELPER_VERSION=1.8.1-SNAPSHOT \
--build-arg MC_HELPER_BASE_URL=http://host.docker.internal:8008
Expand Down
4 changes: 2 additions & 2 deletions docs/mods-and-plugins/modrinth.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

## Extra options

`MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES`
: Required dependencies of the project will _always_ be downloaded and optional dependencies can also be downloaded by setting this to `true`. The default is "true"
`MODRINTH_DOWNLOAD_DEPENDENCIES`
: Can be set to `none` (the default), `required`, or `optional` to download required and/or optional dependencies.

`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`.
Expand Down
8 changes: 6 additions & 2 deletions scripts/start-setupModpack
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,12 @@ function handleGenericPacks() {

function handleModrinthProjects() {
: "${MODRINTH_PROJECTS:=}"
: "${MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES:=true}"
: "${MODRINTH_ALLOWED_VERSION_TYPE:=release}"
: "${MODRINTH_DOWNLOAD_DEPENDENCIES:=none}"
if [[ -v MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES ]]; then
log "WARNING The variable MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES is removed."
log " Use MODRINTH_DOWNLOAD_DEPENDENCIES=optional instead"
fi

if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then
if isFamily HYBRID FORGE; then
Expand All @@ -246,7 +250,7 @@ function handleModrinthProjects() {
--projects="${MODRINTH_PROJECTS}" \
--game-version="${VERSION}" \
--loader="$loader" \
--download-optional-dependencies="$MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES" \
--download-dependencies="$MODRINTH_DOWNLOAD_DEPENDENCIES" \
--allowed-version-type="$MODRINTH_ALLOWED_VERSION_TYPE"
fi
}
Expand Down

0 comments on commit d8ad2e5

Please sign in to comment.