From 32a918b90233fff4fba20e7561ff5b156ccff456 Mon Sep 17 00:00:00 2001 From: ATMD Date: Thu, 29 Jun 2017 19:56:14 +0200 Subject: [PATCH 1/3] Fix typo SPAWN_ANIMIALS --- minecraft-server/start-minecraft.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minecraft-server/start-minecraft.sh b/minecraft-server/start-minecraft.sh index 30ab985e..f20f7251 100755 --- a/minecraft-server/start-minecraft.sh +++ b/minecraft-server/start-minecraft.sh @@ -441,7 +441,7 @@ if [ ! -e server.properties ]; then setServerProp "allow-nether" "$ALLOW_NETHER" setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS" setServerProp "enable-command-block" "$ENABLE_COMMAND_BLOCK" - setServerProp "spawn-animals" "$SPAWN_ANIMAILS" + setServerProp "spawn-animals" "$SPAWN_ANIMALS" setServerProp "spawn-monsters" "$SPAWN_MONSTERS" setServerProp "spawn-npcs" "$SPAWN_NPCS" setServerProp "generate-structures" "$GENERATE_STRUCTURES" From f875af5cdbad1fe491a96cfd1e4f02ff5ece8d08 Mon Sep 17 00:00:00 2001 From: ATMD Date: Thu, 29 Jun 2017 20:25:24 +0200 Subject: [PATCH 2/3] Delete repetition of spawn-npcs --- minecraft-server/start-minecraft.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/minecraft-server/start-minecraft.sh b/minecraft-server/start-minecraft.sh index f20f7251..268b1cdb 100755 --- a/minecraft-server/start-minecraft.sh +++ b/minecraft-server/start-minecraft.sh @@ -445,7 +445,6 @@ if [ ! -e server.properties ]; then setServerProp "spawn-monsters" "$SPAWN_MONSTERS" setServerProp "spawn-npcs" "$SPAWN_NPCS" setServerProp "generate-structures" "$GENERATE_STRUCTURES" - setServerProp "spawn-npcs" "$SPAWN_NPCS" setServerProp "view-distance" "$VIEW_DISTANCE" setServerProp "hardcore" "$HARDCORE" setServerProp "max-build-height" "$MAX_BUILD_HEIGHT" From 0195b42eeab10d786a1fb723ae6466ef978f6c49 Mon Sep 17 00:00:00 2001 From: ATMD Date: Thu, 29 Jun 2017 21:53:26 +0200 Subject: [PATCH 3/3] Fix regex to change gamemode value The sed command `sed -i "/gamemode\s*=/ c gamemode=$MODE" $SERVER_PROPERTIES` matches all lines containing `gamemode=`. This includes the line `force-gamemode` that is set it with `setServerProp "force-gamemode" "$FORCE_GAMEMODE"` So basically the `force-gamemode` line is erased and the `gamemode=value` line is duplicated, and then the server cleans it up at start and deduplicates the `gamemode` line and create a new `force-gamemode` line with a default value. This fix ensures that only the `gamemode=` line is modified when changing the gamemode value. --- minecraft-server/start-minecraft.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minecraft-server/start-minecraft.sh b/minecraft-server/start-minecraft.sh index 268b1cdb..bc2f9ce5 100755 --- a/minecraft-server/start-minecraft.sh +++ b/minecraft-server/start-minecraft.sh @@ -526,7 +526,7 @@ if [ ! -e server.properties ]; then ;; esac - sed -i "/gamemode\s*=/ c gamemode=$MODE" $SERVER_PROPERTIES + sed -i "/^gamemode\s*=/ c gamemode=$MODE" $SERVER_PROPERTIES fi fi