mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-11-10 14:24:28 +00:00
Remove existing world data when FORCE_WORLD_COPY (#816)
This commit is contained in:
parent
327538a98f
commit
7aa47e2a60
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue