modrinth: support datapack retrieval (#3096)

This commit is contained in:
Geoff Bourne authored and GitHub committed 2024-10-07 08:44:42 -05:00
1 parent 7974baca7e
commit 1b8b694036
3 files changed
+16 -11

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
--var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \ --var version=${MC_SERVER_RUNNER_VERSION} --var app=mc-server-runner --file {{.app}} \
--from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz --from ${GITHUB_BASEURL}/itzg/{{.app}}/releases/download/{{.version}}/{{.app}}_{{.version}}_{{.os}}_{{.arch}}.tar.gz
ARG MC_HELPER_VERSION=1.39.12 ARG MC_HELPER_VERSION=1.39.13
ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION} ARG MC_HELPER_BASE_URL=${GITHUB_BASEURL}/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
# used for cache busting local copy of mc-image-helper # used for cache busting local copy of mc-image-helper
ARG MC_HELPER_REV=1 ARG MC_HELPER_REV=1
+11 -9
View File
@@ -9,16 +9,18 @@
| |
+-- project slug +-- project slug
``` ```
Also, a specific version/type can be declared using colon symbol and version id/type after the project slug. The version id can be found in the 'Metadata' section. Valid version types are `release`, `beta`, `alpha`. Also, a specific version (or release type) can be declared adding a colon and then the version id, version name, or release type after the project slug. The version ID can be found in the 'Metadata' section. Valid release types are `release`, `beta`, `alpha`.
!!! example To select a datapack from a Modrinth project, prefix the entry with "datapack:". When running a vanilla server, this is optional since only datapacks will be available for vanilla servers to select.
| Description | Example | | Description | Example projects entry |
|---------------------------------|-----------------------| |---------------------------------|----------------------------|
| Select latest version | `fabric-api` | | Select latest version | `fabric-api` |
| Select specific version | `fabric-api:PbVeub96` | | Select specific version | `fabric-api:PbVeub96` |
| Select latest beta version | `fabric-api:beta` | | Select latest beta version | `fabric-api:beta` |
| Latest version using project ID | `P7dR8mSH` | | Latest version using project ID | `P7dR8mSH` |
| Latest version of datapack | `datapack:terralith` |
| Specific version of datapack | `datapack:terralith:2.5.5` |
## Extra options ## Extra options
+4 -1
View File
@@ -244,14 +244,17 @@ function handleModrinthProjects() {
log " Use MODRINTH_DOWNLOAD_DEPENDENCIES=optional instead" log " Use MODRINTH_DOWNLOAD_DEPENDENCIES=optional instead"
fi fi
if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then if [[ $MODRINTH_PROJECTS ]]; then
if isFamily HYBRID; then if isFamily HYBRID; then
loader=forge loader=forge
elif isFamily VANILLA; then
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}" \
--projects="${MODRINTH_PROJECTS}" \ --projects="${MODRINTH_PROJECTS}" \
--game-version="${VERSION}" \ --game-version="${VERSION}" \
--loader="$loader" \ --loader="$loader" \