This repository was archived by the owner on Aug 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
29 lines (22 loc) · 1.26 KB
/
run.sh
File metadata and controls
29 lines (22 loc) · 1.26 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
#!/bin/bash
MINECRAFT_VERSION=1.20.4
MEMORY=4G
PLUGINS=(
'https://github.com/monun/auto-reloader/releases/download/0.0.6/auto-reloader-0.0.6.jar'
)
set -x
mkdir -p .server
cd .server
if [[ ! -f paper.jar ]]; then
build_info=$(curl https://api.papermc.io/v2/projects/paper/versions/$MINECRAFT_VERSION/builds | jq '.builds[-1]')
build_id=$(echo $build_info | jq '.build')
build_filename=$(echo $build_info | jq -r '.downloads.application.name')
curl -o paper.jar https://api.papermc.io/v2/projects/paper/versions/$MINECRAFT_VERSION/builds/$build_id/downloads/$build_filename
mkdir -p plugins
cd plugins
for PLUGIN in ${PLUGINS[@]}; do
wget $PLUGIN
done
cd ..
fi
java -Xms$MEMORY -Xmx$MEMORY -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper.jar --nogui