refactor: modular init, add bedrock loader, dynamic java/healthcheck
Build dev image / build (push) Failing after 18m12s

- Split monolithic init into modular lib files under scripts/lib/
  (common.sh, java.sh, server.sh, loaders/{vanilla,paper,fabric,forge,neoforge}.sh)
- Add bedrock loader: downloads from Minecraft Services API,
  runs native binary with LD_LIBRARY_PATH, skips Java setup
- Add auto-detection for JAVA_VERSION from Mojang version manifest
  (MC 1.20.5+ -> temurin@21, 1.17-1.20.4 -> temurin@17,
   1.17 -> temurin@16, pre-1.17 -> temurin@8)
- Fix NEW_FORGE unbound variable when non-Forge loaders run
- Fix Fabric loader jq filter (-s slurp removed, null string check fixed)
- Fix Forge test detection (recursive find for forge-*-server.jar)
- Dynamic healthcheck: nc -z TCP 25565 for Java, nc -zu UDP 19132 for bedrock
- Add .gitea/workflows/build-dev.yml for dev branch CI builds
- Base image: debian:bookworm-slim (from ubuntu:noble)
- Add unzip, netcat-openbsd to Docker image
- Switch to shebangs, set -euo pipefail throughout
This commit is contained in:
2026-06-17 18:41:26 -04:00
parent 2d46f91c60
commit 6e13a0aa15
15 changed files with 726 additions and 328 deletions
+23
View File
@@ -0,0 +1,23 @@
getPaper() {
SERVER_TYPE="Paper Minecraft"
if [[ ! -f server.jar ]]; then
if [[ -n "${PAPER_BUILD}" ]]; then
LATEST_BUILD="${PAPER_BUILD}"
else
LATEST_BUILD=$(curl -s https://api.papermc.io/v2/projects/${MC_LOADER}/versions/${MC_VERSION}/builds |
jq -r '[.builds[] | select(.channel | ascii_upcase == "STABLE")] | .[-1].build')
fi
if [ "$LATEST_BUILD" != "null" ]; then
JAR_NAME=${MC_LOADER}-${MC_VERSION}-${LATEST_BUILD}.jar
PAPERMC_URL="https://api.papermc.io/v2/projects/${MC_LOADER}/versions/${MC_VERSION}/builds/${LATEST_BUILD}/downloads/${JAR_NAME}"
curl -o server.jar "$PAPERMC_URL"
echo "Download completed"
echo "Minecraft Version: ${MC_VERSION}"
echo "Paper Version: ${LATEST_BUILD}"
else
echo "No stable build for version $MC_VERSION found :("
fi
fi
}