Initialize Infstar Paper-based server core

This commit is contained in:
Coldsmiles
2026-09-13 18:08:00 +08:00
commit 5c27681d1d
22 changed files with 1502 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ $# -lt 1 || $# -gt 2 ]]; then
echo "用法:$0 <服务端 JAR 路径> [端口]" >&2
exit 2
fi
project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
run_directory="$project_root/run"
jar_path="$(realpath "$1")"
port="${2:-25565}"
mkdir -p "$run_directory"
cp -f "$jar_path" "$run_directory/infstar.jar"
cat > "$run_directory/server.properties" <<EOF
# Infstar 本地测试服务器配置
server-port=$port
motd=Infstar Local Test Server
online-mode=false
enable-command-block=true
spawn-protection=0
view-distance=8
simulation-distance=6
enable-rcon=false
EOF
printf '%s\n' 'eula=true' > "$run_directory/eula.txt"
echo "测试服务器已准备完成:$run_directory"