Support Purpur and Pufferfish config repos & optimize server.properties handling (#3914)

This commit is contained in:
Tomás Alegre Sepúlveda
2026-02-09 18:03:15 -03:00
committed by GitHub
parent fbbe29507e
commit 6e05807865
7 changed files with 180 additions and 62 deletions
+5
View File
@@ -41,6 +41,11 @@ if [[ ! -f "$SERVER" ]] || isTrue "${FORCE_REDOWNLOAD:-false}"; then
exit 3
fi
fi
if [[ "${PUFFERFISH_CONFIG_REPO}" ]]; then
defaultTopLevelConfigs=(bukkit.yml spigot.yml pufferfish.yml)
DOWNLOAD_DEFAULTS=$(buildDownloadList "$PUFFERFISH_CONFIG_REPO" "$VERSION" "${defaultTopLevelConfigs[@]}")
export DOWNLOAD_DEFAULTS
fi
# Normalize on Spigot for later operations
export FAMILY=SPIGOT
+7
View File
@@ -4,6 +4,7 @@ IFS=$'\n\t'
: "${PURPUR_BUILD:=LATEST}"
: "${PURPUR_DOWNLOAD_URL:=}"
: "${PURPUR_CONFIG_REPO:=}"
# shellcheck source=start-utils
. "$(dirname "$0")/start-utils"
@@ -36,6 +37,12 @@ fi
applyResultsFile ${resultsFile}
if [[ "${PURPUR_CONFIG_REPO}" ]]; then
defaultTopLevelConfigs=(bukkit.yml spigot.yml purpur.yml)
DOWNLOAD_DEFAULTS=$(buildDownloadList "$PURPUR_CONFIG_REPO" "$VERSION" "${defaultTopLevelConfigs[@]}")
export DOWNLOAD_DEFAULTS
fi
# Normalize on Spigot for later operations
export FAMILY=SPIGOT
+16
View File
@@ -134,6 +134,22 @@ if [[ ${TYPE} == "CURSEFORGE" ]]; then
fi
if ! isTrue "${SKIP_SERVER_PROPERTIES}"; then
if [ ! -e "$SERVER_PROPERTIES" ] && [[ "${SERVER_PROPERTIES_REPO_URL:-}" ]]; then
# Helper to support base URLs (like the config repos)
# If the URL doesn't end in .properties, assume it is a base and append version/file
if [[ "${SERVER_PROPERTIES_REPO_URL}" != *".properties" ]]; then
SERVER_PROPERTIES_REPO_URL=$(buildDownloadList "$SERVER_PROPERTIES_REPO_URL" "$VERSION" server.properties)
fi
if ! mc-image-helper mcopy \
--to "$(dirname "$SERVER_PROPERTIES")" \
--skip-existing \
--ignore-missing-sources \
"$SERVER_PROPERTIES_REPO_URL"; then
logWarning "Failed to download server.properties from ${SERVER_PROPERTIES_REPO_URL}"
fi
fi
if [ ! -e "$SERVER_PROPERTIES" ]; then
log "Creating server properties in ${SERVER_PROPERTIES}"