text
stringlengths
0
834k
ECHO.
ECHO. **** WARNING ****
ECHO SPONGE has been enabled in settings.cfg
ECHO Using Sponge with this modpack is experimental and can cause unexpected problems
ECHO **** USE SPONGE AT YOUR OWN RISK ****
ECHO SPONGE has been enabled in settings.cfg -- this is experimental and can cause unexpected problems USE AT YOUR OWN RISK 1>> ""%~dp0serverstart.log"" 2>&1
ECHO.
REM create ""/mods/"" folder if it doesn't exist
IF NOT EXIST ""%~dp0mods"" (
ECHO Mods folder not found, creating it
ECHO INFO: Mods folder not found, creating it 1>> ""%~dp0serverstart.log"" 2>&1
MKDIR ""%~dp0mods"" 1>> ""%~dp0serverstart.log"" 2>&1
)
REM Check for spongeforge jar in /mods/
IF NOT EXIST ""%~dp0mods/*spongeforge*%MC_SERVER_MCVER%*%MC_SERVER_FORGESHORT%*.jar"" (
ECHO SpongeForge JAR for Forge %MC_SERVER_FORGESHORT% not found in ""mods"" folder...
ECHO INFO: SpongeForge JAR not found in ""mods"" folder 1>> ""%~dp0serverstart.log"" 2>&1
GOTO DOWNLOADSPONGE
)
REM Check for spongeforge bootstrapper
IF NOT EXIST ""%~dp0*sponge*bootstrap*.jar"" (
ECHO SpongeBootstrap loader not found...
ECHO INFO: SpongeForge Bootstrap loader not found 1>> ""%~dp0serverstart.log"" 2>&1
GOTO DOWNLOADSPONGE
)
)
REM set absolute paths for binary JARs
(FOR /f ""usebackq tokens=* delims=*"" %%x in (`dir ^""*forge*%MC_SERVER_FORGEVER%*universal*.jar^"" /B /O:-D`) DO SET ""MC_SERVER_FORGE_JAR=%%x"" & GOTO CHECKFILES1) 1>> ""%~dp0serverstart.log"" 2>&1
:CHECKFILES1
(FOR /f ""usebackq tokens=* delims=*"" %%x in (`dir ^""*sponge*bootstrap*.jar^"" /B /O:-D`) DO SET ""MC_SERVER_SPONGE_BOOT=%%x"" & GOTO CHECKFILES2) 1>> ""%~dp0serverstart.log"" 2>&1
:CHECKFILES2
REM Delete duplicate binary JARs
ECHO DEBUG: MC_SERVER_SPONGE_BOOT=%MC_SERVER_SPONGE_BOOT% 1>> ""%~dp0serverstart.log"" 2>&1
ECHO DEBUG: MC_SERVER_FORGE_JAR=%MC_SERVER_FORGE_JAR% 1>> ""%~dp0serverstart.log"" 2>&1
ATTRIB +R ""%MC_SERVER_SPONGE_BOOT%"" 1>> ""%~dp0serverstart.log"" 2>&1 || ECHO INFO: No Sponge Jar present to read-only 1>> ""%~dp0serverstart.log"" 2>&1
ATTRIB +R ""%MC_SERVER_FORGE_JAR%"" 1>> ""%~dp0serverstart.log"" 2>&1 || ECHO INFO: No Forge Jar present to read-only 1>> ""%~dp0serverstart.log"" 2>&1
DEL ""%~dp0*forge*universal*.jar"" /A:-R 1>> ""%~dp0serverstart.log"" 2>&1 || ECHO INFO: No Sponge Jars present to delete 1>> ""%~dp0serverstart.log"" 2>&1
DEL ""%~dp0*sponge*bootstrap*.jar"" /A:-R 1>> ""%~dp0serverstart.log"" 2>&1 || ECHO INFO: No Forge Jars present to delete 1>> ""%~dp0serverstart.log"" 2>&1
ATTRIB -R ""%MC_SERVER_SPONGE_BOOT%"" 1>> ""%~dp0serverstart.log"" 2>&1 || ECHO INFO: No Sponge Jar present to UN-read-only 1>> ""%~dp0serverstart.log"" 2>&1
ATTRIB -R ""%MC_SERVER_FORGE_JAR%"" 1>> ""%~dp0serverstart.log"" 2>&1 || ECHO INFO: No Forge Jar present to UN-read-only 1>> ""%~dp0serverstart.log"" 2>&1
:STARTSERVER
CLS
TITLE %MC_SERVER_PACKNAME% Server Running
ECHO.
ECHO.
ECHO Starting %MC_SERVER_PACKNAME% Server...
ECHO INFO: Starting Server... 1>> ""%~dp0serverstart.log"" 2>&1
COLOR 07
REM Batch will wait here indefinetly while MC server is running
IF %MC_SERVER_SPONGE% EQU 1 (
ECHO DEBUG: Attempting to execute [ java %MC_SERVER_JVM_ARGS% -jar ""%~dp0%MC_SERVER_SPONGE_BOOT%"" nogui ]
ECHO DEBUG: Attempting to execute [ java %MC_SERVER_JVM_ARGS% -jar ""%~dp0%MC_SERVER_SPONGE_BOOT%"" nogui ] 1>> ""%~dp0serverstart.log"" 2>&1
COLOR
java %MC_SERVER_JVM_ARGS% -jar ""%~dp0%MC_SERVER_SPONGE_BOOT%"" nogui
) ELSE (
ECHO DEBUG: Disabling any spongeforge jar in \mods\ because USE_SPONGE is disabled in settings.cfg 1>> ""%~dp0serverstart.log"" 2>&1
(FOR /f ""tokens=* delims=*"" %%x in ('dir ""%~dp0mods\*spongeforge*.jar"" /B /O:-D') DO MOVE /Y ""%~dp0mods\%%x"" ""%%x.disabled"") 1>> ""%~dp0serverstart.log"" 2>&1
ECHO DEBUG: Attempting to execute [ java %MC_SERVER_JVM_ARGS% -jar ""%~dp0%MC_SERVER_FORGE_JAR%"" nogui ]
ECHO DEBUG: Attempting to execute [ java %MC_SERVER_JVM_ARGS% -jar ""%~dp0%MC_SERVER_FORGE_JAR%"" nogui ] 1>> ""%~dp0serverstart.log"" 2>&1
COLOR
java %MC_SERVER_JVM_ARGS% -jar ""%~dp0%MC_SERVER_FORGE_JAR%"" nogui
)
REM If server is exited or crashes, restart...
REM CLS
ECHO.
ECHO WARN: %MC_SERVER_PACKNAME% Server was stopped (possibly crashed)...
GOTO RESTARTER
:INSTALLSTART
COLOR 5F
TITLE INSTALLING Forge/Minecraft for %MC_SERVER_PACKNAME% server
ECHO Clearing old files before installing forge/minecraft...
ECHO INFO: Clearing and installing forge/minecraft... 1>> ""%~dp0serverstart.log"" 2>&1
REM Just in case there's anything pending or dupe-named before starting...
bitsadmin /reset 1>> ""%~dp0serverstart.log"" 2>&1
(FOR /f ""tokens=* delims=*"" %%x in ('dir ""%~dp0*forge*%MC_SERVER_MCVER%*%MC_SERVER_FORGEVER%*installer.jar"" /B /O:-D') DO SET ""MC_SERVER_TMP_FLAG=%%x"" & GOTO INSTALL1) 1>> ""%~dp0serverstart.log"" 2>&1
:INSTALL1
REM Delete old/duplicate installers
ECHO: DEBUG: MC_SERVER_TMP_FLAG=%MC_SERVER_TMP_FLAG% 1>> ""%~dp0serverstart.log"" 2>&1
ATTRIB +R ""%MC_SERVER_TMP_FLAG%"" 1>> ""%~dp0serverstart.log"" 2>&1 || ECHO INFO: No Forge Installer present to read-only 1>> ""%~dp0serverstart.log"" 2>&1
DEL ""%~dp0*forge*installer*.jar*"" /A:-R 1>> ""%~dp0serverstart.log"" 2>&1 || ECHO INFO: No Forge Installers present to delete 1>> ""%~dp0serverstart.log"" 2>&1
ATTRIB -R ""%MC_SERVER_TMP_FLAG%"" 1>> ""%~dp0serverstart.log"" 2>&1 || ECHO INFO: No Forge Installer present to UN-read-only 1>> ""%~dp0serverstart.log"" 2>&1
SET MC_SERVER_TMP_FLAG= 1>> ""%~dp0serverstart.log"" 2>&1
REM Check for existing/included forge-installer and run it instead of downloading
IF EXIST ""%~dp0forge-%MC_SERVER_MCVER%-%MC_SERVER_FORGEVER%-installer.jar"" (
ECHO.
ECHO.
ECHO Existing forge installer already found...
ECHO Default is to use this installer and not re-download
GOTO RUNINSTALLER