From 31b0f711b8a8a0b8165241673d317f9681a26461 Mon Sep 17 00:00:00 2001 From: Mike Wilson Date: Sat, 12 Dec 2020 09:26:32 -0500 Subject: [PATCH] Fixing some spigot world import issues (#683) * Fixing adding an existing spigot world and removing incorrectly identifying spigot worlds as multiple worlds * Update start-finalSetupWorld Co-authored-by: Geoff Bourne Co-authored-by: Geoff Bourne --- start-finalSetupWorld | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/start-finalSetupWorld b/start-finalSetupWorld index 24642e59..bf3b5ded 100644 --- a/start-finalSetupWorld +++ b/start-finalSetupWorld @@ -25,7 +25,12 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); mkdir -p /tmp/world-data (cd /tmp/world-data && unzip -o -q "$zipSrc") - baseDirs=$(find /tmp/world-data -name "level.dat" -exec dirname "{}" \;) + if [ "$TYPE" = "SPIGOT" ]; then + baseDirs=$(find /tmp/world-data -name "level.dat" -not -path "*_nether*" -not -path "*_the_end*" -printf "%h") + else + baseDirs=$(find /tmp/world-data -name "level.dat" -exec dirname "{}" \;) + fi + count=$(echo "$baseDirs" | wc -l) if [[ $count -gt 1 ]]; then baseDir="$(echo "$baseDirs" | sed -n ${WORLD_INDEX:-1}p)" @@ -38,6 +43,11 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] ); exit 1 fi rsync --remove-source-files --recursive --delete "$baseDir/" "$worldDest" + if [ "$TYPE" = "SPIGOT" ]; then + log "Copying end and nether ..." + [ -d "${baseDir}_nether" ] && rsync --remove-source-files --recursive --delete "${baseDir}_nether/" "${worldDest}_nether" + [ -d "${baseDir}_the_end" ] && rsync --remove-source-files --recursive --delete "${baseDir}_the_end/" "${worldDest}_the_end" + fi else log "Cloning world directory from $WORLD ..." rsync --recursive --delete "${WORLD%/}"/ "$worldDest"