diff --git a/scripts/start-setupWorld b/scripts/start-setupWorld index 9b3a7884..c15e8509 100755 --- a/scripts/start-setupWorld +++ b/scripts/start-setupWorld @@ -127,8 +127,14 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); if [ "$FAMILY" = "SPIGOT" ]; then # Reorganise if a Spigot server log "Moving End and Nether maps to Spigot location" - [ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "${worldDest}_the_end" - [ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "${worldDest}_nether" + if [ -d "$worldDest/DIM1" ]; then + mkdir -p "${worldDest}_the_end" + mv -f "$worldDest/DIM1" "${worldDest}_the_end/" + fi + if [ -d "$worldDest/DIM-1" ]; then + mkdir -p "${worldDest}_nether" + mv -f "$worldDest/DIM-1" "${worldDest}_nether/" + fi fi fi diff --git a/tests/setuponlytests/vanilla_world_dir_for_spigot_server/docker-compose.yml b/tests/setuponlytests/vanilla_world_dir_for_spigot_server/docker-compose.yml new file mode 100644 index 00000000..3e345808 --- /dev/null +++ b/tests/setuponlytests/vanilla_world_dir_for_spigot_server/docker-compose.yml @@ -0,0 +1,15 @@ +services: + mc: + restart: "no" + image: ${IMAGE_TO_TEST:-itzg/minecraft-server} + environment: + EULA: "TRUE" + SETUP_ONLY: "TRUE" + TYPE: "PAPER" + WORLD: /worlds/world + # the following are only used to speed up test execution + VERSION: 1.18.1 + PAPER_CUSTOM_JAR: /servers/fake.jar + volumes: + - ./worlds:/worlds:ro + - ./data:/data diff --git a/tests/setuponlytests/vanilla_world_dir_for_spigot_server/verify.sh b/tests/setuponlytests/vanilla_world_dir_for_spigot_server/verify.sh new file mode 100644 index 00000000..89a74836 --- /dev/null +++ b/tests/setuponlytests/vanilla_world_dir_for_spigot_server/verify.sh @@ -0,0 +1,3 @@ +mc-image-helper assert fileExists world/level.dat && \ +mc-image-helper assert fileExists world_nether/DIM-1/some_nether_file && \ +mc-image-helper assert fileExists world_the_end/DIM1/some_end_file diff --git a/tests/setuponlytests/vanilla_world_dir_for_spigot_server/worlds/world/DIM-1/some_nether_file b/tests/setuponlytests/vanilla_world_dir_for_spigot_server/worlds/world/DIM-1/some_nether_file new file mode 100644 index 00000000..e69de29b diff --git a/tests/setuponlytests/vanilla_world_dir_for_spigot_server/worlds/world/DIM1/some_end_file b/tests/setuponlytests/vanilla_world_dir_for_spigot_server/worlds/world/DIM1/some_end_file new file mode 100644 index 00000000..e69de29b diff --git a/tests/setuponlytests/vanilla_world_dir_for_spigot_server/worlds/world/level.dat b/tests/setuponlytests/vanilla_world_dir_for_spigot_server/worlds/world/level.dat new file mode 100644 index 00000000..e69de29b