Skip to content

Commit 914a833

Browse files
authored
Introduce USE_MINECRAFT_SERVICES to choosing version lookup approach (#641)
1 parent f6dcda1 commit 914a833

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

bedrock-entry.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ set -eo pipefail
44

55
: "${DOWNLOAD_DIR:=${PWD}/.downloads}"
66
: "${PREVIEW:=false}"
7-
: "${PROCESSED_DOWNLOAD_LINKS_URL:=https://raw.githubusercontent.com/kittizz/bedrock-server-downloads/refs/heads/main/bedrock-server-downloads.json}"
7+
: "${USE_MINECRAFT_SERVICES:=true}"
88
: "${DOWNLOAD_LINKS_URL:=https://net.web.minecraft-services.net/api/v1.0/download/links}"
99
: "${DOWNLOAD_SECONDARY_LINKS_URL:=https://net.web.minecraft-services.net/api/v1.0/download/links}"
10+
: "${PROCESSED_DOWNLOAD_LINKS_URL:=https://raw.githubusercontent.com/kittizz/bedrock-server-downloads/refs/heads/main/bedrock-server-downloads.json}"
1011
: "${RESOLVE_XUID_API_URL:=https://mcprofile.io/api/v1/bedrock/gamertag}"
1112
: "${USE_BOX64:=true}"
1213
: "${DEBUG_CURL:=false}"
@@ -82,6 +83,15 @@ function versionFromExisting() {
8283
function lookupDownloadUrl() {
8384
platform=${1:?Missing required platform indicator}
8485

86+
if isTrue "$USE_MINECRAFT_SERVICES"; then
87+
if downloadUrl=$(lookupDownloadUrlFromMinecraftServices "$platform"); then
88+
echo "$downloadUrl"
89+
return 0
90+
else
91+
logWarn "Failed to lookup download URL from Minecraft Services, falling back to processed links"
92+
fi
93+
fi
94+
8595
# Map entry script platform arguments to the tracker's top-level keys
8696
if [[ "$platform" == "serverBedrockPreviewLinux" ]]; then
8797
local type="preview"

0 commit comments

Comments
 (0)