-
Notifications
You must be signed in to change notification settings - Fork 0
Server Batch File Designs
Version 1 – Fails
@echo off
:start
SETLOCAL
for %f in (forge*.jar) do (SET forge=%~nxf)
java -Xms4g -Xmx8g -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 -Dfml.queryResult=confirm -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar forge nogui
ENDLOCAL
choice /c:RX /n /m "You have 5 seconds to restart the server – Press R to load now, or X to cancel. " /t:5 /d:x
IF errorlevel==1 goto start
echo Startup canceled.
pause
Version 2 – Infinite Loop Style
@echo off
:start
SETLOCAL
for %f in (forge*.jar) do (SET forge=%~nxf)
java -Xms4g -Xmx8g -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 -Dfml.queryResult=confirm -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar forge nogui
ENDLOCAL
GOTO start
:END