From 7aa47e2a60cd0360103480fb1535875dc6e2c1d6 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Mon, 29 Mar 2021 21:14:21 -0500 Subject: [PATCH] Remove existing world data when FORCE_WORLD_COPY (#816) --- start-finalSetupWorld | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/start-finalSetupWorld b/start-finalSetupWorld index 96537246..cfbd4ad0 100644 --- a/start-finalSetupWorld +++ b/start-finalSetupWorld @@ -14,6 +14,13 @@ else fi if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); then + if isTrue "${FORCE_WORLD_COPY}"; then + log "Removing existing world data in $worldDest ${worldDest}_nether ${worldDest}_the_end" + rm -rf "$worldDest" \ + "${worldDest}_nether" \ + "${worldDest}_the_end" + fi + if isURL $WORLD; then curl -fsSL "$WORLD" -o /tmp/world.zip zipSrc=/tmp/world.zip @@ -59,8 +66,8 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); if [ "$TYPE" = "SPIGOT" ]; then # Reorganise if a Spigot server log "Moving End and Nether maps to Spigot location" - [ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "/data/${LEVEL}_the_end" - [ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "/data/${LEVEL}_nether" + [ -d "$worldDest/DIM1" ] && mv -f "$worldDest/DIM1" "${worldDest}_the_end" + [ -d "$worldDest/DIM-1" ] && mv -f "$worldDest/DIM-1" "${worldDest}_nether" fi fi