将 .sh 文件编译为 .bat 文件:服务器启动脚本
@echo off/nREM Start script generated by ServerPackCreator 4.2.1./nREM Depending on which modloader is set, different checks are run to ensure the server will start accordingly./nREM If the modloader checks and setup are passed, Minecraft and EULA checks are run./nREM If everything is in order, the server is started./n/nif /'%PROCESSOR_ARCHITECTURE%/'==/'AMD64/' (/n set /'JAVA_ARCH=64/'/n) else (/n set /'JAVA_ARCH=32/'/n)/n/nif /'%JAVA_HOME%/'==/'/' (/n if EXIST /'%ProgramFiles(x86)%/Java/jdk1.8.0_%JAVA_ARCH%/' (/n set /'JAVA_HOME=%ProgramFiles(x86)%/Java/jdk1.8.0_%JAVA_ARCH%/'/n ) else (/n set /'JAVA_HOME=%ProgramFiles%/Java/jdk1.8.0_%JAVA_ARCH%/'/n )/n)/n/nif /'%JAVA_HOME%/'==/'/' (/n echo Java JDK not found./n exit /b 1/n)/n/nset JAVA=/'%JAVA_HOME%/bin/java.exe/'/n/necho Start script generated by ServerPackCreator 4.2.1./necho To change the launch settings of this server, such as JVM args / flags, Minecraft version, modloader version etc., edit the variables.txt-file./n/nREM Acquire variables from variables.txt/ncall /'variables.txt/'/n/nREM Variables with do_not_manually_edit are set automatically during script execution,/nREM so manually editing them will have no effect, as they will be overridden./nset /'MINECRAFT_SERVER_JAR_LOCATION=do_not_manually_edit/'/nset /'LAUNCHER_JAR_LOCATION=do_not_manually_edit/'/nset /'SERVER_RUN_COMMAND=do_not_manually_edit/'/n/ncall :crash/ngoto :eof/n/n:crash/necho Exiting.../npause/nexit /b 1/n/nREM %1 = Filename to check for/nREM %2 = Filename to save download as/nREM %3 = URL to download %2 from/nREM true if the file was successfully downloaded, false if it already exists/n:downloadIfNotExist/nif not exist /'%~1/' (/n echo %~1 could not be found./n echo Downloading %~2/n echo from %~3/n curl -# -L -o /'.//%~2/' /'%~3/'/n if exist /'%~2/' (/n echo Download complete./n echo true/n )/n) else (/n echo %~1 present./n echo false/n)/ngoto :eof/n/n:runJavaCommand/n/'%JAVA%/' %1/ngoto :eof/n/n:checkJavaBitness/n/'%JAVA%/' -version 2>&1 | findstr /c:/'32-Bit/' && echo WARNING! 32-Bit Java detected! It is
原文地址: https://www.cveoy.top/t/topic/qmhG 著作权归作者所有。请勿转载和采集!