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
This commit is contained in:
0xC4DE 2023-04-08 05:08:03 -05:00 committed by GitHub
parent f1bbaf4658
commit c50caee9dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 150 additions and 34 deletions

View File

@ -20,21 +20,29 @@ nomi-ceu comes with compatibility scripts for the following mods. You can drop t
\* Note: If you are adding these mods via the CurseForge app, remove the copy of non-Extended Life AE2 it might automatically download. \* Note: If you are adding these mods via the CurseForge app, remove the copy of non-Extended Life AE2 it might automatically download.
## Hard mode info ## Expert Mode
If you want a harder, or perhaps a more "true" GregTech experience, check out the Expert mode. This pack mode is based on the [Self-Torture Edition fork](https://github.com/NotMyWing/Omnifactory-Self-Torture-Edition) of the original pack. Highlights include: If you want a harder, or perhaps a more "true" GregTech experience, check out the Expert mode. This pack mode is based on the [Self-Torture Edition fork](https://github.com/NotMyWing/Omnifactory-Self-Torture-Edition) of the original pack. Highlights include:
- No DME for easy infinite resources - Forced Peaceful Mode
- Nomicoins can't be spent - No DME for easy infinite resources
- The Steam Age - Nomicoins can't be spent
- No Creative Tank; instead... - The Steam Age
- Stabilized Micro Miners for late-game infinite resources - No Creative Tank; instead...
- Stabilized Micro Miners for late-game infinite resources
- Harder recipes for assorted things like Iridium, Graphene, Numismatic Dynamos, and more - Harder recipes for assorted things like Iridium, Graphene, Numismatic Dynamos, and more
Installation instructions: Installation:
- Install the hardmode config files from [here](https://github.com/tracer4b/nomi-ceu/tree/main/overrides). Restart the pack for this to take effect. NOTE: Scripts may not fully work on versions <1.5.3, thus manual installation may be necessary.
- Windows users may grab the utility [here](https://raw.githubusercontent.com/tracer4b/nomi-ceu/main/pack-mode-switcher.bat)(right click - save as), save it to the root directory of the pack (the same level as `\config`). - Windows:
- MacOS and GNU/Linux users can run `curl -O https://raw.githubusercontent.com/tracer4b/nomi-ceu/main/pack-mode-switcher.sh` then verify the contents with your editor of choice before running `chmod +x pack-mode-switcher.sh; sh pack-mode-switcher.sh` in the pack root directory (the one containing `/config`). - Download [here](https://raw.githubusercontent.com/tracer4b/nomi-ceu/main/pack-mode-switcher.bat)(right click - save as) save it to the root directory of the pack (the same level as `\config`).
- If you are on an existing world, run `/bq_admin default load` to load the hard mode questbook. - Run the pack mode switcher in a terminal with `./pack-mode-switcher.bat`
- Any GNU/Linux (Mac and Linux):
- Run `curl -O https://raw.githubusercontent.com/tracer4b/nomi-ceu/main/pack-mode-switcher.sh` to download the file.
- Verify the contents with your editor of choice.
- Run `chmod +x pack-mode-switcher.sh; sh pack-mode-switcher.sh` in the pack root directory (the one containing `/config`).
Manual installation instructions: [here](overrides/README.md)
## Bansoukou ## Bansoukou
This pack uses two bansoukou patches. This pack uses two bansoukou patches.

View File

@ -1,10 +1,19 @@
# Hard mode config files # Expert Mode config files
Config files for normal and hard modes are found in `\config-overrides\normal` and `\config-overrides\expert` respectively. Config files for normal and expert mode are found in `\config-overrides\normal` and `\config-overrides\expert` respectively.
To install hard mode, drag the files inside `\config-overrides\expert` into the main `config` folder, as below: Users can use any of the below methods to replace configs:
Manual (All versions):
- Drag the files inside `\config-overrides\expert` into the main `config` folder, as shown in below image
- If on a server move the `server.properties` out of the config directory and into the root directory of your server (the path containing your launch script)
- If on a client you can safely delete `server.properties`
![image](https://user-images.githubusercontent.com/61507029/168111281-65006a94-4b4d-4255-aca1-1f5039eec705.png) ![image](https://user-images.githubusercontent.com/61507029/168111281-65006a94-4b4d-4255-aca1-1f5039eec705.png)
The same for reverting back to normal mode, plus manually deleting `\config\globalgamerules.cfg` to cancel forced peaceful. Scripted Installation (>1.5.3)
- Windows:
Windows users may also use `pack-mode-switcher.bat` found in the root directory. (It was here so it comes with the pack, but curseforge clearly doesn't want suspicious file in the release.') - Download [here](https://raw.githubusercontent.com/tracer4b/nomi-ceu/main/pack-mode-switcher.bat)(right click - save as) save it to the root directory of the pack (the same level as `\config`).
- Run the pack mode switcher in a terminal with `./pack-mode-switcher.bat`
- Any GNU/Linux (Mac and Linux) System:
- Run `curl -O https://raw.githubusercontent.com/tracer4b/nomi-ceu/main/pack-mode-switcher.sh` to download the file.
- Verify the contents with your editor of choice.
- Run `chmod +x pack-mode-switcher.sh; sh pack-mode-switcher.sh` in the pack root directory (the one containing `/config`).

View File

@ -0,0 +1,32 @@
#Minecraft server properties
op-permission-level=4
level-name=world
allow-flight=true
prevent-proxy-connections=false
server-port=25565
max-world-size=29999984
level-seed=
force-gamemode=false
server-ip=
network-compression-threshold=256
max-build-height=256
spawn-npcs=true
white-list=false
spawn-animals=true
hardcore=false
snooper-enabled=true
resource-pack-sha1=
online-mode=true
resource-pack=
pvp=true
difficulty=0
enable-command-block=false
gamemode=0
player-idle-timeout=0
max-players=20
spawn-monsters=true
view-distance=10
generate-structures=true
motd=nomi-ceu Server
level-type=lostcities
generator-settings=

View File

@ -0,0 +1,32 @@
#Minecraft server properties
op-permission-level=4
level-name=world
allow-flight=true
prevent-proxy-connections=false
server-port=25565
max-world-size=29999984
level-seed=
force-gamemode=false
server-ip=
network-compression-threshold=256
max-build-height=256
spawn-npcs=true
white-list=false
spawn-animals=true
hardcore=false
snooper-enabled=true
resource-pack-sha1=
online-mode=true
resource-pack=
pvp=true
difficulty=1
enable-command-block=false
gamemode=0
player-idle-timeout=0
max-players=20
spawn-monsters=true
view-distance=10
generate-structures=true
motd=nomi-ceu Server
level-type=lostcities
generator-settings=

View File

@ -1,7 +1,8 @@
@echo off @echo off
echo Nomifactory GTCEu Port / Pack mode switcher echo Nomifactory GTCEu Port / Pack mode switcher
setlocal setlocal
set normalCfgPath=%~dp0config-overrides\normal set normalCfgPath=%~dp0config-overrides\normal
set expertCfgPath=%~dp0config-overrides\expert set expertCfgPath=%~dp0config-overrides\expert
set targetPath=%~dp0config set targetPath=%~dp0config
@ -16,13 +17,22 @@ if "%errorlevel%" == "2" goto copyExpert
:copyNormal :copyNormal
robocopy "%normalCfgPath%" "%targetPath%" *.* /e /nfl /ndl robocopy "%normalCfgPath%" "%targetPath%" *.* /e /nfl /ndl
del "%targetPath%\globalgamerules.cfg"
goto end rem If server.properties exists, update server config
:copyExpert IF EXIST server.properties (move "%targetPath%\server.properties" .\)
robocopy "%expertCfgPath%" "%targetPath%" *.* /e /nfl /ndl echo normal > .mode
goto end 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 :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 echo Switch completed
pause pause
exit exit

View File

@ -1,30 +1,55 @@
#!/usr/bin/env sh #!/usr/bin/env sh
touch .mode
set -e set -e
echo -e "Nomifactory GTCEu Port / Pack mode switcher" echo "Nomifactory GTCEu Port / Pack mode switcher"
NORMAL_CFG=./config-overrides/normal NORMAL_CFG=config-overrides/normal
EXPERT_CFG=./config-overrides/expert EXPERT_CFG=config-overrides/expert
TARGET=./config TARGET=./config
CURRENT_MODE="$(head .mode)"
CURRENT_MODE=${CURRENT_MODE:="normal"}
echo "Current Mode: $CURRENT_MODE"
if [ -z "$1" ]; then if [ -z "$1" ]; then
echo -en "Set pack mode (Normal / Expert): " echo -n "Set pack mode (Normal / Expert): "
read MODE read MODE
else else
MODE="$1" MODE="$1"
fi fi
case "$MODE" in case $MODE in
N|n|normal) N|n|normal)
cp -rf "$NORMAL_CFG"/* "$TARGET"
rm -f "$TARGET/globalgamerules.cfg" cp -rf "$NORMAL_CFG/." ${TARGET}
# Only copy server.properties if it exists.
if [ -f "server.properties" ]; then
mv "${TARGET}/server.properties" ./
else
rm "${TARGET}/server.properties"
fi
# Update Mode
echo normal > .mode
;; ;;
E|e|expert) E|e|expert)
cp -rf "$EXPERT_CFG"/* "$TARGET"
cp -rf "$EXPERT_CFG/." ${TARGET}
if [ -f "server.properties" ]; then
mv "${TARGET}/server.properties" ./
else
rm "${TARGET}/server.properties"
fi
# Update Mode
echo expert > .mode
;; ;;
*) *)
echo -e "Error: Invalid mode $MODE" echo -e "Error: Invalid input $MODE"
exit 1 exit 1
;; ;;
esac esac