Advertisement
katubug

startserver.bat

Jul 27th, 2023
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. @echo off
  2. set FORGE_VERSION=43.2.11
  3.  
  4. :: README:
  5.  
  6. :: These files were authored by The All The Mods team - https://www.akliz.net/allthemods
  7. :: They have been edited for use by this modpack. Please support the original authors.
  8.  
  9. :: To use a specific Java runtime, use the following variable named CWITCH_JAVA by setting it
  10. :: to the full path of java.exe and deleting the :: in front of the word "set".
  11. :: If you don't know what this means, leave it alone.
  12. :: set CWITCH_JAVA = YourFullPathTo/Java.exe
  13.  
  14. :: To disable automatic restarts, delete the :: before the following line:
  15. :: set CWITCH_RESTART = false
  16.  
  17. :: To install the pack without starting the server, delete the :: before the following line:
  18. set CWITCH_INSTALL_ONLY = true
  19.  
  20. set INSTALLER="%~dp0forge-1.19.2-%FORGE_VERSION%-installer.jar"
  21. set FORGE_URL="http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.19.2-%FORGE_VERSION%/forge-1.19.2-%FORGE_VERSION%-installer.jar"
  22.  
  23. :JAVA
  24. if not defined CWITCH_JAVA (
  25. set CWITCH_JAVA=java
  26. )
  27.  
  28. "%CWITCH_JAVA%" -version 1>nul 2>nul || (
  29. echo Minecraft 1.19 requires Java 17 - Java not found
  30. pause
  31. exit /b 1
  32. )
  33.  
  34. :FORGE
  35. setlocal
  36. cd /D "%~dp0"
  37. if not exist "libraries" (
  38. echo Forge not installed, installing now.
  39. if not exist %INSTALLER% (
  40. echo No Forge installer found, downloading from %FORGE_URL%
  41. bitsadmin.exe /rawreturn /nowrap /transfer forgeinstaller /download /priority FOREGROUND %FORGE_URL% %INSTALLER%
  42. )
  43.  
  44. echo Running Forge installer.
  45. "%CWITCH_JAVA%" -jar %INSTALLER% -installServer
  46. )
  47.  
  48. if not exist "server.properties" (
  49. (
  50. echo allow-flight=true
  51. echo motd=\u00A7f\u263D\u263E\u00A72 Cottage Witch\u00A7f\u263D\u263E\u00A7r\n\u00A74Wh\u00A76at\u00A7e's\u00A72 bu\u00A79bb\u00A75lin'\u00A7r, \u00A77\u00A7oMoon Babes\u00A7r?
  52. echo max-tick-time=-1
  53. echo pvp=false
  54. )> "server.properties"
  55. )
  56.  
  57. if "%CWITCH_INSTALL_ONLY%" == "true" (
  58. echo INSTALL_ONLY: complete
  59. goto:EOF
  60. )
  61.  
  62. for /f tokens^=2-5^ delims^=.-_^" %%j in ('"%CWITCH_JAVA%" -fullversion 2^>^&1') do set "jver=%%j"
  63. if not %jver% geq 17 (
  64. echo Minecraft 1.19 requires Java 17 - found Java %jver%
  65. pause
  66. exit /b 1
  67. )
  68.  
  69. :START
  70. "%CWITCH_JAVA%" @libraries/net/minecraftforge/forge/1.19.2-%FORGE_VERSION%/win_args.txt nogui
  71.  
  72. if "%CWITCH_RESTART%" == "false" (
  73. goto:EOF
  74. )
  75.  
  76. echo Restarting automatically in 10 seconds (press Ctrl + C to cancel)
  77. timeout /t 10 /nobreak > NUL
  78. goto:START
  79.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement