-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
58 lines (47 loc) · 1.22 KB
/
start.bat
File metadata and controls
58 lines (47 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
title NHostAPI by Nikhil Karmakar
echo Minecraft Server of NHostAPI by Nikhil Karmakar
echo NHostAPI (v0.0.3 Pre-Alpha)
echo --------------------------
echo.
:: Check Python
python --version >nul 2>&1
if errorlevel 1 (
echo ERROR: Python is not installed or not in PATH.
echo.
echo Download Python from:
echo https://www.python.org/downloads/
echo IMPORTANT: Check "Add Python to PATH" during install.
echo or
echo winget install --id=Python.Python.3.13
echo.
pause
exit /b
)
echo Python found.
:: First-time dependency install
if not exist setup_done.txt (
echo.
echo First run detected.
echo Installing Python dependencies from requirement.txt...
echo.
python -m pip install --upgrade pip
python -m pip install -r requirement.txt
if errorlevel 1 (
echo.
echo ERROR: Failed to install dependencies.
pause
exit /b
)
:: Write fixed ISO-8601 timestamp (reliable)
powershell -NoProfile -Command ^
"Get-Date -Format 'yyyy-MM-ddTHH:mm:ss' | Out-File -Encoding ASCII setup_done.txt"
echo Dependencies installed.
)
echo.
echo Starting Minecraft server...
echo.
python run.py
echo.
echo Server process ended.
pause