mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-11-22 06:34:21 +00:00
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 <itzgeoff@gmail.com> Co-authored-by: Geoff Bourne <itzgeoff@gmail.com>
This commit is contained in:
1 parent
59ca1ce3a6
commit
31b0f711b8
1 file changed
+11
-1
+11
-1
@@ -25,7 +25,12 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
|
|||||||
mkdir -p /tmp/world-data
|
mkdir -p /tmp/world-data
|
||||||
(cd /tmp/world-data && unzip -o -q "$zipSrc")
|
(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)
|
count=$(echo "$baseDirs" | wc -l)
|
||||||
if [[ $count -gt 1 ]]; then
|
if [[ $count -gt 1 ]]; then
|
||||||
baseDir="$(echo "$baseDirs" | sed -n ${WORLD_INDEX:-1}p)"
|
baseDir="$(echo "$baseDirs" | sed -n ${WORLD_INDEX:-1}p)"
|
||||||
@@ -38,6 +43,11 @@ if [[ "$WORLD" ]] && ( isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ] );
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rsync --remove-source-files --recursive --delete "$baseDir/" "$worldDest"
|
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
|
else
|
||||||
log "Cloning world directory from $WORLD ..."
|
log "Cloning world directory from $WORLD ..."
|
||||||
rsync --recursive --delete "${WORLD%/}"/ "$worldDest"
|
rsync --recursive --delete "${WORLD%/}"/ "$worldDest"
|
||||||
|
|||||||
Reference in new issue
Block a user