tetratheta

[Windows] [POWERSHELL] Minecraft startup script

Aug 15th, 2021 (edited)
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Set title
  2. $Host.UI.RawUI.WindowTitle = "Paper Test Server"
  3.  
  4. # Variables for moving files
  5. $EXMCore = $false
  6. $EXMCorePath = "E:\DOCUMENT\REPOSITORY\EXMCore\build\libs\"
  7. $MoarHarder = $false
  8. $MoarHarderPath = "E:\DOCUMENT\REPOSITORY\MoarHarder\build\libs\"
  9. $AutoWhitelist = $false
  10. $AutoWhitelistPath = "E:\DOCUMENT\REPOSITORY\AutoWhitelist\build\libs"
  11.  
  12.  
  13. # Move plugin files
  14. If ( $EXMCore -and (Test-Path -Path $EXMCorePath -Include "EXMCore-*.jar" -PathType Leaf) )
  15. {
  16.   Write-Host "Moving EXMCore..."
  17. }
  18. If ( $MoarHarder -and (Test-Path -Path $MoarHarderPath -Include "MoarHarder-*.jar" -PathType Leaf) )
  19. {
  20.   Write-Host "Moving MoarHarder..."
  21. }
  22. if ( $AutoWhitelist -and (Test-Path -Path $AutoWhitelistPath -Include "AutoWhitelist-*jar" -PathType Leaf) )
  23. {
  24.   Write-Host "Moving AutoWhitelist..."
  25. }
  26.  
  27. # Find Paper JAR file
  28. $JAR = Get-ChildItem -Path . -Filter "paper-*.jar"
  29.  
  30. # Prepare argument line
  31. $Argument = " -Xms2G -Xmx2G -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 -Dfile.encoding=UTF8"
  32. $Argument = $Argument + " -jar " + $JAR + " nogui"
  33.  
  34. # Run test server
  35. Start-Process -NoNewWindow java $Argument
  36.  
Add Comment
Please, Sign In to add comment