From 1b8b694036a64909bb356467a8a628769c58bd9d Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 7 Oct 2024 08:44:42 -0500 Subject: [PATCH] modrinth: support datapack retrieval (#3096) --- Dockerfile | 2 +- docs/mods-and-plugins/modrinth.md | 20 +++++++++++--------- scripts/start-setupModpack | 5 ++++- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5809ed1c..0861bd48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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}} \ --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} # used for cache busting local copy of mc-image-helper ARG MC_HELPER_REV=1 diff --git a/docs/mods-and-plugins/modrinth.md b/docs/mods-and-plugins/modrinth.md index 3a555dd0..64d47e2c 100644 --- a/docs/mods-and-plugins/modrinth.md +++ b/docs/mods-and-plugins/modrinth.md @@ -9,16 +9,18 @@ | +-- 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`. - -!!! example + 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`. + + 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 | - |---------------------------------|-----------------------| - | Select latest version | `fabric-api` | - | Select specific version | `fabric-api:PbVeub96` | - | Select latest beta version | `fabric-api:beta` | - | Latest version using project ID | `P7dR8mSH` | + | Description | Example projects entry | + |---------------------------------|----------------------------| + | Select latest version | `fabric-api` | + | Select specific version | `fabric-api:PbVeub96` | + | Select latest beta version | `fabric-api:beta` | + | Latest version using project ID | `P7dR8mSH` | + | Latest version of datapack | `datapack:terralith` | + | Specific version of datapack | `datapack:terralith:2.5.5` | ## Extra options diff --git a/scripts/start-setupModpack b/scripts/start-setupModpack index 4b05bb08..4bd80234 100755 --- a/scripts/start-setupModpack +++ b/scripts/start-setupModpack @@ -244,14 +244,17 @@ function handleModrinthProjects() { log " Use MODRINTH_DOWNLOAD_DEPENDENCIES=optional instead" fi - if [[ $MODRINTH_PROJECTS ]] && isFamily HYBRID FORGE FABRIC SPIGOT; then + if [[ $MODRINTH_PROJECTS ]]; then if isFamily HYBRID; then loader=forge + elif isFamily VANILLA; then + loader=datapack else loader="${TYPE,,}" fi mc-image-helper modrinth \ --output-directory=/data \ + --world-directory="${LEVEL:-world}" \ --projects="${MODRINTH_PROJECTS}" \ --game-version="${VERSION}" \ --loader="$loader" \