services/minecraft.sh: generate PREGEN_INSTRUCTIONS.md when chunky is selected

Writes radius, border status, and commands for monitoring, re-running,
and cancelling chunk pre-generation. Listed in the setup summary.

https://claude.ai/code/session_017WJtGcE5jjerAQCUBWUE3H
This commit is contained in:
Claude
2026-06-04 13:19:07 +00:00
parent f86e35aaf1
commit e9830fef31
+34
View File
@@ -1286,6 +1286,38 @@ PREGENEOF
chmod +x "$MC_DIR/data/pregen-startup.sh"
chown 1000:1000 "$MC_DIR/data/pregen-startup.sh" 2>/dev/null || true
log_success "pregen-startup.sh written to ${MC_NAME}/data/"
local _BORDER_STATUS
[ "$USE_BORDER" = true ] && _BORDER_STATUS="enabled" || _BORDER_STATUS="disabled"
cat > "$MC_DIR/PREGEN_INSTRUCTIONS.md" << PREGENINFOEOF
# Chunk Pre-Generation
Pre-gen radius: ${PREGEN_RADIUS} blocks
World border: ${BORDER_SIZE} blocks (${_BORDER_STATUS})
Pre-generation ran automatically when the server started. It uses Chunky
to generate all chunks within the radius before players explore.
## Monitor progress
\`\`\`bash
docker exec ${MC_NAME} mc-send-to-console 'chunky progress'
\`\`\`
## Re-run manually (if server was started without pre-gen)
\`\`\`bash
docker exec -e PREGEN=1 -u 1000 ${MC_NAME} bash /data/pregen-startup.sh
\`\`\`
## Cancel pre-gen
\`\`\`bash
docker exec ${MC_NAME} mc-send-to-console 'chunky cancel'
\`\`\`
PREGENINFOEOF
chown "$ACTUAL_USER:$ACTUAL_USER" "$MC_DIR/PREGEN_INSTRUCTIONS.md" 2>/dev/null || true
log_success "PREGEN_INSTRUCTIONS.md written"
fi
# ── Standalone docker-compose.yml (per-service folder) ──────────────────────
@@ -2272,6 +2304,8 @@ NETEOF
echo " docker-compose.yml Standalone compose (build itzg image)"
echo " CLIENT_MODS.md What players install on their client"
echo " MINECRAFT_NETWORKING.md DNS and port forward instructions"
[[ " ${SELECTED_MODS[*]} " =~ " chunky " ]] && \
echo " PREGEN_INSTRUCTIONS.md How to monitor and re-run pre-gen"
[ "$USE_PLAYIT" = true ] && echo " .env.playit Add playit.gg secret here"
echo ""
echo "── BACKUPS ───────────────────────────────────────────"