OrbitMC commited on
Commit
fc952fc
·
verified ·
1 Parent(s): 119ad15

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +20 -50
start.sh CHANGED
@@ -3,62 +3,32 @@ set -e
3
 
4
  echo "==== Server Initialization ===="
5
 
6
- # --- Server Configuration ---
7
- echo ">> Setting up server environment..."
8
-
9
- if [ -f "server.properties" ]; then
10
- sed -i "s/^server-port=.*/server-port=7860/" server.properties
11
- sed -i "s/^query.port=.*/query.port=7860/" server.properties
12
- echo "✅ Port configured: 7860"
13
- else
14
- echo "⚠️ Using default configuration"
15
- fi
16
-
17
  # --- Data Setup ---
18
  echo ">> Loading world data..."
19
  if command -v python3 >/dev/null 2>&1 && [ -f "download_world.py" ]; then
20
  python3 download_world.py || echo "⚠️ Using default world"
21
- else
22
- echo "ℹ️ No custom data found"
23
  fi
24
 
25
- chmod -R 777 /app/world* 2>/dev/null || true
26
- chmod -R 777 /app/plugins 2>/dev/null || true
 
 
 
 
 
 
 
 
 
27
 
28
- echo "Available data folders:"
29
- ls -la /app/ | grep world || echo "No custom data - generating new"
30
 
31
- # --- Start Main Service ---
32
- echo ">> Starting main service on port 7860..."
33
- echo ">> Java: $(java -version 2>&1 | head -n 1)"
34
- echo ">> Memory: 8GB allocated"
35
- echo ">> CPU: Optimized for 2 cores with fast world generation"
 
36
 
37
- exec java -server -Xmx8G -Xms8G \
38
- -XX:+UseG1GC \
39
- -XX:+ParallelRefProcEnabled \
40
- -XX:ParallelGCThreads=2 \
41
- -XX:ConcGCThreads=1 \
42
- -XX:MaxGCPauseMillis=50 \
43
- -XX:+UnlockExperimentalVMOptions \
44
- -XX:+DisableExplicitGC \
45
- -XX:+AlwaysPreTouch \
46
- -XX:G1NewSizePercent=30 \
47
- -XX:G1MaxNewSizePercent=50 \
48
- -XX:G1HeapRegionSize=16M \
49
- -XX:G1ReservePercent=15 \
50
- -XX:G1HeapWastePercent=5 \
51
- -XX:G1MixedGCCountTarget=3 \
52
- -XX:InitiatingHeapOccupancyPercent=10 \
53
- -XX:G1MixedGCLiveThresholdPercent=90 \
54
- -XX:G1RSetUpdatingPauseTimePercent=5 \
55
- -XX:SurvivorRatio=32 \
56
- -XX:+PerfDisableSharedMem \
57
- -XX:MaxTenuringThreshold=1 \
58
- -XX:G1SATBBufferEnqueueingThresholdPercent=30 \
59
- -XX:G1ConcMarkStepDurationMillis=5 \
60
- -XX:G1ConcRSHotCardLimit=16 \
61
- -XX:+UseStringDeduplication \
62
- -Dfile.encoding=UTF-8 \
63
- -Dcom.mojang.eula.agree=true \
64
- -jar purpur.jar --nogui
 
3
 
4
  echo "==== Server Initialization ===="
5
 
 
 
 
 
 
 
 
 
 
 
 
6
  # --- Data Setup ---
7
  echo ">> Loading world data..."
8
  if command -v python3 >/dev/null 2>&1 && [ -f "download_world.py" ]; then
9
  python3 download_world.py || echo "⚠️ Using default world"
 
 
10
  fi
11
 
12
+ # --- Server Configuration ---
13
+ echo ">> Setting up server environment..."
14
+ echo "eula=true" > eula.txt
15
+
16
+ if [ ! -f "server.properties" ]; then
17
+ echo "Generating default server.properties..."
18
+ echo "server-port=25565" > server.properties
19
+ else
20
+ sed -i "s/^server-port=.*/server-port=25565/" server.properties
21
+ sed -i "s/^query.port=.*/query.port=25565/" server.properties
22
+ fi
23
 
24
+ chmod -R 777 /app 2>/dev/null || true
 
25
 
26
+ # --- Start the Web UI & Panel ---
27
+ echo "=========================================================="
28
+ echo ">> Starting Professional Panel on Port 7860..."
29
+ echo ">> Minecraft output will be suppressed here to stop spam."
30
+ echo ">> Open the Hugging Face Space URL in your browser to access the Console and File Manager!"
31
+ echo "=========================================================="
32
 
33
+ # Run the python panel script
34
+ exec python3 panel.py