Skip to content

Commit b846b0f

Browse files
authored
Support Modrinth Plugins for Velocity and BungeeCord, make $PLUGINS logic use mcopy (#132)
1 parent c77f8df commit b846b0f

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ RUN easy-add --var os=${TARGETOS} --var arch=${TARGETARCH}${TARGETVARIANT} \
4141

4242
COPY --chmod=444 templates/ /templates/
4343

44-
ARG MC_HELPER_VERSION=1.32.4
44+
ARG MC_HELPER_VERSION=1.33.3
4545
ARG MC_HELPER_BASE_URL=https://github.com/itzg/mc-image-helper/releases/download/${MC_HELPER_VERSION}
4646
# used for cache busting local copy of mc-image-helper
4747
ARG MC_HELPER_REV=1

scripts/run-bungeecord.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
: "${REPLACE_ENV_VARIABLE_PREFIX:=${ENV_VARIABLE_PREFIX:-CFG_}}"
1919
: "${REPLACE_ENV_VARIABLES_EXCLUDES:=}"
2020
: "${REPLACE_ENV_VARIABLES_EXCLUDE_PATHS:=}"
21+
: "${MODRINTH_PROJECTS:=}"
22+
: "${MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES:=true}"
23+
: "${MODRINTH_ALLOWED_VERSION_TYPE:=release}"
2124

2225
BUNGEE_HOME=/server
2326
RCON_JAR_URL=https://github.com/orblazer/bungee-rcon/releases/download/v${RCON_JAR_VERSION}/bungee-rcon-${RCON_JAR_VERSION}.jar
@@ -358,10 +361,11 @@ fi
358361
# If supplied with a URL for a plugin download it.
359362
if [[ "$PLUGINS" ]]; then
360363
mkdir -p "$BUNGEE_HOME/plugins"
361-
if ! get --skip-existing -o "$BUNGEE_HOME/plugins" "$PLUGINS"; then
362-
echo "ERROR: failed to download plugin(s)"
363-
exit 1
364-
fi
364+
mc-image-helper mcopy \
365+
--glob=*.jar \
366+
--scope=var-list \
367+
--to="$BUNGEE_HOME/plugins" \
368+
"$PLUGINS"
365369
fi
366370

367371
if [[ ${SPIGET_PLUGINS} ]]; then
@@ -377,6 +381,16 @@ if [[ ${SPIGET_PLUGINS} ]]; then
377381
done
378382
fi
379383

384+
if [[ $MODRINTH_PROJECTS ]] then
385+
mc-image-helper modrinth \
386+
--output-directory=/data \
387+
--projects="${MODRINTH_PROJECTS}" \
388+
--game-version="${VERSION}" \
389+
--loader="${family}" \
390+
--download-optional-dependencies="${MODRINTH_DOWNLOAD_OPTIONAL_DEPENDENCIES}" \
391+
--allowed-version-type="${MODRINTH_ALLOWED_VERSION_TYPE}"
392+
fi
393+
380394
# Download rcon plugin
381395
if [[ "${family}" == "velocity" ]] || isTrue "${APPLY_VELOCITY_RCON:-false}"; then # Download UnioDex/VelocityRcon plugin
382396
if isTrue "${ENABLE_RCON}"; then

0 commit comments

Comments
 (0)