modded7/pack-mode-switcher.bat
0xC4DE c50caee9dc
Pack Mode Switcher changes to address #241 (#292)
Difficulty cannot be inforced by the difficulty locker mod. Meaning it's not only not required by the server, but the difficulty needs to be manually set by server.properties.

I added a second server.properties.expert that just sets difficulty to 0 initially. Obviously a user can change this but they should just know that expert is supposed to be peaceful at that point. I then updated the script to switch between the two configs, if and only if they exist, so it should still work on ssp just the same.

This was made to address #241 Since it is impossible for a mod to enforce server difficulty (Source: Trust me and dig through the code yourself I suggest starting with Forge's DedicatedServer object)

/* Commits: */
* Pack Mode Switcher changes to address 241 in the most roundabout way possible

* pack mode switcher updates and changing server.properties

* added the properties files

* made the readme's more friendly

* more readme-bility

* Made README more tutorial

* typofix/capitialization is my passion

* readme updates

* forced

* repalace

* expert mode, again

* script disclaimer

* Script disclaimer

* hopefully fixed jank formatting

* fixed jank formatting

* beautify
2023-04-08 20:08:03 +10:00

39 lines
989 B
Batchfile

@echo off
echo Nomifactory GTCEu Port / Pack mode switcher
setlocal
set normalCfgPath=%~dp0config-overrides\normal
set expertCfgPath=%~dp0config-overrides\expert
set targetPath=%~dp0config
echo Set pack mode
echo N: normal
echo E: expert (hard)
choice /c NE /m "selection"
if "%errorlevel%" == "1" goto copyNormal
if "%errorlevel%" == "2" goto copyExpert
:copyNormal
robocopy "%normalCfgPath%" "%targetPath%" *.* /e /nfl /ndl
rem If server.properties exists, update server config
IF EXIST server.properties (move "%targetPath%\server.properties" .\)
echo normal > .mode
goto end
:copyExpert
robocopy "%expertCfgPath%" "%targetPath%" *.* /e /nfl /ndl
rem If server.properties exists, update server config
IF EXIST server.properties (move "%targetPath%\server.properties" .\)
echo expert > .mode
:end
rem if server.properties is left over in the config path, remove it
IF EXIST "%targetPath%/server.properties" DEL "%targetPath%\server.properties"
echo Switch completed
pause
exit